fix toolbar import
[ooovba.git] / moz / mozilla-source-1.7.5.patch
blob98abebba34a767f39f7eef0107441e5340d1d668
1 *** misc/mozilla/build/autoconf/mozconfig-find Fri Jul 16 20:13:24 2004
2 --- misc/build/mozilla/build/autoconf/mozconfig-find Tue Jan 15 13:34:32 2008
3 ***************
4 *** 51,60 ****
5 $topsrcdir/.mozconfig \
6 $topsrcdir/mozconfig \
7 $topsrcdir/mozconfig.sh \
8 ! $topsrcdir/myconfig.sh \
9 ! $HOME/.mozconfig \
10 ! $HOME/.mozconfig.sh \
11 ! $HOME/.mozmyconfig.sh
13 if test -f $_config; then
14 echo $_config;
15 --- 51,57 ----
16 $topsrcdir/.mozconfig \
17 $topsrcdir/mozconfig \
18 $topsrcdir/mozconfig.sh \
19 ! $topsrcdir/myconfig.sh
21 if test -f $_config; then
22 echo $_config;
23 *** misc/mozilla/build/cygwin-wrapper Thu Oct 30 22:05:56 2003
24 --- misc/build/mozilla/build/cygwin-wrapper Tue Jan 15 13:34:32 2008
25 ***************
26 *** 1,4 ****
27 ! #!/bin/sh
29 # Stupid wrapper to avoid win32 dospath/cygdrive issues
31 --- 1,4 ----
32 ! #!/bin/bash
34 # Stupid wrapper to avoid win32 dospath/cygdrive issues
36 ***************
37 *** 48,59 ****
38 i=-I${mountpoint}/${driveletter}/${pathname}
40 else
41 ! eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
42 ! if ! test "${leader}" = "${i}"; then
43 ! eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
44 ! eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
45 ! driveletter=${no_mountpoint%%/*}
46 ! i=${leader}${driveletter}:/${pathname}
50 --- 48,83 ----
51 i=-I${mountpoint}/${driveletter}/${pathname}
53 else
54 ! # The original version missed mounted paths, the new version below
55 ! # doesn't transform /para as this is most likely a parameter.
56 ! eval 'notinpath=${i%%'${mountpoint}'/[a-zA-Z]/*}'
57 ! if ! test "$notinpath" = "$i"; then
58 ! # found $mountpoint
59 ! eval 'restpath=${i#'${notinpath}${mountpoint}'/[a-zA-Z]/}'
60 ! eval 'withdrive=${i#'${notinpath}${mountpoint}'/}'
61 ! driveletter=${withdrive%%/*}
62 ! i=${notinpath}${driveletter}:/${restpath}
63 ! else
64 ! # check for potential path. Precheck using shell methods
65 ! doconvert=""
66 ! # Shortcut -X<path> when path does not begin with '/'
67 ! noswitch=${i#-[a-zA-Z]}
68 ! if test "$noswitch" != "$i"; then
69 ! test "${noswitch#/}" != "$noswitch" && doconvert="1"
70 ! fi
71 ! # Precheck for possible path. Consider only absolute paths that contain at least
72 ! # a second / to prevent converting of /abc parameters.
73 ! test -z "$doconvert" -a "${i#/[a-zA-Z0-9_.-]*/}" != "$i" && doconvert="1"
74 ! if test -n "$doconvert"; then
75 ! # Can be a path. If forking grep would be faster or we could require bash 3
76 ! # this regexp would be all that's needed to find pathnames that need converting
77 ! pathname=`echo $i | grep -oE '^(-[a-zA-Z])?/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_./-]+$'`
78 ! eval 'notinpath=${i%'${pathname}'}'
79 ! if test "$notinpath" != "$i" -a "$pathname" != "${pathname#/}"; then
80 ! pathname=`cygpath -am "$pathname"`
81 ! i=${notinpath}${pathname}
82 ! fi
83 ! fi
87 *** misc/mozilla/calendar/Makefile.in Sat Apr 10 16:27:46 2004
88 --- misc/build/mozilla/calendar/Makefile.in Tue Jan 15 13:34:32 2008
89 ***************
90 *** 106,112 ****
91 mkdir -p ./xpi/bin/chrome
92 mkdir -p ./xpi/resources
93 cp $(DEPTH)/dist/bin/chrome/calendar.jar ./xpi/bin/chrome
94 ! cp libxpical/$(LIB_PREFIX)xpical$(DLL_SUFFIX) ./xpi/bin/components
95 cp libxpical/_xpidlgen/calendar.xpt ./xpi/bin/components
96 cp $(srcdir)/resources/content/calendarService.js ./xpi/bin/components
97 cp -r $(srcdir)/resources/locale ./xpi/resources
98 --- 106,112 ----
99 mkdir -p ./xpi/bin/chrome
100 mkdir -p ./xpi/resources
101 cp $(DEPTH)/dist/bin/chrome/calendar.jar ./xpi/bin/chrome
102 ! cp libxpical/$(DLL_PREFIX)xpical$(DLL_SUFFIX) ./xpi/bin/components
103 cp libxpical/_xpidlgen/calendar.xpt ./xpi/bin/components
104 cp $(srcdir)/resources/content/calendarService.js ./xpi/bin/components
105 cp -r $(srcdir)/resources/locale ./xpi/resources
106 *** misc/mozilla/calendar/sunbird/Makefile.in Wed Apr 7 21:18:59 2004
107 --- misc/build/mozilla/calendar/sunbird/Makefile.in Tue Jan 15 13:34:32 2008
108 ***************
109 *** 71,87 ****
110 sunbird::sunbirddirs sunbirdunix
111 endif
112 cp $(topsrcdir)/dist/bin/MozillaSunbird* ./MozillaSunbird
113 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)plc4$(DLL_SUFFIX) ./MozillaSunbird/
114 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)ssl3$(DLL_SUFFIX) ./MozillaSunbird/
115 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)xpcom$(DLL_SUFFIX) ./MozillaSunbird/
116 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)nss3$(DLL_SUFFIX) ./MozillaSunbird/
117 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)smime3$(DLL_SUFFIX) ./MozillaSunbird/
118 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)xpistub$(DLL_SUFFIX) ./MozillaSunbird/
119 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)nspr4$(DLL_SUFFIX) ./MozillaSunbird/
120 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)nssckbi$(DLL_SUFFIX) ./MozillaSunbird/
121 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)plds4$(DLL_SUFFIX) ./MozillaSunbird/
122 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)softokn3$(DLL_SUFFIX) ./MozillaSunbird/
123 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)xpcom_compat$(DLL_SUFFIX) ./MozillaSunbird/
124 cp $(topsrcdir)/dist/bin/mangle ./MozillaSunbird/
125 cp $(topsrcdir)/dist/bin/shlibsign ./MozillaSunbird/
126 cp $(topsrcdir)/dist/bin/xpicleanup ./MozillaSunbird/
127 --- 71,87 ----
128 sunbird::sunbirddirs sunbirdunix
129 endif
130 cp $(topsrcdir)/dist/bin/MozillaSunbird* ./MozillaSunbird
131 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)plc4$(DLL_SUFFIX) ./MozillaSunbird/
132 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) ./MozillaSunbird/
133 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)xpcom$(DLL_SUFFIX) ./MozillaSunbird/
134 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX) ./MozillaSunbird/
135 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)smime3$(DLL_SUFFIX) ./MozillaSunbird/
136 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)xpistub$(DLL_SUFFIX) ./MozillaSunbird/
137 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) ./MozillaSunbird/
138 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)nssckbi$(DLL_SUFFIX) ./MozillaSunbird/
139 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)plds4$(DLL_SUFFIX) ./MozillaSunbird/
140 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) ./MozillaSunbird/
141 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)xpcom_compat$(DLL_SUFFIX) ./MozillaSunbird/
142 cp $(topsrcdir)/dist/bin/mangle ./MozillaSunbird/
143 cp $(topsrcdir)/dist/bin/shlibsign ./MozillaSunbird/
144 cp $(topsrcdir)/dist/bin/xpicleanup ./MozillaSunbird/
145 ***************
146 *** 185,191 ****
147 cp $(topsrcdir)/dist/bin/components/intl.xpt ./MozillaSunbird/components
148 cp $(topsrcdir)/dist/bin/components/lwbrk.xpt ./MozillaSunbird/components
149 cp $(topsrcdir)/dist/bin/components/chardet.xpt ./MozillaSunbird/components
150 ! cp $(topsrcdir)/dist/bin/components/$(LIB_PREFIX)jar50$(DLL_SUFFIX) ./MozillaSunbird/components
151 cp $(topsrcdir)/dist/bin/components/jar.xpt ./MozillaSunbird/components
152 cp $(topsrcdir)/dist/bin/components/oji.xpt ./MozillaSunbird/components
153 cp $(topsrcdir)/dist/bin/components/jsdservice.xpt ./MozillaSunbird/components
154 --- 185,191 ----
155 cp $(topsrcdir)/dist/bin/components/intl.xpt ./MozillaSunbird/components
156 cp $(topsrcdir)/dist/bin/components/lwbrk.xpt ./MozillaSunbird/components
157 cp $(topsrcdir)/dist/bin/components/chardet.xpt ./MozillaSunbird/components
158 ! cp $(topsrcdir)/dist/bin/components/$(DLL_PREFIX)jar50$(DLL_SUFFIX) ./MozillaSunbird/components
159 cp $(topsrcdir)/dist/bin/components/jar.xpt ./MozillaSunbird/components
160 cp $(topsrcdir)/dist/bin/components/oji.xpt ./MozillaSunbird/components
161 cp $(topsrcdir)/dist/bin/components/jsdservice.xpt ./MozillaSunbird/components
162 ***************
163 *** 283,293 ****
164 cp $(topsrcdir)/dist/bin/components/downloads.xpt ./MozillaSunbird/components
165 cp $(topsrcdir)/dist/bin/components/calendar.xpt ./MozillaSunbird/components
166 cp $(topsrcdir)/dist/bin/chrome/calendar.jar ./MozillaSunbird/chrome
167 ! cp $(topsrcdir)/dist/bin/components/$(LIB_PREFIX)xp*$(DLL_SUFFIX) ./MozillaSunbird/components
168 ! cp $(topsrcdir)/dist/bin/$(LIB_PREFIX)*js*$(DLL_SUFFIX) ./MozillaSunbird/
169 cp $(topsrcdir)/dist/bin/components/xpcom_thread*.xpt ./MozillaSunbird/components
170 cp $(topsrcdir)/dist/bin/components/proxyObj*.xpt ./MozillaSunbird/components
171 ! cp $(topsrcdir)/dist/bin/components/$(LIB_PREFIX)jsd*$(DLL_SUFFIX) ./MozillaSunbird/components
172 cp $(topsrcdir)/dist/bin/components/docshell*.xpt ./MozillaSunbird/components
174 sunbirdunix::
175 --- 283,293 ----
176 cp $(topsrcdir)/dist/bin/components/downloads.xpt ./MozillaSunbird/components
177 cp $(topsrcdir)/dist/bin/components/calendar.xpt ./MozillaSunbird/components
178 cp $(topsrcdir)/dist/bin/chrome/calendar.jar ./MozillaSunbird/chrome
179 ! cp $(topsrcdir)/dist/bin/components/$(DLL_PREFIX)xp*$(DLL_SUFFIX) ./MozillaSunbird/components
180 ! cp $(topsrcdir)/dist/bin/$(DLL_PREFIX)*js*$(DLL_SUFFIX) ./MozillaSunbird/
181 cp $(topsrcdir)/dist/bin/components/xpcom_thread*.xpt ./MozillaSunbird/components
182 cp $(topsrcdir)/dist/bin/components/proxyObj*.xpt ./MozillaSunbird/components
183 ! cp $(topsrcdir)/dist/bin/components/$(DLL_PREFIX)jsd*$(DLL_SUFFIX) ./MozillaSunbird/components
184 cp $(topsrcdir)/dist/bin/components/docshell*.xpt ./MozillaSunbird/components
186 sunbirdunix::
187 *** misc/mozilla/config/Makefile.in Mon Nov 1 19:30:40 2004
188 --- misc/build/mozilla/config/Makefile.in Tue Jan 15 13:34:32 2008
189 ***************
190 *** 135,141 ****
192 ifdef MOZ_ENABLE_GTK2
193 GLIB_CFLAGS = $(MOZ_GTK2_CFLAGS)
194 ! GLIB_LIBS = $(MOZ_GTK2_LIBS)
195 endif
197 build_number: FORCE
198 --- 135,141 ----
200 ifdef MOZ_ENABLE_GTK2
201 GLIB_CFLAGS = $(MOZ_GTK2_CFLAGS)
202 ! GLIB_LIBS = $(filter -lglib% -L%,$(MOZ_GTK2_LIBS))
203 endif
205 build_number: FORCE
206 *** misc/mozilla/config/config.mk Tue Oct 12 06:13:31 2004
207 --- misc/build/mozilla/config/config.mk Tue Jan 15 13:34:32 2008
208 ***************
209 *** 771,776 ****
210 --- 771,793 ----
211 endif
214 + # Shared library RUNPATH linker option(s)
216 + ifeq ($(OS_ARCH),Linux)
217 + EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
218 + ifdef IS_COMPONENT
219 + EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN/..:\$$ORIGIN/../../ure-link/lib
220 + endif # IS_COMPONENT
221 + endif # Linux
223 + ifeq ($(OS_ARCH),SunOS)
224 + EXTRA_DSO_LDOPTS += -R '$$ORIGIN'
225 + ifdef IS_COMPONENT
226 + EXTRA_DSO_LDOPTS += -R '$$ORIGIN/..'
227 + endif # IS_COMPONENT
228 + endif # SunOS
231 # Include any personal overrides the user might think are needed.
233 -include $(MY_CONFIG)
234 *** misc/mozilla/config/rules.mk Thu Jun 24 20:58:48 2004
235 --- misc/build/mozilla/config/rules.mk Tue Jan 15 13:34:32 2008
236 ***************
237 *** 516,523 ****
238 ifeq ($(OS_ARCH),WINNT)
239 ifdef GNU_CC
240 ifndef IS_COMPONENT
241 ! DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
242 endif
243 endif
244 endif
246 --- 516,524 ----
247 ifeq ($(OS_ARCH),WINNT)
248 ifdef GNU_CC
249 ifndef IS_COMPONENT
250 ! DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
251 endif
252 + DSO_LDOPTS += -Wl,--enable-runtime-pseudo-reloc -Wl,-Map -Wl,$(LIB_PREFIX)$(LIBRARY_NAME).map
253 endif
254 endif
256 ***************
257 *** 1320,1325 ****
258 --- 1321,1327 ----
260 $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
261 $(REPORT_BUILD)
262 + echo "PATH=" $(PATH)
263 $(ELOG) $(XPIDL_COMPILE) -m header -w -I$(srcdir) -I$(IDL_DIR) -o $(XPIDL_GEN_DIR)/$* $(_VPATH_SRCS)
264 @if test -n "$(findstring $*.h, $(EXPORTS) $(SDK_HEADERS))"; \
265 then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
266 *** misc/mozilla/configure Tue Oct 12 06:13:29 2004
267 --- misc/build/mozilla/configure Tue Jan 15 13:34:32 2008
268 ***************
269 *** 4972,4977 ****
270 --- 4972,4978 ----
271 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
272 _pwd=`pwd`
273 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
274 + CYGWIN_WRAPPER=`cygpath -u $CYGWIN_WRAPPER`
276 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
277 _AS_PERL=1
278 ***************
279 *** 5215,5221 ****
280 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
281 DLL_SUFFIX=".dylib"
282 DSO_LDOPTS=''
283 ! STRIP="$STRIP -x -S"
284 case "${target_cpu}" in
285 powerpc*)
286 _PLATFORM_DEFAULT_TOOLKIT='mac'
287 --- 5215,5221 ----
288 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
289 DLL_SUFFIX=".dylib"
290 DSO_LDOPTS=''
291 ! STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
292 case "${target_cpu}" in
293 powerpc*)
294 _PLATFORM_DEFAULT_TOOLKIT='mac'
295 ***************
296 *** 5228,5234 ****
299 *-freebsd*)
300 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
301 DLL_SUFFIX=".so.1.0"
302 DSO_LDOPTS="-shared"
304 --- 5229,5235 ----
307 *-freebsd*)
308 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
309 DLL_SUFFIX=".so.1.0"
310 DSO_LDOPTS="-shared"
312 ***************
313 *** 5476,5482 ****
314 case "$host" in
315 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
317 ! MOZ_BUILD_ROOT=`cygpath -w $MOZ_BUILD_ROOT | sed -e 's|\\\\|/|g'`
319 if test -z "$MOZ_TOOLS"; then
320 { echo "configure: error: MOZ_TOOLS is not set" 1>&2; exit 1; }
321 --- 5477,5483 ----
322 case "$host" in
323 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
325 ! MOZ_BUILD_ROOT=`cygpath -u $MOZ_BUILD_ROOT`
327 if test -z "$MOZ_TOOLS"; then
328 { echo "configure: error: MOZ_TOOLS is not set" 1>&2; exit 1; }
329 ***************
330 *** 5489,5495 ****
331 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
332 { echo "configure: error: \$MOZ_TOOLS\\bin must be in your path." 1>&2; exit 1; }
334 ! MOZ_TOOLS_DIR=`cygpath -w $MOZ_TOOLS_DIR | sed -e 's|\\\\|/|g'`
336 if test -n "$GLIB_PREFIX"; then
337 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
338 --- 5490,5496 ----
339 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
340 { echo "configure: error: \$MOZ_TOOLS\\bin must be in your path." 1>&2; exit 1; }
342 ! MOZ_TOOLS_DIR=`cygpath -u $MOZ_TOOLS_DIR`
344 if test -n "$GLIB_PREFIX"; then
345 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
346 ***************
347 *** 5497,5503 ****
348 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
349 { echo "configure: error: GLIB_PREFIX must be in your \$PATH." 1>&2; exit 1; }
351 ! _GLIB_PREFIX_DIR=`cygpath -w $_GLIB_PREFIX_DIR | sed -e 's|\\\\|/|g'`
352 else
353 { echo "configure: error: GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory." 1>&2; exit 1; }
355 --- 5498,5504 ----
356 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
357 { echo "configure: error: GLIB_PREFIX must be in your \$PATH." 1>&2; exit 1; }
359 ! _GLIB_PREFIX_DIR=`cygpath -u $_GLIB_PREFIX_DIR`
360 else
361 { echo "configure: error: GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory." 1>&2; exit 1; }
363 ***************
364 *** 5516,5522 ****
365 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
366 { echo "configure: error: LIBIDL_PREFIX must be in your \$PATH." 1>&2; exit 1; }
368 ! _LIBIDL_PREFIX_DIR=`cygpath -w $_LIBIDL_PREFIX_DIR | sed -e 's|\\\\|/|g'`
369 else
370 { echo "configure: error: LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory." 1>&2; exit 1; }
372 --- 5517,5523 ----
373 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
374 { echo "configure: error: LIBIDL_PREFIX must be in your \$PATH." 1>&2; exit 1; }
376 ! _LIBIDL_PREFIX_DIR=`cygpath -u $_LIBIDL_PREFIX_DIR`
377 else
378 { echo "configure: error: LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory." 1>&2; exit 1; }
380 ***************
381 *** 5895,5901 ****
382 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -Wl,-z -Wl,muldefs -o $@'
383 MKSHLIB_FORCE_ALL='-Qoption ld -z,allextract'
384 MKSHLIB_UNFORCE_ALL=''
385 ! DSO_LDOPTS='-G -Qoption ld -z,muldefs -h $@'
386 AR_LIST="$AR t"
387 AR_EXTRACT="$AR x"
388 AR_DELETE="$AR d"
389 --- 5896,5902 ----
390 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -Wl,-z -Wl,muldefs -o $@'
391 MKSHLIB_FORCE_ALL='-Qoption ld -z,allextract'
392 MKSHLIB_UNFORCE_ALL=''
393 ! DSO_LDOPTS='-G -norunpath -Qoption ld -z,muldefs -h $@'
394 AR_LIST="$AR t"
395 AR_EXTRACT="$AR x"
396 AR_DELETE="$AR d"
397 ***************
398 *** 7504,7509 ****
399 --- 7505,7512 ----
400 case $target in
401 *-hpux11.*)
403 + *-freebsd*)
404 + ;;
406 echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6
407 echo "configure:7510: checking for gethostbyname_r in -lc_r" >&5
408 ***************
409 *** 16606,16613 ****
410 --- 16609,16620 ----
412 case "$host_os" in
413 mingw*|cygwin*|msvc*|mks*)
414 + # Don't add the wrapper for the HOST_* versions as they contain an
415 + # unexpanded $CC and therfore wil get the wrapper below.
416 + if test -n "$GNU_CC"; then
417 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
418 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
419 + fi
420 CC="\$(CYGWIN_WRAPPER) $CC"
421 CXX="\$(CYGWIN_WRAPPER) $CXX"
422 CPP="\$(CYGWIN_WRAPPER) $CPP"
423 *** misc/mozilla/configure.in Tue Oct 12 06:13:29 2004
424 --- misc/build/mozilla/configure.in Tue Jan 15 13:34:32 2008
425 ***************
426 *** 993,999 ****
427 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
428 DLL_SUFFIX=".dylib"
429 DSO_LDOPTS=''
430 ! STRIP="$STRIP -x -S"
431 case "${target_cpu}" in
432 powerpc*)
433 _PLATFORM_DEFAULT_TOOLKIT='mac'
434 --- 993,999 ----
435 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
436 DLL_SUFFIX=".dylib"
437 DSO_LDOPTS=''
438 ! STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
439 case "${target_cpu}" in
440 powerpc*)
441 _PLATFORM_DEFAULT_TOOLKIT='mac'
442 ***************
443 *** 1006,1012 ****
446 *-freebsd*)
447 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
448 DLL_SUFFIX=".so.1.0"
449 DSO_LDOPTS="-shared"
451 --- 1006,1012 ----
454 *-freebsd*)
455 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
456 DLL_SUFFIX=".so.1.0"
457 DSO_LDOPTS="-shared"
459 ***************
460 *** 1536,1542 ****
461 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -Wl,-z -Wl,muldefs -o $@'
462 MKSHLIB_FORCE_ALL='-Qoption ld -z,allextract'
463 MKSHLIB_UNFORCE_ALL=''
464 ! DSO_LDOPTS='-G -Qoption ld -z,muldefs -h $@'
465 AR_LIST="$AR t"
466 AR_EXTRACT="$AR x"
467 AR_DELETE="$AR d"
468 --- 1536,1542 ----
469 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -Wl,-z -Wl,muldefs -o $@'
470 MKSHLIB_FORCE_ALL='-Qoption ld -z,allextract'
471 MKSHLIB_UNFORCE_ALL=''
472 ! DSO_LDOPTS='-G -norunpath -Qoption ld -z,muldefs -h $@'
473 AR_LIST="$AR t"
474 AR_EXTRACT="$AR x"
475 AR_DELETE="$AR d"
476 ***************
477 *** 1981,1986 ****
478 --- 1981,1988 ----
479 case $target in
480 *-hpux11.*)
482 + *-freebsd*)
483 + ;;
485 AC_CHECK_LIB(c_r, gethostbyname_r)
487 ***************
488 *** 5692,5699 ****
489 --- 5694,5705 ----
490 dnl ========================================================
491 case "$host_os" in
492 mingw*|cygwin*|msvc*|mks*)
493 + # Don't add the wrapper for the HOST_* versions as they contain an
494 + # unexpanded $CC and therfore wil get the wrapper below.
495 + if test -n "$GNU_CC"; then
496 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
497 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
498 + fi
499 CC="\$(CYGWIN_WRAPPER) $CC"
500 CXX="\$(CYGWIN_WRAPPER) $CXX"
501 CPP="\$(CYGWIN_WRAPPER) $CPP"
502 *** misc/mozilla/directory/c-sdk/build.mk Tue Sep 14 23:14:38 2004
503 --- misc/build/mozilla/directory/c-sdk/build.mk Tue Jan 15 13:34:32 2008
504 ***************
505 *** 367,373 ****
506 ifdef NS_USE_GCC
507 LINK_EXE = $(CC) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
508 LINK_LIB = $(AR) cr $@ $(OBJS)
509 ! 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)
510 else
511 DEBUG_LINK_OPT=/DEBUG
512 ifeq ($(BUILD_OPT), 1)
513 --- 367,373 ----
514 ifdef NS_USE_GCC
515 LINK_EXE = $(CC) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
516 LINK_LIB = $(AR) cr $@ $(OBJS)
517 ! 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)
518 else
519 DEBUG_LINK_OPT=/DEBUG
520 ifeq ($(BUILD_OPT), 1)
521 *** misc/mozilla/directory/c-sdk/config/FreeBSD.mk Tue Mar 26 22:51:46 2002
522 --- misc/build/mozilla/directory/c-sdk/config/FreeBSD.mk Tue Jan 15 13:34:32 2008
523 ***************
524 *** 66,72 ****
526 ARCH = freebsd
528 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
530 ifeq ($(MOZ_OBJFORMAT),elf)
531 DLL_SUFFIX = so
532 --- 66,72 ----
534 ARCH = freebsd
536 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
538 ifeq ($(MOZ_OBJFORMAT),elf)
539 DLL_SUFFIX = so
540 *** misc/mozilla/directory/c-sdk/config/Makefile Wed Feb 11 05:01:16 2004
541 --- misc/build/mozilla/directory/c-sdk/config/Makefile Tue Jan 15 13:34:32 2008
542 ***************
543 *** 48,58 ****
545 include $(topsrcdir)/config/config.mk
547 ! CSRCS = nsinstall.c now.c
549 PLSRCS = nfspwd.pl
551 ! ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
552 PROG_SUFFIX = .exe
553 else
554 PROG_SUFFIX =
555 --- 48,62 ----
557 include $(topsrcdir)/config/config.mk
559 ! ifndef MOZILLA_CLIENT
560 ! CSRCS = nsinstall.c
561 ! endif
563 ! CSRCS += now.c
565 PLSRCS = nfspwd.pl
567 ! ifneq (,$(CROSS_COMPILE)$(filter WINNT OS2,$(OS_ARCH)))
568 PROG_SUFFIX = .exe
569 else
570 PROG_SUFFIX =
571 ***************
572 *** 92,100 ****
573 XLDOPTS += $(LDFLAGS)
574 endif
576 ! ifdef XP_OS2_EMX
577 XCFLAGS = $(OS_EXE_CFLAGS)
578 ! XLDOPTS = -Zlinker /PM:VIO
579 endif
581 ifeq ($(MOZ_OS2_TOOLS),VACPP)
582 --- 96,104 ----
583 XLDOPTS += $(LDFLAGS)
584 endif
586 ! ifeq ($(MOZ_OS2_TOOLS),EMX)
587 XCFLAGS = $(OS_EXE_CFLAGS)
588 ! XLDOPTS = -Zomf -Zlinker /PM:VIO
589 endif
591 ifeq ($(MOZ_OS2_TOOLS),VACPP)
592 ***************
593 *** 114,120 ****
594 --- 118,126 ----
596 OUTOPTION = -o # end of the line
597 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
598 + ifndef NS_USE_GCC
599 OUTOPTION = /Fe
600 + endif
601 endif
603 # Redefine MAKE_OBJDIR for just this directory
604 *** misc/mozilla/directory/c-sdk/config/autoconf.mk.in Fri Mar 7 21:57:13 2003
605 --- misc/build/mozilla/directory/c-sdk/config/autoconf.mk.in Tue Jan 15 13:34:32 2008
606 ***************
607 *** 25,30 ****
608 --- 25,31 ----
609 LIB_SUFFIX = @LIB_SUFFIX@
610 LIB_PREFIX = @LIB_PREFIX@
611 DLL_SUFFIX = @DLL_SUFFIX@
612 + DLL_PREFIX = @DLL_PREFIX@
613 ASM_SUFFIX = @ASM_SUFFIX@
614 PROG_SUFFIX = @PROG_SUFFIX@
615 MOD_NAME = @NSPR_MODNAME@
616 *** misc/mozilla/directory/c-sdk/config/cygwin-wrapper Thu Apr 3 01:22:39 2003
617 --- misc/build/mozilla/directory/c-sdk/config/cygwin-wrapper Tue Jan 15 13:34:32 2008
618 ***************
619 *** 1,4 ****
620 ! #!/bin/sh
622 # Stupid wrapper to avoid win32 dospath/cygdrive issues
624 --- 1,4 ----
625 ! #!/bin/bash
627 # Stupid wrapper to avoid win32 dospath/cygdrive issues
629 ***************
630 *** 18,23 ****
631 shift
632 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
633 else
634 ! args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
636 exec $prog $args
637 --- 18,57 ----
638 shift
639 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
640 else
641 ! for i in "${@}"
642 ! do
643 ! # The original version missed mounted paths, the new version below
644 ! # doesn't transform /para as this is most likely a parameter.
645 ! eval 'notinpath=${i%%'${mountpoint}'/[a-zA-Z]/*}'
646 ! if ! test "$notinpath" = "$i"; then
647 ! # found $mountpoint
648 ! eval 'restpath=${i#'${notinpath}${mountpoint}'/[a-zA-Z]/}'
649 ! eval 'withdrive=${i#'${notinpath}${mountpoint}'/}'
650 ! driveletter=${withdrive%%/*}
651 ! i=${notinpath}${driveletter}:/${restpath}
652 ! else
653 ! # check for potential path. Precheck using shell methods
654 ! doconvert=""
655 ! # Shortcut -X<path> when path does not begin with '/'
656 ! noswitch=${i#-[a-zA-Z]}
657 ! if test "$noswitch" != "$i"; then
658 ! test "${noswitch#/}" != "$noswitch" && doconvert="1"
659 ! fi
660 ! # Precheck for possible path. Consider only absolute paths that contain at least
661 ! # a second / to prevent converting of /abc parameters.
662 ! test -z "$doconvert" -a "${i#/[a-zA-Z0-9_.-]*/}" != "$i" && doconvert="1"
663 ! if test -n "$doconvert"; then
664 ! # Can be a path. If forking grep would be faster or we could require bash 3
665 ! # this regexp would be all that's needed to find pathnames that need converting
666 ! pathname=`echo $i | grep -oE '^(-[a-zA-Z])?/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_./-]+$'`
667 ! eval 'notinpath=${i%'${pathname}'}'
668 ! if test "$notinpath" != "$i" -a "$pathname" != "${pathname#/}"; then
669 ! pathname=`cygpath -am "$pathname"`
670 ! i=${notinpath}${pathname}
671 ! fi
672 ! fi
673 ! fi
674 ! args="${args} ${i}"
675 ! done
677 exec $prog $args
678 *** misc/mozilla/directory/c-sdk/configure Tue Sep 14 23:14:38 2004
679 --- misc/build/mozilla/directory/c-sdk/configure Tue Jan 15 13:34:32 2008
680 ***************
681 *** 2830,2835 ****
682 --- 2830,2836 ----
683 LIB_SUFFIX=a
684 LIB_PREFIX=lib
685 DLL_SUFFIX=so
686 + DLL_PREFIX=lib
687 ASM_SUFFIX=s
688 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
689 PR_MD_ASFILES=
690 ***************
691 *** 3465,3471 ****
694 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
695 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
696 if test "$MOZ_OBJFORMAT" = "elf"; then
697 DLL_SUFFIX=so
698 else
699 --- 3466,3472 ----
702 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
703 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
704 if test "$MOZ_OBJFORMAT" = "elf"; then
705 DLL_SUFFIX=so
706 else
707 ***************
708 *** 3832,3837 ****
709 --- 3833,3839 ----
710 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
711 DSO_CFLAGS=-fPIC
712 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
713 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
714 OS_LIBS="$OS_LIBS -lc"
715 _OPTIMIZE_FLAGS=-O2
716 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
717 ***************
718 *** 3901,3907 ****
719 CC="$CC -mno-cygwin"
720 CXX="$CXX -mno-cygwin"
721 DLL_SUFFIX=dll
722 ! MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
723 # Use temp file for windres (bug 213281)
724 RC="$WINDRES -O coff --use-temp-file"
725 else
726 --- 3903,3910 ----
727 CC="$CC -mno-cygwin"
728 CXX="$CXX -mno-cygwin"
729 DLL_SUFFIX=dll
730 ! DLL_PREFIX=
731 ! MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
732 # Use temp file for windres (bug 213281)
733 RC="$WINDRES -O coff --use-temp-file"
734 else
735 ***************
736 *** 3918,3923 ****
737 --- 3921,3927 ----
738 LIB_SUFFIX=lib
739 LIB_PREFIX=
740 DLL_SUFFIX=dll
741 + DLL_PREFIX=
743 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
745 ***************
746 *** 4318,4323 ****
747 --- 4322,4328 ----
748 NSINSTALL=nsinstall
749 LIB_PREFIX=
750 LIB_SUFFIX=lib
751 + DLL_PREFIX=
752 DLL_SUFFIX=dll
753 DLLTOOL=''
754 RC=rc.exe
755 ***************
756 *** 4685,4690 ****
757 --- 4690,4696 ----
758 LD=/usr/ccs/bin/ld
759 RANLIB=/usr/ccs/bin/ranlib
760 DSO_LDOPTS='-G -h $(notdir $@)'
761 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
762 if test -n "$GNU_CC"; then
763 DSO_CFLAGS=-fPIC
764 else
765 ***************
766 *** 5882,5887 ****
767 --- 5888,5894 ----
768 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
769 s%@LIB_PREFIX@%$LIB_PREFIX%g
770 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
771 + s%@DLL_PREFIX@%$DLL_PREFIX%g
772 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
773 s%@PROG_SUFFIX@%$PROG_SUFFIX%g
774 s%@MKSHLIB@%$MKSHLIB%g
775 *** misc/mozilla/directory/c-sdk/configure.in Tue Sep 14 23:14:38 2004
776 --- misc/build/mozilla/directory/c-sdk/configure.in Tue Jan 15 13:34:32 2008
777 ***************
778 *** 511,516 ****
779 --- 511,517 ----
780 LIB_SUFFIX=a
781 LIB_PREFIX=lib
782 DLL_SUFFIX=so
783 + DLL_PREFIX=lib
784 ASM_SUFFIX=s
785 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
786 PR_MD_ASFILES=
787 ***************
788 *** 896,902 ****
789 AC_DEFINE(FREEBSD)
790 AC_DEFINE(HAVE_BSD_FLOCK)
791 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
792 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
793 if test "$MOZ_OBJFORMAT" = "elf"; then
794 DLL_SUFFIX=so
795 else
796 --- 897,903 ----
797 AC_DEFINE(FREEBSD)
798 AC_DEFINE(HAVE_BSD_FLOCK)
799 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
800 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
801 if test "$MOZ_OBJFORMAT" = "elf"; then
802 DLL_SUFFIX=so
803 else
804 ***************
805 *** 1144,1149 ****
806 --- 1145,1151 ----
807 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
808 DSO_CFLAGS=-fPIC
809 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
810 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
811 OS_LIBS="$OS_LIBS -lc"
812 _OPTIMIZE_FLAGS=-O2
813 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
814 ***************
815 *** 1195,1200 ****
816 --- 1197,1204 ----
817 CC="$CC -mno-cygwin"
818 CXX="$CXX -mno-cygwin"
819 DLL_SUFFIX=dll
820 + DLL_SUFFIX=dll
821 + DLL_PREFIX=
822 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
823 # Use temp file for windres (bug 213281)
824 RC="$WINDRES -O coff --use-temp-file"
825 ***************
826 *** 1212,1217 ****
827 --- 1216,1222 ----
828 LIB_SUFFIX=lib
829 LIB_PREFIX=
830 DLL_SUFFIX=dll
831 + DLL_PREFIX=
833 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
835 ***************
836 *** 1686,1691 ****
837 --- 1691,1697 ----
838 LD=/usr/ccs/bin/ld
839 RANLIB=/usr/ccs/bin/ranlib
840 DSO_LDOPTS='-G -h $(notdir $@)'
841 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
842 if test -n "$GNU_CC"; then
843 DSO_CFLAGS=-fPIC
844 else
845 ***************
846 *** 2272,2277 ****
847 --- 2278,2284 ----
848 AC_SUBST(LIB_SUFFIX)
849 AC_SUBST(LIB_PREFIX)
850 AC_SUBST(DLL_SUFFIX)
851 + AC_SUBST(DLL_PREFIX)
852 AC_SUBST(ASM_SUFFIX)
853 AC_SUBST(PROG_SUFFIX)
854 AC_SUBST(MKSHLIB)
855 *** misc/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in Wed Mar 10 19:47:25 2004
856 --- misc/build/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in Tue Jan 15 13:34:32 2008
857 ***************
858 *** 93,99 ****
859 HDIR = $(topsrcdir)/ldap/include
861 LIBLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(LIB_SUFFIX))
862 ! DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
864 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
866 --- 93,99 ----
867 HDIR = $(topsrcdir)/ldap/include
869 LIBLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(LIB_SUFFIX))
870 ! DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(DLL_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
872 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
874 *** misc/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in Wed Mar 10 19:47:26 2004
875 --- misc/build/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in Tue Jan 15 13:34:32 2008
876 ***************
877 *** 46,52 ****
878 LIBPRLDAP =
879 endif
880 DLLPRLDAP = $(addprefix $(OBJDIR_NAME)/, \
881 ! $(LIB_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
883 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
885 --- 46,52 ----
886 LIBPRLDAP =
887 endif
888 DLLPRLDAP = $(addprefix $(OBJDIR_NAME)/, \
889 ! $(DLL_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
891 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
893 *** misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile Wed Feb 11 05:01:15 2004
894 --- misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile Tue Jan 15 13:34:32 2008
895 ***************
896 *** 41,47 ****
897 HDIR = $(topsrcdir)/ldap/include
899 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
900 ! DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
902 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
904 --- 41,47 ----
905 HDIR = $(topsrcdir)/ldap/include
907 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
908 ! DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
910 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
912 ***************
913 *** 92,97 ****
914 --- 92,106 ----
915 endif
917 ifeq ($(OS_ARCH), WINNT)
918 + ifdef NS_USE_GCC
919 + EXTRA_DLL_LIBS = -L$(dist_libdir) -l$(LDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
920 + -l$(NSS_LIBNAME)
921 + ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
922 + EXTRA_DLL_LIBS += -l$(SOFTOKN_LIBNAME)
923 + endif
924 + EXTRA_DLL_LIBS += -l$(SSL_LIBNAME) \
925 + -l$(PLC_BASENAME) -l$(PLDS_BASENAME) -l$(NSPR_BASENAME)
926 + else
927 EXTRA_LIBS =wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
928 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
929 rpcrt4.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib
930 ***************
931 *** 105,110 ****
932 --- 114,120 ----
933 EXTRA_LIBS += $(dist_libdir)/$(SOFTOKN_LIBNAME).lib
934 endif
935 EXTRA_LIBS += $(dist_libdir)/$(SSL_LIBNAME).lib
936 + endif
937 endif
939 ifeq ($(OS_ARCH),OS2)
940 *** misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in Fri Mar 7 21:57:17 2003
941 --- misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in Tue Jan 15 13:34:32 2008
942 ***************
943 *** 40,46 ****
944 HDIR = $(topsrcdir)/ldap/include
946 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
947 ! DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
949 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
951 --- 40,46 ----
952 HDIR = $(topsrcdir)/ldap/include
954 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
955 ! DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
957 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
959 *** misc/mozilla/embedding/browser/gtk/src/Makefile.in Thu Apr 8 21:18:25 2004
960 --- misc/build/mozilla/embedding/browser/gtk/src/Makefile.in Tue Jan 15 13:34:32 2008
961 ***************
962 *** 111,117 ****
963 gtkmozembed_internal.h
965 ifdef MOZ_ENABLE_GTK
966 ! EXTRA_DSO_LDOPTS = \
967 $(MOZ_COMPONENT_LIBS) \
968 $(XPCOM_GLUE_LIBS) \
969 -lgtksuperwin \
970 --- 111,117 ----
971 gtkmozembed_internal.h
973 ifdef MOZ_ENABLE_GTK
974 ! EXTRA_DSO_LDOPTS += \
975 $(MOZ_COMPONENT_LIBS) \
976 $(XPCOM_GLUE_LIBS) \
977 -lgtksuperwin \
978 ***************
979 *** 119,125 ****
980 endif
982 ifdef MOZ_ENABLE_GTK2
983 ! EXTRA_DSO_LDOPTS = \
984 $(MOZ_COMPONENT_LIBS) \
985 $(NULL)
986 endif
987 --- 119,125 ----
988 endif
990 ifdef MOZ_ENABLE_GTK2
991 ! EXTRA_DSO_LDOPTS += \
992 $(MOZ_COMPONENT_LIBS) \
993 $(NULL)
994 endif
995 *** misc/mozilla/embedding/browser/gtk/tests/Makefile.in Tue Oct 7 04:43:00 2003
996 --- misc/build/mozilla/embedding/browser/gtk/tests/Makefile.in Tue Jan 15 13:34:32 2008
997 ***************
998 *** 46,54 ****
999 TestGtkEmbedNotebook.cpp \
1000 TestGtkEmbedSocket.cpp \
1001 TestGtkEmbedChild.cpp
1002 - endif
1004 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
1006 # ENABLE_GNOME=1
1008 --- 46,55 ----
1009 TestGtkEmbedNotebook.cpp \
1010 TestGtkEmbedSocket.cpp \
1011 TestGtkEmbedChild.cpp
1013 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
1015 + endif
1017 # ENABLE_GNOME=1
1019 *** misc/mozilla/embedding/config/Makefile.in Mon Jul 7 10:02:25 2003
1020 --- misc/build/mozilla/embedding/config/Makefile.in Tue Jan 15 13:34:32 2008
1021 ***************
1022 *** 85,91 ****
1023 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
1024 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
1025 ifndef MINIMO
1026 ! -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(LIB_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
1027 endif
1028 ifeq ($(OS_ARCH),WINNT)
1029 ifeq ($(WINAPP),mfcembed)
1030 --- 85,91 ----
1031 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
1032 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
1033 ifndef MINIMO
1034 ! -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(DLL_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
1035 endif
1036 ifeq ($(OS_ARCH),WINNT)
1037 ifeq ($(WINAPP),mfcembed)
1038 *** misc/mozilla/extensions/p3p/Makefile.in Thu Dec 4 19:20:16 2003
1039 --- misc/build/mozilla/extensions/p3p/Makefile.in Tue Jan 15 13:34:32 2008
1040 ***************
1041 *** 62,84 ****
1042 p3p200010.xsl: resources/content/p3p.xsl.in Makefile.in
1043 @$(RM) -f $@
1044 $(PP) -DNAMESPACE=http://www.w3.org/2000/10/18/P3Pv1 \
1045 ! -DHAS_TMPL_RETENTION\
1046 $< > $@
1048 p3p200012.xsl: resources/content/p3p.xsl.in Makefile.in
1049 @$(RM) -f $@
1050 $(PP) -DNAMESPACE=http://www.w3.org/2000/12/P3Pv1 \
1051 ! -DHAS_CALL_OURS\
1052 $< > $@
1054 p3p200109.xsl: resources/content/p3p.xsl.in Makefile.in
1055 @$(RM) -f $@
1056 $(PP) -DNAMESPACE=http://www.w3.org/2001/09/P3Pv1 \
1057 ! -DHAS_CALL_OURS\
1058 $< > $@
1060 p3p200201.xsl: resources/content/p3p.xsl.in Makefile.in
1061 @$(RM) -f $@
1062 $(PP) -DNAMESPACE=http://www.w3.org/2002/01/P3Pv1 \
1063 ! -DHAS_CALL_OURS -DHAS_PURPOSE_SRC\
1064 $< > $@
1065 --- 62,84 ----
1066 p3p200010.xsl: resources/content/p3p.xsl.in Makefile.in
1067 @$(RM) -f $@
1068 $(PP) -DNAMESPACE=http://www.w3.org/2000/10/18/P3Pv1 \
1069 ! -DHAS_TMPL_RETENTION \
1070 $< > $@
1072 p3p200012.xsl: resources/content/p3p.xsl.in Makefile.in
1073 @$(RM) -f $@
1074 $(PP) -DNAMESPACE=http://www.w3.org/2000/12/P3Pv1 \
1075 ! -DHAS_CALL_OURS \
1076 $< > $@
1078 p3p200109.xsl: resources/content/p3p.xsl.in Makefile.in
1079 @$(RM) -f $@
1080 $(PP) -DNAMESPACE=http://www.w3.org/2001/09/P3Pv1 \
1081 ! -DHAS_CALL_OURS \
1082 $< > $@
1084 p3p200201.xsl: resources/content/p3p.xsl.in Makefile.in
1085 @$(RM) -f $@
1086 $(PP) -DNAMESPACE=http://www.w3.org/2002/01/P3Pv1 \
1087 ! -DHAS_CALL_OURS -DHAS_PURPOSE_SRC \
1088 $< > $@
1089 *** misc/mozilla/extensions/pref/autoconfig/src/Makefile.in Wed Jan 7 14:36:25 2004
1090 --- misc/build/mozilla/extensions/pref/autoconfig/src/Makefile.in Tue Jan 15 13:34:32 2008
1091 ***************
1092 *** 68,74 ****
1093 endif
1096 ! EXTRA_DSO_LDOPTS = \
1097 $(LIBS_DIR) \
1098 $(MOZ_JS_LIBS) \
1099 $(MOZ_COMPONENT_LIBS) \
1100 --- 68,74 ----
1101 endif
1104 ! EXTRA_DSO_LDOPTS += \
1105 $(LIBS_DIR) \
1106 $(MOZ_JS_LIBS) \
1107 $(MOZ_COMPONENT_LIBS) \
1108 *** misc/mozilla/extensions/sql/build/Makefile.in Sun Feb 8 22:51:04 2004
1109 --- misc/build/mozilla/extensions/sql/build/Makefile.in Tue Jan 15 13:34:32 2008
1110 ***************
1111 *** 52,56 ****
1112 cd $(DIST); zip -r $(XPI_FILE) \
1113 bin/components/sql.xpt \
1114 bin/components/sqlpgsql.xpt \
1115 ! bin/components/$(LIB_PREFIX)sql$(DLL_SUFFIX) \
1116 bin/chrome/sql.jar
1117 --- 52,56 ----
1118 cd $(DIST); zip -r $(XPI_FILE) \
1119 bin/components/sql.xpt \
1120 bin/components/sqlpgsql.xpt \
1121 ! bin/components/$(DLL_PREFIX)sql$(DLL_SUFFIX) \
1122 bin/chrome/sql.jar
1123 *** misc/mozilla/gfx/idl/nsIFreeType2.idl Fri Apr 16 03:09:33 2004
1124 --- misc/build/mozilla/gfx/idl/nsIFreeType2.idl Tue Jan 15 13:34:33 2008
1125 ***************
1126 *** 76,85 ****
1127 native FT_Sfnt_Tag(FT_Sfnt_Tag);
1128 native FT_Size(FT_Size);
1130 ! [ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
1131 native FTC_Face_Requester(FTC_Face_Requester);
1132 native FTC_Font(FTC_Font);
1133 ! native FTC_Image_Cache(FTC_Image_Cache);
1134 native FTC_Manager(FTC_Manager);
1136 // #ifdef MOZ_SVG
1137 --- 76,86 ----
1138 native FT_Sfnt_Tag(FT_Sfnt_Tag);
1139 native FT_Size(FT_Size);
1141 ! [ptr] native FTC_ImageType_p(FTC_ImageType);
1142 native FTC_Face_Requester(FTC_Face_Requester);
1143 native FTC_Font(FTC_Font);
1144 ! native FTC_FaceID(FTC_FaceID);
1145 ! native FTC_ImageCache(FTC_ImageCache);
1146 native FTC_Manager(FTC_Manager);
1148 // #ifdef MOZ_SVG
1149 ***************
1150 *** 99,105 ****
1152 readonly attribute FT_Library library;
1153 readonly attribute FTC_Manager FTCacheManager;
1154 ! readonly attribute FTC_Image_Cache ImageCache;
1156 void doneFace(in FT_Face face);
1157 void doneFreeType(in FT_Library lib);
1158 --- 100,106 ----
1160 readonly attribute FT_Library library;
1161 readonly attribute FTC_Manager FTCacheManager;
1162 ! readonly attribute FTC_ImageCache ImageCache;
1164 void doneFace(in FT_Face face);
1165 void doneFreeType(in FT_Library lib);
1166 ***************
1167 *** 115,130 ****
1168 void outlineDecompose(in FT_Outline_p outline,
1169 in const_FT_Outline_Funcs_p funcs, in voidPtr p);
1170 void setCharmap(in FT_Face face, in FT_CharMap charmap);
1171 ! void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
1172 in FT_UInt gindex, out FT_Glyph glyph);
1173 ! void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
1174 ! out FT_Face face, out FT_Size size);
1175 void managerDone(in FTC_Manager manager);
1176 void managerNew(in FT_Library lib, in FT_UInt max_faces,
1177 in FT_UInt max_sizes, in FT_ULong max_bytes,
1178 in FTC_Face_Requester requester, in FT_Pointer req_data,
1179 out FTC_Manager manager);
1180 ! void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
1181 /* #ifdef MOZ_SVG */
1182 void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
1183 in FT_Vector_p delta);
1184 --- 116,131 ----
1185 void outlineDecompose(in FT_Outline_p outline,
1186 in const_FT_Outline_Funcs_p funcs, in voidPtr p);
1187 void setCharmap(in FT_Face face, in FT_CharMap charmap);
1188 ! void imageCacheLookup(in FTC_ImageCache cache, in FTC_ImageType_p desc,
1189 in FT_UInt gindex, out FT_Glyph glyph);
1190 ! void managerLookupFace(in FTC_Manager manager, in FTC_FaceID face_id,
1191 ! out FT_Face face);
1192 void managerDone(in FTC_Manager manager);
1193 void managerNew(in FT_Library lib, in FT_UInt max_faces,
1194 in FT_UInt max_sizes, in FT_ULong max_bytes,
1195 in FTC_Face_Requester requester, in FT_Pointer req_data,
1196 out FTC_Manager manager);
1197 ! void imageCacheNew(in FTC_Manager manager, out FTC_ImageCache cache);
1198 /* #ifdef MOZ_SVG */
1199 void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
1200 in FT_Vector_p delta);
1201 *** misc/mozilla/gfx/src/freetype/nsFreeType.cpp Sat Feb 7 16:22:30 2004
1202 --- misc/build/mozilla/gfx/src/freetype/nsFreeType.cpp Tue Jan 15 13:34:33 2008
1203 ***************
1204 *** 111,117 ****
1205 {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
1206 {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
1207 {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
1208 ! {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
1209 {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
1210 {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
1211 {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
1212 --- 111,117 ----
1213 {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
1214 {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
1215 {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
1216 ! {"FTC_Manager_LookupFace", NS_FT2_OFFSET(nsFTC_Manager_LookupFace), PR_TRUE},
1217 {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
1218 {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
1219 {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
1220 ***************
1221 *** 282,288 ****
1224 NS_IMETHODIMP
1225 ! nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
1226 FT_UInt glyphID, FT_Glyph *glyph)
1228 // call the FreeType2 function via the function pointer
1229 --- 282,288 ----
1232 NS_IMETHODIMP
1233 ! nsFreeType2::ImageCacheLookup(FTC_ImageCache cache, FTC_ImageType *desc,
1234 FT_UInt glyphID, FT_Glyph *glyph)
1236 // call the FreeType2 function via the function pointer
1237 ***************
1238 *** 291,301 ****
1241 NS_IMETHODIMP
1242 ! nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
1243 ! FT_Face *face, FT_Size *size)
1245 // call the FreeType2 function via the function pointer
1246 ! FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
1247 return error ? NS_ERROR_FAILURE : NS_OK;
1250 --- 291,301 ----
1253 NS_IMETHODIMP
1254 ! nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID font,
1255 ! FT_Face *face)
1257 // call the FreeType2 function via the function pointer
1258 ! FT_Error error = nsFTC_Manager_LookupFace(manager, font, face);
1259 return error ? NS_ERROR_FAILURE : NS_OK;
1262 ***************
1263 *** 320,326 ****
1266 NS_IMETHODIMP
1267 ! nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
1269 // call the FreeType2 function via the function pointer
1270 FT_Error error = nsFTC_Image_Cache_New(manager, cache);
1271 --- 320,326 ----
1274 NS_IMETHODIMP
1275 ! nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_ImageCache *cache)
1277 // call the FreeType2 function via the function pointer
1278 FT_Error error = nsFTC_Image_Cache_New(manager, cache);
1279 ***************
1280 *** 389,395 ****
1283 NS_IMETHODIMP
1284 ! nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
1286 *aCache = mImageCache;
1287 return NS_OK;
1288 --- 389,395 ----
1291 NS_IMETHODIMP
1292 ! nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
1294 *aCache = mImageCache;
1295 return NS_OK;
1296 *** misc/mozilla/gfx/src/freetype/nsFreeType.h Fri Apr 16 23:31:42 2004
1297 --- misc/build/mozilla/gfx/src/freetype/nsFreeType.h Tue Jan 15 13:34:33 2008
1298 ***************
1299 *** 104,116 ****
1300 typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
1301 typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
1302 typedef FT_Error (*FTC_Image_Cache_Lookup_t)
1303 ! (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
1304 ! typedef FT_Error (*FTC_Manager_Lookup_Size_t)
1305 ! (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
1306 typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
1307 typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
1308 FTC_Face_Requester, FT_Pointer, FTC_Manager*);
1309 ! typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
1310 // #ifdef MOZ_SVG
1311 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
1312 typedef FT_Error (*FT_Get_Kerning_t)
1313 --- 104,116 ----
1314 typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
1315 typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
1316 typedef FT_Error (*FTC_Image_Cache_Lookup_t)
1317 ! (FTC_ImageCache, FTC_ImageType*, FT_UInt, FT_Glyph*);
1318 ! typedef FT_Error (*FTC_Manager_LookupFace_t)
1319 ! (FTC_Manager, FTC_FaceID, FT_Face*);
1320 typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
1321 typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
1322 FTC_Face_Requester, FT_Pointer, FTC_Manager*);
1323 ! typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_ImageCache*);
1324 // #ifdef MOZ_SVG
1325 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
1326 typedef FT_Error (*FT_Get_Kerning_t)
1327 ***************
1328 *** 165,171 ****
1329 FT_Outline_Decompose_t nsFT_Outline_Decompose;
1330 FT_Set_Charmap_t nsFT_Set_Charmap;
1331 FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
1332 ! FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
1333 FTC_Manager_Done_t nsFTC_Manager_Done;
1334 FTC_Manager_New_t nsFTC_Manager_New;
1335 FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
1336 --- 165,171 ----
1337 FT_Outline_Decompose_t nsFT_Outline_Decompose;
1338 FT_Set_Charmap_t nsFT_Set_Charmap;
1339 FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
1340 ! FTC_Manager_LookupFace_t nsFTC_Manager_LookupFace;
1341 FTC_Manager_Done_t nsFTC_Manager_Done;
1342 FTC_Manager_New_t nsFTC_Manager_New;
1343 FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
1344 ***************
1345 *** 213,219 ****
1346 PRLibrary *mSharedLib;
1347 FT_Library mFreeTypeLibrary;
1348 FTC_Manager mFTCacheManager;
1349 ! FTC_Image_Cache mImageCache;
1351 static nsHashtable *sFontFamilies;
1352 static nsHashtable *sRange1CharSetNames;
1353 --- 213,219 ----
1354 PRLibrary *mSharedLib;
1355 FT_Library mFreeTypeLibrary;
1356 FTC_Manager mFTCacheManager;
1357 ! FTC_ImageCache mImageCache;
1359 static nsHashtable *sFontFamilies;
1360 static nsHashtable *sRange1CharSetNames;
1361 *** misc/mozilla/gfx/src/gtk/Makefile.in Mon Nov 10 13:24:51 2003
1362 --- misc/build/mozilla/gfx/src/gtk/Makefile.in Tue Jan 15 13:34:33 2008
1363 ***************
1364 *** 176,181 ****
1365 --- 176,185 ----
1366 CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
1367 CFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
1369 + ifeq ($(OS_ARCH), Darwin)
1370 + EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
1371 + endif
1373 ifeq ($(OS_ARCH), SunOS)
1374 ifndef GNU_CC
1375 # When using Sun's WorkShop compiler, including
1376 *** misc/mozilla/gfx/src/ps/nsFontMetricsPS.cpp Thu Feb 5 02:57:05 2004
1377 --- misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.cpp Tue Jan 15 13:34:33 2008
1378 ***************
1379 *** 1141,1150 ****
1381 mPixelSize = NSToIntRound(app2dev * mFont->size);
1383 ! mImageDesc.font.face_id = (void*)mEntry;
1384 ! mImageDesc.font.pix_width = mPixelSize;
1385 ! mImageDesc.font.pix_height = mPixelSize;
1386 ! mImageDesc.image_type = 0;
1388 nsresult rv;
1389 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
1390 --- 1141,1150 ----
1392 mPixelSize = NSToIntRound(app2dev * mFont->size);
1394 ! mImageDesc->face_id = (FTC_FaceID)&mEntry;
1395 ! mImageDesc->width = mPixelSize;
1396 ! mImageDesc->height = mPixelSize;
1397 ! mImageDesc->flags = 0;
1399 nsresult rv;
1400 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
1401 ***************
1402 *** 1190,1196 ****
1403 if (!face)
1404 return 0;
1406 ! FTC_Image_Cache iCache;
1407 nsresult rv = mFt2->GetImageCache(&iCache);
1408 if (NS_FAILED(rv)) {
1409 NS_ERROR("Failed to get Image Cache");
1410 --- 1190,1196 ----
1411 if (!face)
1412 return 0;
1414 ! FTC_ImageCache iCache;
1415 nsresult rv = mFt2->GetImageCache(&iCache);
1416 if (NS_FAILED(rv)) {
1417 NS_ERROR("Failed to get Image Cache");
1418 ***************
1419 *** 1228,1235 ****
1421 FTC_Manager cManager;
1422 mFt2->GetFTCacheManager(&cManager);
1423 ! nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
1424 ! &face, nsnull);
1425 NS_ASSERTION(rv==0, "failed to get face/size");
1426 if (rv)
1427 return nsnull;
1428 --- 1228,1235 ----
1430 FTC_Manager cManager;
1431 mFt2->GetFTCacheManager(&cManager);
1432 ! nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
1433 ! &face);
1434 NS_ASSERTION(rv==0, "failed to get face/size");
1435 if (rv)
1436 return nsnull;
1437 ***************
1438 *** 1622,1637 ****
1439 mEntry->GetFamilyName(fontName);
1440 mEntry->GetStyleName(styleName);
1442 ! mImageDesc.font.face_id = (void*)mEntry;
1443 // TT glyph has no relation to size
1444 ! mImageDesc.font.pix_width = 16;
1445 ! mImageDesc.font.pix_height = 16;
1446 ! mImageDesc.image_type = 0;
1447 FT_Face face = nsnull;
1448 FTC_Manager cManager;
1449 mFt2->GetFTCacheManager(&cManager);
1450 ! nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
1451 ! &face, nsnull);
1452 if (NS_FAILED(rv))
1453 return;
1455 --- 1622,1637 ----
1456 mEntry->GetFamilyName(fontName);
1457 mEntry->GetStyleName(styleName);
1459 ! mImageDesc->face_id = (FTC_FaceID)&mEntry;
1460 // TT glyph has no relation to size
1461 ! mImageDesc->width = 16;
1462 ! mImageDesc->height = 16;
1463 ! mImageDesc->flags = 0;
1464 FT_Face face = nsnull;
1465 FTC_Manager cManager;
1466 mFt2->GetFTCacheManager(&cManager);
1467 ! nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
1468 ! &face);
1469 if (NS_FAILED(rv))
1470 return;
1472 *** misc/mozilla/gfx/src/ps/nsFontMetricsPS.h Tue Apr 22 18:25:09 2003
1473 --- misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.h Tue Jan 15 13:34:33 2008
1474 ***************
1475 *** 320,326 ****
1476 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
1477 nsCOMPtr<nsIFreeType2> mFt2;
1478 PRUint16 mPixelSize;
1479 ! FTC_Image_Desc mImageDesc;
1482 static PRBool AddUserPref(nsIAtom *aLang, const nsFont& aFont,
1483 --- 320,326 ----
1484 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
1485 nsCOMPtr<nsIFreeType2> mFt2;
1486 PRUint16 mPixelSize;
1487 ! FTC_ImageType mImageDesc;
1490 static PRBool AddUserPref(nsIAtom *aLang, const nsFont& aFont,
1491 ***************
1492 *** 363,369 ****
1493 protected:
1494 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1495 nsCOMPtr<nsIFreeType2> mFt2;
1496 ! FTC_Image_Desc mImageDesc;
1498 #endif
1500 --- 363,369 ----
1501 protected:
1502 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1503 nsCOMPtr<nsIFreeType2> mFt2;
1504 ! FTC_ImageType mImageDesc;
1506 #endif
1508 *** misc/mozilla/gfx/src/windows/nsDeviceContextWin.cpp Tue Jun 8 00:17:11 2004
1509 --- misc/build/mozilla/gfx/src/windows/nsDeviceContextWin.cpp Tue Jan 15 13:34:33 2008
1510 ***************
1511 *** 378,384 ****
1512 --- 378,388 ----
1513 memcpy(name, ptrLogFont->lfFaceName, LF_FACESIZE*2);
1514 else {
1515 MultiByteToWideChar(CP_ACP, 0, ptrLogFont->lfFaceName,
1516 + #ifdef __MINGW32__
1517 + strlen(ptrLogFont->lfFaceName) + 1, NS_REINTERPRET_CAST(LPWSTR, name), sizeof(name)/sizeof(name[0]));
1518 + #else
1519 strlen(ptrLogFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
1520 + #endif
1522 aFont->name = name;
1524 ***************
1525 *** 601,607 ****
1526 --- 605,615 ----
1527 LOGFONT logFont;
1528 logFont.lfCharSet = DEFAULT_CHARSET;
1529 logFont.lfPitchAndFamily = 0;
1530 + #ifdef __MINGW32__
1531 + int outlen = WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aFontName.get()), aFontName.Length() + 1,
1532 + #else
1533 int outlen = WideCharToMultiByte(CP_ACP, 0, aFontName.get(), aFontName.Length() + 1,
1534 + #endif
1535 logFont.lfFaceName, sizeof(logFont.lfFaceName), nsnull, nsnull);
1537 // somehow the WideCharToMultiByte failed, let's try the old code
1538 ***************
1539 *** 928,934 ****
1540 --- 936,946 ----
1541 if(acp)
1543 int outlen = ::WideCharToMultiByte( CP_ACP, 0,
1544 + #ifdef __MINGW32__
1545 + NS_REINTERPRET_CAST(LPCWSTR, PromiseFlatString(aStr).get()), aStr.Length(),
1546 + #else
1547 PromiseFlatString(aStr).get(), aStr.Length(),
1548 + #endif
1549 acp, acplen, NULL, NULL);
1550 if ( outlen > 0)
1551 acp[outlen] = '\0'; // null terminate
1552 *** misc/mozilla/gfx/src/windows/nsFontMetricsWin.cpp Sat Oct 16 06:14:42 2004
1553 --- misc/build/mozilla/gfx/src/windows/nsFontMetricsWin.cpp Tue Jan 15 13:34:33 2008
1554 ***************
1555 *** 1259,1265 ****
1556 --- 1259,1269 ----
1557 PRUnichar fname[LF_FACESIZE];
1558 fname[0] = 0;
1559 MultiByteToWideChar(CP_ACP, 0, aFontName,
1560 + #ifdef __MINGW32__
1561 + strlen(aFontName) + 1, NS_REINTERPRET_CAST(LPWSTR, fname), sizeof(fname)/sizeof(fname[0]));
1562 + #else
1563 strlen(aFontName) + 1, fname, sizeof(fname)/sizeof(fname[0]));
1564 + #endif
1565 name.Assign(NS_LITERAL_CSTRING("encoding.") + NS_ConvertUCS2toUTF8(fname) + NS_LITERAL_CSTRING(".ttf"));
1568 ***************
1569 *** 2121,2127 ****
1570 --- 2125,2135 ----
1572 // get the final rightBearing and width. Possible kerning is taken into account.
1573 SIZE size;
1574 + #ifdef __MIGW32__
1575 + ::GetTextExtentPointW(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1576 + #else
1577 ::GetTextExtentPointW(aDC, aString, aLength, &size);
1578 + #endif
1579 size.cx -= aOverhangCorrection;
1580 aBoundingMetrics.width = size.cx;
1581 aBoundingMetrics.rightBearing = size.cx - gm.gmCellIncX + gm.gmptGlyphOrigin.x + gm.gmBlackBoxX;
1582 ***************
1583 *** 2352,2358 ****
1584 --- 2360,2370 ----
1585 * but we don't really have a choice since CreateFontIndirectW is
1586 * not supported on Windows 9X (see below) -- erik
1588 + #ifdef __MINGW32__
1589 + WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aName.get()), aName.Length() + 1,
1590 + #else
1591 WideCharToMultiByte(CP_ACP, 0, aName.get(), aName.Length() + 1,
1592 + #endif
1593 aLogFont->lfFaceName, sizeof(aLogFont->lfFaceName), nsnull, nsnull);
1595 if (mFont.sizeAdjust <= 0) {
1596 ***************
1597 *** 2502,2508 ****
1598 --- 2514,2524 ----
1599 PRUnichar name[LF_FACESIZE];
1600 name[0] = 0;
1601 MultiByteToWideChar(CP_ACP, 0, logFont->lfFaceName,
1602 + #ifdef __MINGW32__
1603 + strlen(logFont->lfFaceName) + 1, NS_REINTERPRET_CAST(LPWSTR, name), sizeof(name)/sizeof(name[0]));
1604 + #else
1605 strlen(logFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
1606 + #endif
1608 nsGlobalFont* font = new nsGlobalFont;
1609 if (!font) {
1610 ***************
1611 *** 2943,2949 ****
1612 --- 2959,2969 ----
1613 // Look for all of the weights for a given font.
1614 LOGFONT logFont;
1615 logFont.lfCharSet = DEFAULT_CHARSET;
1616 + #ifdef __MINGW32__
1617 + WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aFontName.get()), aFontName.Length() + 1,
1618 + #else
1619 WideCharToMultiByte(CP_ACP, 0, aFontName.get(), aFontName.Length() + 1,
1620 + #endif
1621 logFont.lfFaceName, sizeof(logFont.lfFaceName), nsnull, nsnull);
1622 logFont.lfPitchAndFamily = 0;
1624 ***************
1625 *** 4098,4111 ****
1626 --- 4118,4139 ----
1628 static PRBool
1629 NS_ExtTextOutW(HDC aDC, nsFontWin* aFont, PRInt32 aX, PRInt32 aY, UINT uOptions,
1630 + #ifdef __MINGW32__
1631 + LPCRECT lprc, const PRUnichar* aString, UINT aLength, INT *lpDx)
1632 + #else
1633 LPCRECT lprc, LPCWSTR aString, UINT aLength, INT *lpDx)
1634 + #endif
1636 RECT clipRect;
1637 if (!lpDx && !lprc && aFont->FillClipRect(aX, aY, aLength, uOptions, clipRect)) {
1638 lprc = &clipRect;
1639 uOptions |= ETO_CLIPPED;
1641 + #ifdef __MINGW32__
1642 + return ::ExtTextOutW(aDC, aX, aY, uOptions, lprc, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, lpDx);
1643 + #else
1644 return ::ExtTextOutW(aDC, aX, aY, uOptions, lprc, aString, aLength, lpDx);
1645 + #endif
1648 void
1649 ***************
1650 *** 4150,4156 ****
1651 --- 4178,4188 ----
1652 CheckLength(&aLength);
1654 SIZE size;
1655 + #ifdef __MINGW32__
1656 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1657 + #else
1658 ::GetTextExtentPoint32W(aDC, aString, aLength, &size);
1659 + #endif
1660 size.cx -= mOverhangCorrection;
1661 return size.cx;
1663 ***************
1664 *** 4177,4183 ****
1665 --- 4209,4219 ----
1666 // Clip out the extra underline/strikethru caused by the
1667 // bug in WIN95.
1668 SIZE size;
1669 + #ifdef __MINGW32__
1670 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1671 + #else
1672 ::GetTextExtentPoint32W(aDC, aString, aLength, &size);
1673 + #endif
1674 size.cx -= mOverhangCorrection;
1675 RECT clipRect;
1676 clipRect.top = aY - size.cy;
1677 ***************
1678 *** 4260,4266 ****
1679 --- 4296,4306 ----
1680 if (!mIsWide)
1681 ::GetTextExtentPoint32A(aDC, buffer.get(), destLength, &size);
1682 else
1683 + #ifdef __MINGW32__
1684 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, buffer.get()), destLength / 2, &size);
1685 + #else
1686 ::GetTextExtentPoint32W(aDC, (const PRUnichar*) buffer.get(), destLength / 2, &size);
1687 + #endif
1688 size.cx -= mOverhangCorrection;
1690 return size.cx;
1691 ***************
1692 *** 4435,4441 ****
1693 --- 4475,4485 ----
1694 if (NS_FAILED(rv) || !aLength) return 0;
1696 SIZE size;
1697 + #ifdef __MINGW32__
1698 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, buffer.get()), aLength, &size);
1699 + #else
1700 ::GetTextExtentPoint32W(aDC, buffer.get(), aLength, &size);
1701 + #endif
1702 size.cx -= mOverhangCorrection;
1704 return size.cx;
1705 ***************
1706 *** 4640,4652 ****
1707 --- 4684,4704 ----
1709 *aResultLength = 0;
1710 // Get the number of bytes needed for the conversion
1711 + #ifdef __MINGW32__
1712 + int nb = WideCharToMultiByte(mCodePage, 0, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength,
1713 + #else
1714 int nb = WideCharToMultiByte(mCodePage, 0, aString, aLength,
1715 + #endif
1716 nsnull, 0, nsnull, nsnull);
1718 if (!nb || !aResult.EnsureElemCapacity(nb)) return;
1719 char* buf = aResult.get();
1720 // Convert the Unicode string to ANSI
1721 + #ifdef __MINGW32__
1722 + *aResultLength = WideCharToMultiByte(mCodePage, 0, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength,
1723 + #else
1724 *aResultLength = WideCharToMultiByte(mCodePage, 0, aString, aLength,
1725 + #endif
1726 buf, nb, nsnull, nsnull);
1729 *** misc/mozilla/gfx/src/windows/nsRenderingContextWin.cpp Thu Feb 5 02:57:06 2004
1730 --- misc/build/mozilla/gfx/src/windows/nsRenderingContextWin.cpp Tue Jan 15 13:34:33 2008
1731 ***************
1732 *** 2939,2955 ****
1733 --- 2939,2967 ----
1735 GCP_RESULTSW gcpResult;
1736 gcpResult.lStructSize = sizeof(GCP_RESULTS);
1737 + #ifdef __MINGW32__
1738 + gcpResult.lpOutString = NS_REINTERPRET_CAST(LPWSTR, outStr); // Output string
1739 + #else
1740 gcpResult.lpOutString = outStr; // Output string
1741 + #endif
1742 gcpResult.lpOrder = nsnull; // Ordering indices
1743 gcpResult.lpDx = distanceArray; // Distances between character cells
1744 gcpResult.lpCaretPos = nsnull; // Caret positions
1745 gcpResult.lpClass = nsnull; // Character classifications
1746 + #ifdef __MINGW32__
1747 + gcpResult.lpGlyphs = NS_REINTERPRET_CAST(LPWSTR, glyphArray); // Character glyphs
1748 + #else
1749 gcpResult.lpGlyphs = glyphArray; // Character glyphs
1750 + #endif
1751 gcpResult.nGlyphs = 2; // Array size
1753 PRUnichar inStr[] = {araAin, one};
1755 + #ifdef __MINGW32__
1756 + if (::GetCharacterPlacementW(mDC, NS_REINTERPRET_CAST(LPCWSTR, inStr), 2, 0, &gcpResult, GCP_REORDER)
1757 + #else
1758 if (::GetCharacterPlacementW(mDC, inStr, 2, 0, &gcpResult, GCP_REORDER)
1759 + #endif
1760 && (inStr[0] == outStr[1]) ) {
1761 gBidiInfo = GCP_REORDER | GCP_GLYPHSHAPE;
1762 #ifdef NS_DEBUG
1763 ***************
1764 *** 2960,2966 ****
1765 --- 2972,2982 ----
1766 const PRUnichar hebAlef = 0x05D0;
1767 inStr[0] = hebAlef;
1768 inStr[1] = one;
1769 + #ifdef __MINGW32__
1770 + if (::GetCharacterPlacementW(mDC, NS_REINTERPRET_CAST(LPCWSTR, inStr), 2, 0, &gcpResult, GCP_REORDER)
1771 + #else
1772 if (::GetCharacterPlacementW(mDC, inStr, 2, 0, &gcpResult, GCP_REORDER)
1773 + #endif
1774 && (inStr[0] == outStr[1]) ) {
1775 gBidiInfo = GCP_REORDER;
1776 #ifdef NS_DEBUG
1777 *** misc/mozilla/gfx/src/x11shared/nsFontFreeType.cpp Thu Dec 25 09:24:52 2003
1778 --- misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.cpp Tue Jan 15 13:34:33 2008
1779 ***************
1780 *** 177,183 ****
1781 FTC_Manager mgr;
1782 nsresult rv;
1783 mFt2->GetFTCacheManager(&mgr);
1784 ! rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
1785 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1786 if (NS_FAILED(rv))
1787 return nsnull;
1788 --- 177,183 ----
1789 FTC_Manager mgr;
1790 nsresult rv;
1791 mFt2->GetFTCacheManager(&mgr);
1792 ! rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
1793 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1794 if (NS_FAILED(rv))
1795 return nsnull;
1796 ***************
1797 *** 191,212 ****
1798 PRBool embedded_bimap = PR_FALSE;
1799 mFaceID = aFaceID;
1800 mPixelSize = aPixelSize;
1801 ! mImageDesc.font.face_id = (void*)mFaceID;
1802 ! mImageDesc.font.pix_width = aPixelSize;
1803 ! mImageDesc.font.pix_height = aPixelSize;
1804 ! mImageDesc.image_type = 0;
1806 if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
1807 - mImageDesc.image_type |= ftc_image_mono;
1808 anti_alias = PR_FALSE;
1811 - if (nsFreeType2::gFreeType2Autohinted)
1812 - mImageDesc.image_type |= ftc_image_flag_autohinted;
1814 - if (nsFreeType2::gFreeType2Unhinted)
1815 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1817 PRUint32 num_embedded_bitmaps, i;
1818 PRInt32* embedded_bitmapheights;
1819 mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
1820 --- 191,205 ----
1821 PRBool embedded_bimap = PR_FALSE;
1822 mFaceID = aFaceID;
1823 mPixelSize = aPixelSize;
1824 ! mImageDesc->face_id = (FTC_FaceID)&mFaceID;
1825 ! mImageDesc->width = aPixelSize;
1826 ! mImageDesc->height = aPixelSize;
1827 ! mImageDesc->flags = 0;
1829 if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
1830 anti_alias = PR_FALSE;
1833 PRUint32 num_embedded_bitmaps, i;
1834 PRInt32* embedded_bitmapheights;
1835 mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
1836 ***************
1837 *** 218,224 ****
1838 if (embedded_bitmapheights[i] == aPixelSize) {
1839 embedded_bimap = PR_TRUE;
1840 // unhinted must be set for embedded bitmaps to be used
1841 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1842 break;
1845 --- 211,216 ----
1846 ***************
1847 *** 312,318 ****
1848 if (!face)
1849 return NS_ERROR_FAILURE;
1851 ! FTC_Image_Cache icache;
1852 mFt2->GetImageCache(&icache);
1853 if (!icache)
1854 return NS_ERROR_FAILURE;
1855 --- 304,310 ----
1856 if (!face)
1857 return NS_ERROR_FAILURE;
1859 ! FTC_ImageCache icache;
1860 mFt2->GetImageCache(&icache);
1861 if (!icache)
1862 return NS_ERROR_FAILURE;
1863 ***************
1864 *** 401,407 ****
1865 if (!face)
1866 return 0;
1868 ! FTC_Image_Cache icache;
1869 mFt2->GetImageCache(&icache);
1870 if (!icache)
1871 return 0;
1872 --- 393,399 ----
1873 if (!face)
1874 return 0;
1876 ! FTC_ImageCache icache;
1877 mFt2->GetImageCache(&icache);
1878 if (!icache)
1879 return 0;
1880 ***************
1881 *** 723,729 ****
1882 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1883 #endif
1885 ! FTC_Image_Cache icache;
1886 mFt2->GetImageCache(&icache);
1887 if (!icache)
1888 return 0;
1889 --- 715,721 ----
1890 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1891 #endif
1893 ! FTC_ImageCache icache;
1894 mFt2->GetImageCache(&icache);
1895 if (!icache)
1896 return 0;
1897 *** misc/mozilla/gfx/src/x11shared/nsFontFreeType.h Tue Apr 22 18:25:13 2003
1898 --- misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.h Tue Jan 15 13:34:33 2008
1899 ***************
1900 *** 110,116 ****
1901 XImage *GetXImage(PRUint32 width, PRUint32 height);
1902 nsITrueTypeFontCatalogEntry *mFaceID;
1903 PRUint16 mPixelSize;
1904 ! FTC_Image_Desc mImageDesc;
1905 nsCOMPtr<nsIFreeType2> mFt2;
1908 --- 110,116 ----
1909 XImage *GetXImage(PRUint32 width, PRUint32 height);
1910 nsITrueTypeFontCatalogEntry *mFaceID;
1911 PRUint16 mPixelSize;
1912 ! FTC_ImageType mImageDesc;
1913 nsCOMPtr<nsIFreeType2> mFt2;
1916 *** misc/mozilla/jpeg/jmorecfg.h Fri Mar 26 02:17:16 2004
1917 --- misc/build/mozilla/jpeg/jmorecfg.h Tue Jan 15 13:34:33 2008
1918 ***************
1919 *** 108,115 ****
1920 /* Defines for MMX/SSE2 support. */
1922 #if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
1923 ! #define HAVE_MMX_INTEL_MNEMONICS
1924 ! #define HAVE_SSE2_INTEL_MNEMONICS
1925 #endif
1927 /* Compressed datastreams are represented as arrays of JOCTET.
1928 --- 108,115 ----
1929 /* Defines for MMX/SSE2 support. */
1931 #if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
1932 ! //#define HAVE_MMX_INTEL_MNEMONICS
1933 ! //#define HAVE_SSE2_INTEL_MNEMONICS
1934 #endif
1936 /* Compressed datastreams are represented as arrays of JOCTET.
1937 *** misc/mozilla/js/src/xpconnect/src/Makefile.in Wed Jan 7 14:36:33 2004
1938 --- misc/build/mozilla/js/src/xpconnect/src/Makefile.in Tue Jan 15 13:34:33 2008
1939 ***************
1940 *** 148,151 ****
1941 .NOTPARALLEL::
1942 endif
1943 endif
1945 --- 148,150 ----
1946 *** misc/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp Fri Mar 19 02:36:16 2004
1947 --- misc/build/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp Tue Jan 15 13:34:33 2008
1948 ***************
1949 *** 440,458 ****
1950 return;
1953 ! FTC_Image_Desc imageDesc;
1954 ! imageDesc.font.face_id=(void*)font_data.font_entry.get(); // XXX do we need to addref?
1955 float twipstopixel = GetTwipsToPixels();
1956 float scale = GetPixelScale();
1957 ! imageDesc.font.pix_width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1958 ! imageDesc.font.pix_height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1959 ! imageDesc.image_type |= ftc_image_grays;
1961 // get the face
1962 nsresult rv;
1963 FTC_Manager mgr;
1964 nsSVGLibartFreetype::ft2->GetFTCacheManager(&mgr);
1965 ! rv = nsSVGLibartFreetype::ft2->ManagerLookupSize(mgr, &imageDesc.font, &mFace, nsnull);
1966 NS_ASSERTION(mFace, "failed to get face/size");
1969 --- 440,458 ----
1970 return;
1973 ! FTC_ImageType imageDesc;
1974 ! imageDesc->face_id=(FTC_FaceID)font_data.font_entry.get(); // XXX do we need to addref?
1975 float twipstopixel = GetTwipsToPixels();
1976 float scale = GetPixelScale();
1977 ! imageDesc->width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1978 ! imageDesc->height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1979 ! imageDesc->flags |= /* ftc_image_grays */0;
1981 // get the face
1982 nsresult rv;
1983 FTC_Manager mgr;
1984 nsSVGLibartFreetype::ft2->GetFTCacheManager(&mgr);
1985 ! rv = nsSVGLibartFreetype::ft2->ManagerLookupFace(mgr, imageDesc->face_id, &mFace);
1986 NS_ASSERTION(mFace, "failed to get face/size");
1989 *** misc/mozilla/mailnews/addrbook/src/Makefile.in Mon Oct 6 19:48:56 2003
1990 --- misc/build/mozilla/mailnews/addrbook/src/Makefile.in Tue Jan 15 13:34:33 2008
1991 ***************
1992 *** 86,91 ****
1993 --- 86,92 ----
1994 nsVCard.cpp \
1995 nsVCardObj.cpp \
1996 nsMsgVCardService.cpp \
1997 + nsAbMD5sum.cpp \
1998 $(NULL)
2000 EXPORTS = \
2001 *** misc/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp Fri Oct 11 10:17:13 2002
2002 --- misc/build/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp Tue Jan 15 13:34:33 2008
2003 ***************
2004 *** 39,44 ****
2005 --- 39,45 ----
2006 #include "nsAbBoolExprToLDAPFilter.h"
2007 #include "nsAbLDAPProperties.h"
2008 #include "nsXPIDLString.h"
2009 + #include "nsAbUtils.h"
2011 const int nsAbBoolExprToLDAPFilter::TRANSLATE_CARD_PROPERTY = 1 << 0 ;
2012 const int nsAbBoolExprToLDAPFilter::ALLOW_NON_CONVERTABLE_CARD_PROPERTY = 1 << 1 ;
2013 ***************
2014 *** 186,198 ****
2015 rv = condition->GetName (getter_Copies (name));
2016 NS_ENSURE_SUCCESS(rv, rv);
2018 ! const char* ldapProperty = name.get ();
2019 if (flags & TRANSLATE_CARD_PROPERTY)
2021 ! const MozillaLdapPropertyRelation* p =
2022 ! MozillaLdapPropertyRelator::findLdapPropertyFromMozilla (name.get ());
2023 ! if (p)
2024 ! ldapProperty = p->ldapProperty;
2025 else if (!(flags & ALLOW_NON_CONVERTABLE_CARD_PROPERTY))
2026 return NS_OK;
2028 --- 187,202 ----
2029 rv = condition->GetName (getter_Copies (name));
2030 NS_ENSURE_SUCCESS(rv, rv);
2032 ! CharPtrArrayGuard attrs;
2033 if (flags & TRANSLATE_CARD_PROPERTY)
2035 ! if(const MozillaLdapPropertyRelation* property =
2036 ! MozillaLdapPropertyRelator::findLdapPropertyFromMozilla (name.get ()))
2038 ! // allow even single ldap attribute mapppings to go through this to simplify the filter creation later.
2039 ! rv = MozillaLdapPropertyRelator::getAllLDAPAttrsFromMozilla (property->ldapProperty, attrs.GetSizeAddr(), attrs.GetArrayAddr() );
2040 ! NS_ENSURE_SUCCESS(rv, rv);
2042 else if (!(flags & ALLOW_NON_CONVERTABLE_CARD_PROPERTY))
2043 return NS_OK;
2045 ***************
2046 *** 202,207 ****
2047 --- 206,242 ----
2048 NS_ENSURE_SUCCESS(rv, rv);
2049 NS_ConvertUCS2toUTF8 vUTF8 (value);
2051 + // check if using multiple ldap attributes
2052 + if(attrs.GetSize() == 1 )
2053 + GenerateSingleFilter(conditionType,filter,vUTF8,attrs.GetArray()[0]);
2054 + else
2056 + // add the opening brace if using multiple ldap attributes
2057 + switch (conditionType)
2059 + // 'NOT' conditionals use the 'AND' operator
2060 + case nsIAbBooleanConditionTypes::DoesNotExist:
2061 + case nsIAbBooleanConditionTypes::DoesNotContain:
2062 + case nsIAbBooleanConditionTypes::IsNot:
2063 + filter += NS_LITERAL_CSTRING("(&");
2064 + break;
2065 + default:
2066 + filter += NS_LITERAL_CSTRING("(|");
2067 + break;
2069 + GenerateMultipleFilter(conditionType,filter,vUTF8,&attrs);
2070 + // add the closing brace if using multiple ldap attributes
2071 + filter += NS_LITERAL_CSTRING(")");
2074 + return rv;
2076 + void nsAbBoolExprToLDAPFilter:: GenerateSingleFilter(
2077 + nsAbBooleanConditionType conditionType,
2078 + nsCString& filter,
2079 + NS_ConvertUCS2toUTF8 &vUTF8,
2080 + const char *ldapProperty)
2082 switch (conditionType)
2084 case nsIAbBooleanConditionTypes::DoesNotExist:
2085 ***************
2086 *** 282,288 ****
2087 default:
2088 break;
2091 - return rv;
2094 --- 317,363 ----
2095 default:
2096 break;
2099 + void nsAbBoolExprToLDAPFilter:: GenerateMultipleFilter(
2100 + nsAbBooleanConditionType conditionType,
2101 + nsCString& filter,
2102 + NS_ConvertUCS2toUTF8 &vUTF8,
2103 + CharPtrArrayGuard *pAttrs)
2105 + PRUint16 i = 0;
2106 + PRUint16 inner = 0;
2108 + /*
2109 + * This function is based on the fact that we are trying to generate support
2110 + * for multiple occurring ldap attributes. Consider the following query:
2111 + * (PagerNumber,=,123456) where PagerNumber = pager|pagerphone translates to:
2112 + * (|(&(pager=*)(pager=123456))(&(!(pager=*))(pagerphone=123456)))
2113 + * This can be shortened to:
2114 + * (|(pager=123456)(&(!(pager=*))(pagerphone=123456)))
2116 + * i.e. use the first occurring attribute if it exists otherwise if first
2117 + * does not exist use the second etc. The assumption is that the first
2118 + * always takes precedence.
2119 + * This translates to:
2120 + * GenerateSingleFilter(Is);
2121 + * GenerateSingleFilter(DoesNotExists);
2122 + * GenerateSingleFilter(Is);
2123 + */
2125 + for (i = 0; i < pAttrs->GetSize(); i++)
2127 + if(i == 0)
2128 + GenerateSingleFilter(conditionType,filter,vUTF8,pAttrs->GetArray()[i]);
2129 + else
2131 + filter += NS_LITERAL_CSTRING("(&");
2132 + nsAbBooleanConditionType doesNotExistsType = nsIAbBooleanConditionTypes::DoesNotExist;
2133 + for(inner = 0; inner < i; ++inner)
2135 + GenerateSingleFilter(doesNotExistsType,filter,vUTF8,pAttrs->GetArray()[inner]);
2137 + GenerateSingleFilter(conditionType,filter,vUTF8,pAttrs->GetArray()[i]);
2138 + filter += NS_LITERAL_CSTRING(")");
2142 *** misc/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h Fri Sep 28 22:06:21 2001
2143 --- misc/build/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h Tue Jan 15 13:34:34 2008
2144 ***************
2145 *** 42,47 ****
2146 --- 42,48 ----
2147 #include "nsIAbBooleanExpression.h"
2148 #include "nsCOMPtr.h"
2149 #include "nsString.h"
2150 + #include "nsAbUtils.h"
2152 class nsAbBoolExprToLDAPFilter
2154 ***************
2155 *** 67,72 ****
2156 --- 68,83 ----
2157 nsIAbBooleanConditionString* condition,
2158 nsCString& filter,
2159 int flags);
2160 + static void GenerateMultipleFilter(
2161 + nsAbBooleanConditionType conditionType,
2162 + nsCString& filter,
2163 + NS_ConvertUCS2toUTF8 &vUTF8,
2164 + CharPtrArrayGuard *pAttrs);
2165 + static void GenerateSingleFilter(
2166 + nsAbBooleanConditionType conditionType,
2167 + nsCString& filter,
2168 + NS_ConvertUCS2toUTF8 &vUTF8,
2169 + const char *ldapProperty);
2172 #endif
2173 *** misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp Sat Feb 14 03:09:27 2004
2174 --- misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp Tue Jan 15 13:34:34 2008
2175 ***************
2176 *** 118,128 ****
2178 // use mURINoQuery to get a prefName
2179 nsCAutoString prefName;
2180 ! prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen) + NS_LITERAL_CSTRING(".uri");
2182 // turn moz-abldapdirectory://ldap_2.servers.nscpphonebook into -> "ldap_2.servers.nscpphonebook.uri"
2183 nsXPIDLCString URI;
2184 ! rv = prefs->CopyCharPref(prefName.get(), getter_Copies(URI));
2185 if (NS_FAILED(rv))
2188 --- 118,130 ----
2190 // use mURINoQuery to get a prefName
2191 nsCAutoString prefName;
2192 ! prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen) ;
2194 // turn moz-abldapdirectory://ldap_2.servers.nscpphonebook into -> "ldap_2.servers.nscpphonebook.uri"
2195 nsXPIDLCString URI;
2196 ! nsCAutoString uriPrefName;
2197 ! uriPrefName = prefName + NS_LITERAL_CSTRING(".uri");
2198 ! rv = prefs->CopyCharPref(uriPrefName.get(), getter_Copies(URI));
2199 if (NS_FAILED(rv))
2202 ***************
2203 *** 146,151 ****
2204 --- 148,174 ----
2205 nsCAutoString tempLDAPURL(mURINoQuery);
2206 tempLDAPURL.ReplaceSubstring("moz-abldapdirectory:", "ldap:");
2207 rv = mURL->SetSpec(tempLDAPURL);
2208 + NS_ENSURE_SUCCESS(rv,rv);
2210 + nsCAutoString aHost;
2211 + mURL->GetHost(aHost);
2212 + aHost.ReplaceChar('.','_');
2213 + prefName = nsDependentCString("ldap_2.servers.") + aHost;
2214 + PRBool useSSL=0;
2215 + rv = prefs->GetBoolPref(
2216 + PromiseFlatCString(prefName
2217 + + NS_LITERAL_CSTRING(".UseSSL")).get(),
2218 + &useSSL
2219 + );
2221 + // If use SSL,ldap url will look like this ldaps://host:port/.....
2222 + if (!NS_FAILED(rv) && useSSL)
2224 + tempLDAPURL.ReplaceSubstring("ldap:", "ldaps:");
2225 + rv = mURL->SetSpec(tempLDAPURL);
2227 + //NS_FAILED(rv) means ldap_2.servers.nscpphonebook.UseSSL not exist
2228 + rv = 0;
2230 else
2232 ***************
2233 *** 156,179 ****
2234 // get the login information, if there is any
2236 rv = prefs->GetCharPref(
2237 ! PromiseFlatCString(
2238 ! Substring(mURINoQuery, kLDAPDirectoryRootLen,
2239 ! mURINoQuery.Length() - kLDAPDirectoryRootLen)
2240 + NS_LITERAL_CSTRING(".auth.dn")).get(),
2241 getter_Copies(mLogin));
2242 if (NS_FAILED(rv)) {
2243 mLogin.Truncate(); // zero out mLogin
2246 // get the protocol version, if there is any. using a string pref
2247 // here instead of an int, as protocol versions sometimes have names like
2248 // "4bis".
2250 nsXPIDLCString protocolVersion;
2251 rv = prefs->GetCharPref(
2252 ! PromiseFlatCString(
2253 ! Substring(mURINoQuery, kLDAPDirectoryRootLen,
2254 ! mURINoQuery.Length() - kLDAPDirectoryRootLen)
2255 + NS_LITERAL_CSTRING(".protocolVersion")).get(),
2256 getter_Copies(protocolVersion));
2258 --- 179,207 ----
2259 // get the login information, if there is any
2261 rv = prefs->GetCharPref(
2262 ! PromiseFlatCString(prefName
2263 + NS_LITERAL_CSTRING(".auth.dn")).get(),
2264 getter_Copies(mLogin));
2265 if (NS_FAILED(rv)) {
2266 mLogin.Truncate(); // zero out mLogin
2269 + // get the password information, if there is any
2270 + //
2271 + rv = prefs->GetCharPref(
2272 + PromiseFlatCString(prefName
2273 + + NS_LITERAL_CSTRING(".auth.pwd")).get(),
2274 + getter_Copies(mPassword));
2275 + if (NS_FAILED(rv)) {
2276 + mPassword.Truncate(); // zero out mLogin
2278 // get the protocol version, if there is any. using a string pref
2279 // here instead of an int, as protocol versions sometimes have names like
2280 // "4bis".
2282 nsXPIDLCString protocolVersion;
2283 rv = prefs->GetCharPref(
2284 ! PromiseFlatCString(prefName
2285 + NS_LITERAL_CSTRING(".protocolVersion")).get(),
2286 getter_Copies(protocolVersion));
2288 *** misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp Sat Feb 14 03:09:27 2004
2289 --- misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp Tue Jan 15 13:34:34 2008
2290 ***************
2291 *** 74,80 ****
2292 PRInt32 resultLimit = -1,
2293 PRInt32 timeOut = 0);
2294 virtual ~nsAbQueryLDAPMessageListener ();
2296 protected:
2297 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
2298 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
2299 --- 74,80 ----
2300 PRInt32 resultLimit = -1,
2301 PRInt32 timeOut = 0);
2302 virtual ~nsAbQueryLDAPMessageListener ();
2303 ! void SetPassword(const nsAString& aPassword){m_sPassword = aPassword;};
2304 protected:
2305 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
2306 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
2307 ***************
2308 *** 105,110 ****
2309 --- 105,112 ----
2310 PRBool mInitialized;
2311 PRBool mCanceled;
2313 + nsAutoString m_sPassword;
2315 nsCOMPtr<nsILDAPOperation> mSearchOperation;
2317 PRLock* mLock;
2318 ***************
2319 *** 255,261 ****
2321 // If mLogin is set, we're expected to use it to get a password.
2323 ! if (!mDirectoryQuery->mLogin.IsEmpty()) {
2324 // XXX hack until nsUTF8AutoString exists
2325 #define nsUTF8AutoString nsCAutoString
2326 nsUTF8AutoString spec;
2327 --- 257,263 ----
2329 // If mLogin is set, we're expected to use it to get a password.
2331 ! if (!mDirectoryQuery->mLogin.IsEmpty() && !m_sPassword.Length()) {
2332 // XXX hack until nsUTF8AutoString exists
2333 #define nsUTF8AutoString nsCAutoString
2334 nsUTF8AutoString spec;
2335 ***************
2336 *** 398,407 ****
2337 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
2338 NS_ENSURE_SUCCESS(rv, rv);
2340 ! // Bind
2341 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
2342 NS_ENSURE_SUCCESS(rv, rv);
2344 return rv;
2347 --- 400,412 ----
2348 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
2349 NS_ENSURE_SUCCESS(rv, rv);
2352 ! // Bind
2353 ! if (m_sPassword.Length())
2354 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(m_sPassword));
2355 ! else
2356 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
2357 NS_ENSURE_SUCCESS(rv, rv);
2358 return rv;
2361 ***************
2362 *** 685,691 ****
2363 rv = getLdapReturnAttributes (arguments, returnAttributes);
2364 NS_ENSURE_SUCCESS(rv, rv);
2367 // Get the filter
2368 nsCOMPtr<nsISupports> supportsExpression;
2369 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
2370 --- 690,696 ----
2371 rv = getLdapReturnAttributes (arguments, returnAttributes);
2372 NS_ENSURE_SUCCESS(rv, rv);
2375 // Get the filter
2376 nsCOMPtr<nsISupports> supportsExpression;
2377 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
2378 ***************
2379 *** 811,816 ****
2380 --- 816,826 ----
2381 timeOut);
2382 if (_messageListener == NULL)
2383 return NS_ERROR_OUT_OF_MEMORY;
2385 + nsAutoString wPassword;
2386 + wPassword.AssignWithConversion(mPassword.get());
2387 + _messageListener->SetPassword(wPassword);
2389 messageListener = _messageListener;
2390 nsVoidKey key (NS_REINTERPRET_CAST(void *,contextID));
2392 *** misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h Sat Feb 14 03:09:27 2004
2393 --- misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h Tue Jan 15 13:34:34 2008
2394 ***************
2395 *** 74,79 ****
2396 --- 74,80 ----
2397 nsresult RemoveListener (PRInt32 contextID);
2398 nsresult Initiate ();
2399 nsXPIDLCString mLogin; // authenticate to the LDAP server as...
2400 + nsXPIDLCString mPassword; // password to the LDAP server as...
2401 nsCOMPtr<nsILDAPURL> mDirectoryUrl; // the URL for the server
2402 PRUint32 mProtocolVersion; // version of LDAP (see nsILDAPConnection.idl)
2404 *** misc/mozilla/mailnews/addrbook/src/nsAbLDAPProperties.cpp Sat Mar 22 16:43:29 2003
2405 --- misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPProperties.cpp Tue Jan 15 13:34:34 2008
2406 ***************
2407 *** 39,44 ****
2408 --- 39,45 ----
2409 #include "nsAbLDAPProperties.h"
2411 #include "nsAbUtils.h"
2412 + #include "nsCRT.h"
2414 #include "nsCOMPtr.h"
2415 #include "nsString.h"
2416 ***************
2417 *** 59,64 ****
2418 --- 60,80 ----
2419 If there are multiple entries for a mozilla
2420 property the first takes precedence.
2422 + But where we need to do a query against
2423 + a multiple occurring ldap attribute we
2424 + need to OR all the possible ldap entries e.g.
2426 + (CellularNumber=123456) translates to
2427 + (|(mobile=123456)(&(!(mobile=*))(cellphone=123456))(&(!(mobile=*))(!(cellphone=*))(carphone=123456)))
2429 + i.e. use the first occurring attribute otherwise if
2430 + first does not exist use the second etc.
2432 + [Multiple occurring ldap attributes do not
2433 + include aliases. We have also ignored the case
2434 + for including 'displayname' as the first occurring
2435 + attribute 'cn' is a required attribute.]
2437 This ensures that
2439 1) Generality is maintained when mapping from
2440 ***************
2441 *** 101,152 ****
2442 {MozillaProperty_String, "FaxNumber", "fax"},
2443 // organizationalPerson
2444 {MozillaProperty_String, "FaxNumber", "facsimiletelephonenumber"},
2445 ! // inetOrgPerson
2446 ! {MozillaProperty_String, "PagerNumber", "pager"},
2447 ! // ?
2448 ! {MozillaProperty_String, "PagerNumber", "pagerphone"},
2449 ! // inetOrgPerson
2450 ! {MozillaProperty_String, "CellularNumber", "mobile"},
2451 ! // ?
2452 ! {MozillaProperty_String, "CellularNumber", "cellphone"},
2453 ! // ?
2454 ! {MozillaProperty_String, "CellularNumber", "carphone"},
2456 // No Home* properties defined yet
2458 ! // organizationalPerson
2459 ! {MozillaProperty_String, "WorkAddress", "postofficebox"},
2460 ! // ?
2461 ! {MozillaProperty_String, "WorkAddress", "streetaddress"},
2462 // ?
2463 {MozillaProperty_String, "WorkCity", "l"},
2464 // ?
2465 {MozillaProperty_String, "WorkCity", "locality"},
2466 // ?
2467 ! {MozillaProperty_String, "WorkState", "st"},
2468 ! // ?
2469 ! {MozillaProperty_String, "WorkState", "region"},
2470 ! // organizationalPerson
2471 ! {MozillaProperty_String, "WorkZipCode", "postalcode"},
2472 ! // ?
2473 ! {MozillaProperty_String, "WorkZipCode", "zip"},
2474 // ?
2475 {MozillaProperty_String, "WorkCountry", "countryname"},
2477 // organizationalPerson
2478 {MozillaProperty_String, "JobTitle", "title"},
2479 // ?
2480 ! {MozillaProperty_String, "Department", "ou"},
2481 ! // ?
2482 ! {MozillaProperty_String, "Department", "orgunit"},
2483 ! // ?
2484 ! {MozillaProperty_String, "Department", "department"},
2485 ! // ?
2486 ! {MozillaProperty_String, "Department", "departmentnumber"},
2487 ! // inetOrgPerson
2488 ! {MozillaProperty_String, "Company", "o"},
2489 ! // ?
2490 ! {MozillaProperty_String, "Company", "company"},
2491 // ?
2492 {MozillaProperty_String, "WorkCountry", "countryname"},
2493 // ?
2494 --- 117,148 ----
2495 {MozillaProperty_String, "FaxNumber", "fax"},
2496 // organizationalPerson
2497 {MozillaProperty_String, "FaxNumber", "facsimiletelephonenumber"},
2498 ! // inetOrgPerson,?
2499 ! {MozillaProperty_String, "PagerNumber", "pager,pagerphone"},
2500 ! // inetOrgPerson,?,?
2501 ! {MozillaProperty_String, "CellularNumber", "mobile,cellphone,carphone"},
2503 // No Home* properties defined yet
2505 ! // organizationalPerson,?
2506 ! {MozillaProperty_String, "WorkAddress", "postofficebox,streetaddress"},
2507 // ?
2508 {MozillaProperty_String, "WorkCity", "l"},
2509 // ?
2510 {MozillaProperty_String, "WorkCity", "locality"},
2511 // ?
2512 ! {MozillaProperty_String, "WorkState", "st,region"},
2513 ! // organizationalPerson,?
2514 ! {MozillaProperty_String, "WorkZipCode", "postalcode,zip"},
2515 // ?
2516 {MozillaProperty_String, "WorkCountry", "countryname"},
2518 // organizationalPerson
2519 {MozillaProperty_String, "JobTitle", "title"},
2520 // ?
2521 ! {MozillaProperty_String, "Department", "ou,orgunit,department,departmentnumber"},
2522 ! // inetOrgPerson,?
2523 ! {MozillaProperty_String, "Company", "o,company"},
2524 // ?
2525 {MozillaProperty_String, "WorkCountry", "countryname"},
2526 // ?
2527 ***************
2528 *** 168,177 ****
2529 // ?
2530 {MozillaProperty_String, "Custom4", "custom4"},
2532 ! // ?
2533 ! {MozillaProperty_String, "Notes", "notes"},
2534 ! // person
2535 ! {MozillaProperty_String, "Notes", "description"},
2537 // mozilla specfic
2538 {MozillaProperty_Int, "PreferMailFormat", "xmozillausehtmlmail"},
2539 --- 164,171 ----
2540 // ?
2541 {MozillaProperty_String, "Custom4", "custom4"},
2543 ! // ?,person
2544 ! {MozillaProperty_String, "Notes", "notes,description"},
2546 // mozilla specfic
2547 {MozillaProperty_Int, "PreferMailFormat", "xmozillausehtmlmail"},
2548 ***************
2549 *** 209,218 ****
2550 if (IsInitialized) { return ; }
2552 for (int i = tableSize - 1 ; i >= 0 ; -- i) {
2553 - nsCStringKey keyMozilla (table [i].mozillaProperty, -1, nsCStringKey::NEVER_OWN);
2554 - nsCStringKey keyLdap (table [i].ldapProperty, -1, nsCStringKey::NEVER_OWN);
2556 mLdapToMozilla.Put(&keyLdap, NS_REINTERPRET_CAST(void *, NS_CONST_CAST(MozillaLdapPropertyRelation*, &table[i]))) ;
2557 mMozillaToLdap.Put(&keyMozilla, NS_REINTERPRET_CAST(void *, NS_CONST_CAST(MozillaLdapPropertyRelation*, &table[i]))) ;
2559 IsInitialized = PR_TRUE;
2560 --- 203,224 ----
2561 if (IsInitialized) { return ; }
2563 for (int i = tableSize - 1 ; i >= 0 ; -- i) {
2565 + char *attrToken = nsnull;
2566 + char *LDAPProperty = nsCRT::strdup(table[i].ldapProperty);
2567 + char *tmpLDAPProperty;
2569 + attrToken = nsCRT::strtok(LDAPProperty, ",", &tmpLDAPProperty);
2570 + while (attrToken != nsnull)
2572 + while ( ' ' == *attrToken)
2573 + attrToken++;
2574 + nsCStringKey keyLdap (attrToken, -1, nsCStringKey::NEVER_OWN);
2575 mLdapToMozilla.Put(&keyLdap, NS_REINTERPRET_CAST(void *, NS_CONST_CAST(MozillaLdapPropertyRelation*, &table[i]))) ;
2576 + attrToken = nsCRT::strtok(tmpLDAPProperty, ",", &tmpLDAPProperty);
2579 + nsCStringKey keyMozilla (table [i].mozillaProperty, -1, nsCStringKey::NEVER_OWN);
2580 mMozillaToLdap.Put(&keyMozilla, NS_REINTERPRET_CAST(void *, NS_CONST_CAST(MozillaLdapPropertyRelation*, &table[i]))) ;
2582 IsInitialized = PR_TRUE;
2583 ***************
2584 *** 234,243 ****
2585 const MozillaLdapPropertyRelation* MozillaLdapPropertyRelator::findMozillaPropertyFromLdap (const char* ldapProperty)
2587 Initialize();
2588 // ensure that we always do a case insensitive comparison
2589 // against the incoming ldap attributes.
2590 ! nsCAutoString lowercasedProp(ldapProperty);
2591 ! ToLowerCase(nsDependentCString(ldapProperty), lowercasedProp);
2592 nsCStringKey key(lowercasedProp);
2594 return NS_REINTERPRET_CAST(const MozillaLdapPropertyRelation *, mLdapToMozilla.Get(&key)) ;
2595 --- 240,252 ----
2596 const MozillaLdapPropertyRelation* MozillaLdapPropertyRelator::findMozillaPropertyFromLdap (const char* ldapProperty)
2598 Initialize();
2599 + char *attrToken;
2600 + char *tmpLDAPProperty;
2601 + attrToken = nsCRT::strtok(NS_CONST_CAST(char *,ldapProperty), ",", &tmpLDAPProperty);
2602 // ensure that we always do a case insensitive comparison
2603 // against the incoming ldap attributes.
2604 ! nsCAutoString lowercasedProp (attrToken) ;
2605 ! ToLowerCase(nsDependentCString(attrToken),lowercasedProp);
2606 nsCStringKey key(lowercasedProp);
2608 return NS_REINTERPRET_CAST(const MozillaLdapPropertyRelation *, mLdapToMozilla.Get(&key)) ;
2609 ***************
2610 *** 287,291 ****
2611 --- 296,361 ----
2615 + return rv;
2618 + // Parse the input string which may contain a single ldap attribute or multiple attributes in the form
2619 + // "string" or "string1,string2,string3" respectively and assign to the array.
2620 + nsresult MozillaLdapPropertyRelator::getAllLDAPAttrsFromMozilla (const char* aLDAPProperty, PRUint32 *aAttrCount, char * **aAttributes)
2622 + NS_ENSURE_ARG_POINTER(aAttrCount);
2623 + NS_ENSURE_ARG_POINTER(aAttributes);
2625 + nsresult rv = NS_OK;
2627 + *aAttributes = 0;
2628 + // we must have at least one attribute
2629 + *aAttrCount = 1;
2631 + // if no multiple ldap attributes then allocate our single entry and exit
2632 + if (!strchr(aLDAPProperty,','))
2634 + if (!(*aAttributes = NS_STATIC_CAST(char **, nsMemory::Alloc(sizeof(char *)))))
2635 + return NS_ERROR_OUT_OF_MEMORY;
2636 + if (!((*aAttributes)[0] = nsCRT::strdup(aLDAPProperty)))
2637 + return NS_ERROR_OUT_OF_MEMORY;
2639 + return rv;
2642 + char *attrToken = nsnull;
2643 + char *LDAPProperty = nsnull;
2644 + char *tmpLDAPProperty;
2646 + if((LDAPProperty = nsCRT::strdup(aLDAPProperty)) == nsnull)
2647 + return NS_ERROR_OUT_OF_MEMORY;
2649 + // set our tokenizer to the start
2650 + attrToken = nsCRT::strtok(LDAPProperty, ",", &tmpLDAPProperty);
2652 + // Count up the attribute names
2653 + while ((attrToken = nsCRT::strtok(tmpLDAPProperty, ",", &tmpLDAPProperty)) != nsnull)
2654 + *aAttrCount += 1;
2656 + nsCRT::free (LDAPProperty);
2657 + if(!(*aAttributes = NS_STATIC_CAST(char **, nsMemory::Alloc(*aAttrCount * sizeof(char *)))))
2658 + return NS_ERROR_OUT_OF_MEMORY;
2660 + if((LDAPProperty = nsCRT::strdup(aLDAPProperty)) == nsnull)
2661 + return NS_ERROR_OUT_OF_MEMORY;
2663 + PRInt32 j = 0;
2664 + attrToken = nsCRT::strtok(LDAPProperty, ",", &tmpLDAPProperty);
2665 + while (nsnull != attrToken) {
2666 + if(((*aAttributes)[j++] = nsCRT::strdup(attrToken)) == nsnull)
2668 + nsCRT::free(LDAPProperty);
2669 + return NS_ERROR_OUT_OF_MEMORY;
2672 + attrToken = nsCRT::strtok(tmpLDAPProperty, ",", &tmpLDAPProperty);
2675 + nsCRT::free(LDAPProperty);
2676 return rv;
2678 *** misc/mozilla/mailnews/addrbook/src/nsAbLDAPProperties.h Tue Apr 9 11:27:24 2002
2679 --- misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPProperties.h Tue Jan 15 13:34:34 2008
2680 ***************
2681 *** 85,90 ****
2682 --- 85,91 ----
2683 static nsresult createCardPropertyFromLDAPMessage (nsILDAPMessage* message,
2684 nsIAbCard* card,
2685 PRBool* hasSetCardProperty);
2686 + static nsresult getAllLDAPAttrsFromMozilla (const char* aLDAPProperty, PRUint32 *aAttrCount, char * **aAttributes);
2689 #endif
2690 *** misc/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp Tue Jan 15 13:43:17 2008
2691 --- misc/build/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp Tue Jan 15 13:34:34 2008
2692 ***************
2693 *** 1 ****
2694 ! dummy
2695 --- 1,633 ----
2696 ! /*
2697 ! * The contents of this file are subject to the Mozilla Public
2698 ! * License Version 1.1 (the "License"); you may not use this file
2699 ! * except in compliance with the License. You may obtain a copy of
2700 ! * the License at http://www.mozilla.org/MPL/
2701 ! *
2702 ! * Software distributed under the License is distributed on an "AS
2703 ! * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
2704 ! * implied. See the License for the specific language governing
2705 ! * rights and limitations under the License.
2706 ! *
2707 ! * The Original Code is the Netscape security libraries.
2708 ! *
2709 ! * The Initial Developer of the Original Code is Netscape
2710 ! * Communications Corporation. Portions created by Netscape are
2711 ! * Copyright (C) 1994-2000 Netscape Communications Corporation. All
2712 ! * Rights Reserved.
2713 ! *
2714 ! * Contributor(s):
2715 ! *
2716 ! * Alternatively, the contents of this file may be used under the
2717 ! * terms of the GNU General Public License Version 2 or later (the
2718 ! * "GPL"), in which case the provisions of the GPL are applicable
2719 ! * instead of those above. If you wish to allow use of your
2720 ! * version of this file only under the terms of the GPL and not to
2721 ! * allow others to use your version of this file under the MPL,
2722 ! * indicate your decision by deleting the provisions above and
2723 ! * replace them with the notice and other provisions required by
2724 ! * the GPL. If you do not delete the provisions above, a recipient
2725 ! * may use your version of this file under either the MPL or the
2726 ! * GPL.
2727 ! */
2728 ! #include <stdio.h>
2729 ! #include <stdlib.h>
2731 ! #include "prerr.h"
2733 ! #include "prtypes.h"
2734 ! #include "prlong.h"
2735 ! #include "plstr.h"
2736 ! #include "nsMemory.h"
2738 ! #define MD5_HASH_LEN 16
2739 ! #define MD5_BUFFER_SIZE 64
2740 ! #define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
2742 ! #define CV0_1 0x67452301
2743 ! #define CV0_2 0xefcdab89
2744 ! #define CV0_3 0x98badcfe
2745 ! #define CV0_4 0x10325476
2747 ! #define T1_0 0xd76aa478
2748 ! #define T1_1 0xe8c7b756
2749 ! #define T1_2 0x242070db
2750 ! #define T1_3 0xc1bdceee
2751 ! #define T1_4 0xf57c0faf
2752 ! #define T1_5 0x4787c62a
2753 ! #define T1_6 0xa8304613
2754 ! #define T1_7 0xfd469501
2755 ! #define T1_8 0x698098d8
2756 ! #define T1_9 0x8b44f7af
2757 ! #define T1_10 0xffff5bb1
2758 ! #define T1_11 0x895cd7be
2759 ! #define T1_12 0x6b901122
2760 ! #define T1_13 0xfd987193
2761 ! #define T1_14 0xa679438e
2762 ! #define T1_15 0x49b40821
2764 ! #define T2_0 0xf61e2562
2765 ! #define T2_1 0xc040b340
2766 ! #define T2_2 0x265e5a51
2767 ! #define T2_3 0xe9b6c7aa
2768 ! #define T2_4 0xd62f105d
2769 ! #define T2_5 0x02441453
2770 ! #define T2_6 0xd8a1e681
2771 ! #define T2_7 0xe7d3fbc8
2772 ! #define T2_8 0x21e1cde6
2773 ! #define T2_9 0xc33707d6
2774 ! #define T2_10 0xf4d50d87
2775 ! #define T2_11 0x455a14ed
2776 ! #define T2_12 0xa9e3e905
2777 ! #define T2_13 0xfcefa3f8
2778 ! #define T2_14 0x676f02d9
2779 ! #define T2_15 0x8d2a4c8a
2781 ! #define T3_0 0xfffa3942
2782 ! #define T3_1 0x8771f681
2783 ! #define T3_2 0x6d9d6122
2784 ! #define T3_3 0xfde5380c
2785 ! #define T3_4 0xa4beea44
2786 ! #define T3_5 0x4bdecfa9
2787 ! #define T3_6 0xf6bb4b60
2788 ! #define T3_7 0xbebfbc70
2789 ! #define T3_8 0x289b7ec6
2790 ! #define T3_9 0xeaa127fa
2791 ! #define T3_10 0xd4ef3085
2792 ! #define T3_11 0x04881d05
2793 ! #define T3_12 0xd9d4d039
2794 ! #define T3_13 0xe6db99e5
2795 ! #define T3_14 0x1fa27cf8
2796 ! #define T3_15 0xc4ac5665
2798 ! #define T4_0 0xf4292244
2799 ! #define T4_1 0x432aff97
2800 ! #define T4_2 0xab9423a7
2801 ! #define T4_3 0xfc93a039
2802 ! #define T4_4 0x655b59c3
2803 ! #define T4_5 0x8f0ccc92
2804 ! #define T4_6 0xffeff47d
2805 ! #define T4_7 0x85845dd1
2806 ! #define T4_8 0x6fa87e4f
2807 ! #define T4_9 0xfe2ce6e0
2808 ! #define T4_10 0xa3014314
2809 ! #define T4_11 0x4e0811a1
2810 ! #define T4_12 0xf7537e82
2811 ! #define T4_13 0xbd3af235
2812 ! #define T4_14 0x2ad7d2bb
2813 ! #define T4_15 0xeb86d391
2815 ! #define R1B0 0
2816 ! #define R1B1 1
2817 ! #define R1B2 2
2818 ! #define R1B3 3
2819 ! #define R1B4 4
2820 ! #define R1B5 5
2821 ! #define R1B6 6
2822 ! #define R1B7 7
2823 ! #define R1B8 8
2824 ! #define R1B9 9
2825 ! #define R1B10 10
2826 ! #define R1B11 11
2827 ! #define R1B12 12
2828 ! #define R1B13 13
2829 ! #define R1B14 14
2830 ! #define R1B15 15
2832 ! #define R2B0 1
2833 ! #define R2B1 6
2834 ! #define R2B2 11
2835 ! #define R2B3 0
2836 ! #define R2B4 5
2837 ! #define R2B5 10
2838 ! #define R2B6 15
2839 ! #define R2B7 4
2840 ! #define R2B8 9
2841 ! #define R2B9 14
2842 ! #define R2B10 3
2843 ! #define R2B11 8
2844 ! #define R2B12 13
2845 ! #define R2B13 2
2846 ! #define R2B14 7
2847 ! #define R2B15 12
2849 ! #define R3B0 5
2850 ! #define R3B1 8
2851 ! #define R3B2 11
2852 ! #define R3B3 14
2853 ! #define R3B4 1
2854 ! #define R3B5 4
2855 ! #define R3B6 7
2856 ! #define R3B7 10
2857 ! #define R3B8 13
2858 ! #define R3B9 0
2859 ! #define R3B10 3
2860 ! #define R3B11 6
2861 ! #define R3B12 9
2862 ! #define R3B13 12
2863 ! #define R3B14 15
2864 ! #define R3B15 2
2866 ! #define R4B0 0
2867 ! #define R4B1 7
2868 ! #define R4B2 14
2869 ! #define R4B3 5
2870 ! #define R4B4 12
2871 ! #define R4B5 3
2872 ! #define R4B6 10
2873 ! #define R4B7 1
2874 ! #define R4B8 8
2875 ! #define R4B9 15
2876 ! #define R4B10 6
2877 ! #define R4B11 13
2878 ! #define R4B12 4
2879 ! #define R4B13 11
2880 ! #define R4B14 2
2881 ! #define R4B15 9
2883 ! #define S1_0 7
2884 ! #define S1_1 12
2885 ! #define S1_2 17
2886 ! #define S1_3 22
2888 ! #define S2_0 5
2889 ! #define S2_1 9
2890 ! #define S2_2 14
2891 ! #define S2_3 20
2893 ! #define S3_0 4
2894 ! #define S3_1 11
2895 ! #define S3_2 16
2896 ! #define S3_3 23
2898 ! #define S4_0 6
2899 ! #define S4_1 10
2900 ! #define S4_2 15
2901 ! #define S4_3 21
2903 ! struct MD5ContextStr {
2904 ! PRUint32 lsbInput;
2905 ! PRUint32 msbInput;
2906 ! PRUint32 cv[4];
2907 ! union {
2908 ! PRUint8 b[64];
2909 ! PRUint32 w[16];
2910 ! } u;
2911 ! };
2912 ! typedef struct MD5ContextStr MD5Context;
2914 ! #define inBuf u.b
2916 ! int MD5_Hash(unsigned char *dest, const char *src);
2917 ! int MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length);
2918 ! MD5Context * MD5_NewContext(void);
2919 ! void MD5_DestroyContext(MD5Context *cx, PRBool freeit);
2920 ! void MD5_Begin(MD5Context *cx);
2921 ! static void md5_compress(MD5Context *cx);
2922 ! void MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen);
2923 ! void MD5_End(MD5Context *cx, unsigned char *digest,
2924 ! unsigned int *digestLen, unsigned int maxDigestLen);
2925 ! unsigned int MD5_FlattenSize(MD5Context *cx);
2926 ! int MD5_Flatten(MD5Context *cx, unsigned char *space);
2927 ! MD5Context * MD5_Resurrect(unsigned char *space, void *arg);
2928 ! void MD5_TraceState(MD5Context *cx);
2930 ! int
2931 ! MD5_Hash(unsigned char *dest, const char *src)
2933 ! return MD5_HashBuf(dest, (unsigned char *)src, PL_strlen(src));
2936 ! int
2937 ! MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
2939 ! unsigned int len;
2940 ! MD5Context *cx = MD5_NewContext();
2941 ! if (cx == NULL) {
2942 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
2943 ! return -1;
2945 ! MD5_Begin(cx);
2946 ! MD5_Update(cx, src, src_length);
2947 ! MD5_End(cx, dest, &len, MD5_HASH_LEN);
2948 ! MD5_DestroyContext(cx, PR_TRUE);
2949 ! return 0;
2952 ! MD5Context *
2953 ! MD5_NewContext(void)
2955 ! MD5Context *cx = (MD5Context *)malloc(sizeof(MD5Context));
2956 ! if (cx == NULL) {
2957 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
2958 ! return NULL;
2960 ! return cx;
2963 ! void
2964 ! MD5_DestroyContext(MD5Context *cx, PRBool freeit)
2966 ! if (freeit) {
2967 ! free(cx);
2971 ! void
2972 ! MD5_Begin(MD5Context *cx)
2974 ! cx->lsbInput = 0;
2975 ! cx->msbInput = 0;
2976 ! memset(cx->inBuf, 0, sizeof(cx->inBuf));
2977 ! cx->cv[0] = CV0_1;
2978 ! cx->cv[1] = CV0_2;
2979 ! cx->cv[2] = CV0_3;
2980 ! cx->cv[3] = CV0_4;
2983 ! #define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
2985 ! #define MASK 0x00ff00ff
2986 ! #ifdef IS_LITTLE_ENDIAN
2987 ! #define lendian(i32) \
2988 ! (i32)
2989 ! #else
2990 ! #define lendian(i32) \
2991 ! (tmp = i32 >> 16 | i32 << 16, (tmp & MASK) << 8 | tmp >> 8 & MASK)
2992 ! #endif
2994 ! #if defined(SOLARIS) || defined(HPUX)
2995 ! #define addto64(sumhigh, sumlow, addend) \
2996 ! sumlow += addend; sumhigh += (sumlow < addend);
2997 ! #else
2998 ! #define addto64(sumhigh, sumlow, addend) \
2999 ! sumlow += addend; if (sumlow < addend) ++sumhigh;
3000 ! #endif
3002 ! #define F(X, Y, Z) \
3003 ! ((X & Y) | ((~X) & Z))
3005 ! #define G(X, Y, Z) \
3006 ! ((X & Z) | (Y & (~Z)))
3008 ! #define H(X, Y, Z) \
3009 ! (X ^ Y ^ Z)
3011 ! #define I(X, Y, Z) \
3012 ! (Y ^ (X | (~Z)))
3014 ! #define FF(a, b, c, d, bufint, s, ti) \
3015 ! a = b + cls(a + F(b, c, d) + bufint + ti, s)
3017 ! #define GG(a, b, c, d, bufint, s, ti) \
3018 ! a = b + cls(a + G(b, c, d) + bufint + ti, s)
3020 ! #define HH(a, b, c, d, bufint, s, ti) \
3021 ! a = b + cls(a + H(b, c, d) + bufint + ti, s)
3023 ! #define II(a, b, c, d, bufint, s, ti) \
3024 ! a = b + cls(a + I(b, c, d) + bufint + ti, s)
3026 ! static void
3027 ! md5_compress(MD5Context *cx)
3029 ! PRUint32 a, b, c, d;
3030 ! PRUint32 tmp;
3031 ! a = cx->cv[0];
3032 ! b = cx->cv[1];
3033 ! c = cx->cv[2];
3034 ! d = cx->cv[3];
3035 ! #ifndef IS_LITTLE_ENDIAN
3036 ! cx->u.w[0] = lendian(cx->u.w[0]);
3037 ! cx->u.w[1] = lendian(cx->u.w[1]);
3038 ! cx->u.w[2] = lendian(cx->u.w[2]);
3039 ! cx->u.w[3] = lendian(cx->u.w[3]);
3040 ! cx->u.w[4] = lendian(cx->u.w[4]);
3041 ! cx->u.w[5] = lendian(cx->u.w[5]);
3042 ! cx->u.w[6] = lendian(cx->u.w[6]);
3043 ! cx->u.w[7] = lendian(cx->u.w[7]);
3044 ! cx->u.w[8] = lendian(cx->u.w[8]);
3045 ! cx->u.w[9] = lendian(cx->u.w[9]);
3046 ! cx->u.w[10] = lendian(cx->u.w[10]);
3047 ! cx->u.w[11] = lendian(cx->u.w[11]);
3048 ! cx->u.w[12] = lendian(cx->u.w[12]);
3049 ! cx->u.w[13] = lendian(cx->u.w[13]);
3050 ! cx->u.w[14] = lendian(cx->u.w[14]);
3051 ! cx->u.w[15] = lendian(cx->u.w[15]);
3052 ! #endif
3053 ! FF(a, b, c, d, cx->u.w[R1B0 ], S1_0, T1_0);
3054 ! FF(d, a, b, c, cx->u.w[R1B1 ], S1_1, T1_1);
3055 ! FF(c, d, a, b, cx->u.w[R1B2 ], S1_2, T1_2);
3056 ! FF(b, c, d, a, cx->u.w[R1B3 ], S1_3, T1_3);
3057 ! FF(a, b, c, d, cx->u.w[R1B4 ], S1_0, T1_4);
3058 ! FF(d, a, b, c, cx->u.w[R1B5 ], S1_1, T1_5);
3059 ! FF(c, d, a, b, cx->u.w[R1B6 ], S1_2, T1_6);
3060 ! FF(b, c, d, a, cx->u.w[R1B7 ], S1_3, T1_7);
3061 ! FF(a, b, c, d, cx->u.w[R1B8 ], S1_0, T1_8);
3062 ! FF(d, a, b, c, cx->u.w[R1B9 ], S1_1, T1_9);
3063 ! FF(c, d, a, b, cx->u.w[R1B10], S1_2, T1_10);
3064 ! FF(b, c, d, a, cx->u.w[R1B11], S1_3, T1_11);
3065 ! FF(a, b, c, d, cx->u.w[R1B12], S1_0, T1_12);
3066 ! FF(d, a, b, c, cx->u.w[R1B13], S1_1, T1_13);
3067 ! FF(c, d, a, b, cx->u.w[R1B14], S1_2, T1_14);
3068 ! FF(b, c, d, a, cx->u.w[R1B15], S1_3, T1_15);
3069 ! GG(a, b, c, d, cx->u.w[R2B0 ], S2_0, T2_0);
3070 ! GG(d, a, b, c, cx->u.w[R2B1 ], S2_1, T2_1);
3071 ! GG(c, d, a, b, cx->u.w[R2B2 ], S2_2, T2_2);
3072 ! GG(b, c, d, a, cx->u.w[R2B3 ], S2_3, T2_3);
3073 ! GG(a, b, c, d, cx->u.w[R2B4 ], S2_0, T2_4);
3074 ! GG(d, a, b, c, cx->u.w[R2B5 ], S2_1, T2_5);
3075 ! GG(c, d, a, b, cx->u.w[R2B6 ], S2_2, T2_6);
3076 ! GG(b, c, d, a, cx->u.w[R2B7 ], S2_3, T2_7);
3077 ! GG(a, b, c, d, cx->u.w[R2B8 ], S2_0, T2_8);
3078 ! GG(d, a, b, c, cx->u.w[R2B9 ], S2_1, T2_9);
3079 ! GG(c, d, a, b, cx->u.w[R2B10], S2_2, T2_10);
3080 ! GG(b, c, d, a, cx->u.w[R2B11], S2_3, T2_11);
3081 ! GG(a, b, c, d, cx->u.w[R2B12], S2_0, T2_12);
3082 ! GG(d, a, b, c, cx->u.w[R2B13], S2_1, T2_13);
3083 ! GG(c, d, a, b, cx->u.w[R2B14], S2_2, T2_14);
3084 ! GG(b, c, d, a, cx->u.w[R2B15], S2_3, T2_15);
3085 ! HH(a, b, c, d, cx->u.w[R3B0 ], S3_0, T3_0);
3086 ! HH(d, a, b, c, cx->u.w[R3B1 ], S3_1, T3_1);
3087 ! HH(c, d, a, b, cx->u.w[R3B2 ], S3_2, T3_2);
3088 ! HH(b, c, d, a, cx->u.w[R3B3 ], S3_3, T3_3);
3089 ! HH(a, b, c, d, cx->u.w[R3B4 ], S3_0, T3_4);
3090 ! HH(d, a, b, c, cx->u.w[R3B5 ], S3_1, T3_5);
3091 ! HH(c, d, a, b, cx->u.w[R3B6 ], S3_2, T3_6);
3092 ! HH(b, c, d, a, cx->u.w[R3B7 ], S3_3, T3_7);
3093 ! HH(a, b, c, d, cx->u.w[R3B8 ], S3_0, T3_8);
3094 ! HH(d, a, b, c, cx->u.w[R3B9 ], S3_1, T3_9);
3095 ! HH(c, d, a, b, cx->u.w[R3B10], S3_2, T3_10);
3096 ! HH(b, c, d, a, cx->u.w[R3B11], S3_3, T3_11);
3097 ! HH(a, b, c, d, cx->u.w[R3B12], S3_0, T3_12);
3098 ! HH(d, a, b, c, cx->u.w[R3B13], S3_1, T3_13);
3099 ! HH(c, d, a, b, cx->u.w[R3B14], S3_2, T3_14);
3100 ! HH(b, c, d, a, cx->u.w[R3B15], S3_3, T3_15);
3101 ! II(a, b, c, d, cx->u.w[R4B0 ], S4_0, T4_0);
3102 ! II(d, a, b, c, cx->u.w[R4B1 ], S4_1, T4_1);
3103 ! II(c, d, a, b, cx->u.w[R4B2 ], S4_2, T4_2);
3104 ! II(b, c, d, a, cx->u.w[R4B3 ], S4_3, T4_3);
3105 ! II(a, b, c, d, cx->u.w[R4B4 ], S4_0, T4_4);
3106 ! II(d, a, b, c, cx->u.w[R4B5 ], S4_1, T4_5);
3107 ! II(c, d, a, b, cx->u.w[R4B6 ], S4_2, T4_6);
3108 ! II(b, c, d, a, cx->u.w[R4B7 ], S4_3, T4_7);
3109 ! II(a, b, c, d, cx->u.w[R4B8 ], S4_0, T4_8);
3110 ! II(d, a, b, c, cx->u.w[R4B9 ], S4_1, T4_9);
3111 ! II(c, d, a, b, cx->u.w[R4B10], S4_2, T4_10);
3112 ! II(b, c, d, a, cx->u.w[R4B11], S4_3, T4_11);
3113 ! II(a, b, c, d, cx->u.w[R4B12], S4_0, T4_12);
3114 ! II(d, a, b, c, cx->u.w[R4B13], S4_1, T4_13);
3115 ! II(c, d, a, b, cx->u.w[R4B14], S4_2, T4_14);
3116 ! II(b, c, d, a, cx->u.w[R4B15], S4_3, T4_15);
3117 ! cx->cv[0] += a;
3118 ! cx->cv[1] += b;
3119 ! cx->cv[2] += c;
3120 ! cx->cv[3] += d;
3123 ! void
3124 ! MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen)
3126 ! PRUint32 bytesToConsume;
3127 ! PRUint32 inBufIndex = cx->lsbInput & 63;
3129 ! /* Add the number of input bytes to the 64-bit input counter. */
3130 ! addto64(cx->msbInput, cx->lsbInput, inputLen);
3131 ! if (inBufIndex) {
3132 ! /* There is already data in the buffer. Fill with input. */
3133 ! bytesToConsume = PR_MIN(inputLen, MD5_BUFFER_SIZE - inBufIndex);
3134 ! memcpy(&cx->inBuf[inBufIndex], input, bytesToConsume);
3135 ! if (inBufIndex + bytesToConsume >= MD5_BUFFER_SIZE)
3136 ! /* The buffer is filled. Run the compression function. */
3137 ! md5_compress(cx);
3138 ! /* Remaining input. */
3139 ! inputLen -= bytesToConsume;
3140 ! input += bytesToConsume;
3143 ! /* Iterate over 64-byte chunks of the message. */
3144 ! while (inputLen >= MD5_BUFFER_SIZE) {
3145 ! memcpy(cx->inBuf, input, MD5_BUFFER_SIZE);
3146 ! md5_compress(cx);
3147 ! inputLen -= MD5_BUFFER_SIZE;
3148 ! input += MD5_BUFFER_SIZE;
3151 ! /* Tail of message (message bytes mod 64). */
3152 ! if (inputLen)
3153 ! memcpy(cx->inBuf, input, inputLen);
3156 ! static const unsigned char padbytes[] = {
3157 ! 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3158 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3159 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3160 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3161 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3162 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3163 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3164 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3165 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3166 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3167 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3168 ! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
3169 ! };
3171 ! void
3172 ! MD5_End(MD5Context *cx, unsigned char *digest,
3173 ! unsigned int *digestLen, unsigned int maxDigestLen)
3175 ! #ifndef IS_LITTLE_ENDIAN
3176 ! PRUint32 tmp;
3177 ! #endif
3178 ! PRUint32 lowInput, highInput;
3179 ! PRUint32 inBufIndex = cx->lsbInput & 63;
3181 ! if (maxDigestLen < MD5_HASH_LEN) {
3182 ! // PORT_SetError(SEC_ERROR_INVALID_ARGS);
3183 ! return;
3186 ! /* Copy out the length of bits input before padding. */
3187 ! lowInput = cx->lsbInput;
3188 ! highInput = (cx->msbInput << 3) | (lowInput >> 29);
3189 ! lowInput <<= 3;
3191 ! if (inBufIndex < MD5_END_BUFFER) {
3192 ! MD5_Update(cx, padbytes, MD5_END_BUFFER - inBufIndex);
3193 ! } else {
3194 ! MD5_Update(cx, padbytes,
3195 ! MD5_END_BUFFER + MD5_BUFFER_SIZE - inBufIndex);
3198 ! /* Store the number of bytes input (before padding) in final 64 bits. */
3199 ! cx->u.w[14] = lendian(lowInput);
3200 ! cx->u.w[15] = lendian(highInput);
3202 ! /* Final call to compress. */
3203 ! md5_compress(cx);
3205 ! /* Copy the resulting values out of the chain variables into return buf. */
3206 ! *digestLen = MD5_HASH_LEN;
3207 ! #ifndef IS_LITTLE_ENDIAN
3208 ! cx->cv[0] = lendian(cx->cv[0]);
3209 ! cx->cv[1] = lendian(cx->cv[1]);
3210 ! cx->cv[2] = lendian(cx->cv[2]);
3211 ! cx->cv[3] = lendian(cx->cv[3]);
3212 ! #endif
3213 ! memcpy(digest, cx->cv, MD5_HASH_LEN);
3216 ! unsigned int
3217 ! MD5_FlattenSize(MD5Context *cx)
3219 ! return sizeof(*cx);
3222 ! int
3223 ! MD5_Flatten(MD5Context *cx, unsigned char *space)
3225 ! memcpy(space, cx, sizeof(*cx));
3226 ! return 0;
3229 ! MD5Context *
3230 ! MD5_Resurrect(unsigned char *space, void *arg)
3232 ! MD5Context *cx = MD5_NewContext();
3233 ! if (cx)
3234 ! memcpy(cx, space, sizeof(*cx));
3235 ! return cx;
3238 ! void
3239 ! MD5_TraceState(MD5Context *cx)
3241 ! // PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
3244 ! int
3245 ! md5_stream (FILE *stream, unsigned char *dest)
3247 ! /* Important: BLOCKSIZE must be a multiple of 64. */
3248 ! #define BLOCKSIZE 4096
3249 ! unsigned int len;
3250 ! MD5Context *cx = MD5_NewContext();
3251 ! if (cx == NULL) {
3252 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
3253 ! return -1;
3256 ! unsigned char buffer[BLOCKSIZE + 72];
3257 ! size_t sum;
3259 ! /* Initialize the computation context. */
3260 ! MD5_Begin(cx);
3262 ! /* Iterate over full file contents. */
3263 ! while (1)
3265 ! /* We read the file in blocks of BLOCKSIZE bytes. One call of the
3266 ! computation function processes the whole buffer so that with the
3267 ! next round of the loop another block can be read. */
3268 ! size_t n;
3269 ! sum = 0;
3271 ! /* Read block. Take care for partial reads. */
3272 ! do
3274 ! n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
3276 ! sum += n;
3278 ! while (sum < BLOCKSIZE && n != 0);
3279 ! if (n == 0 && ferror (stream))
3280 ! return 1;
3282 ! /* If end of file is reached, end the loop. */
3283 ! if (n == 0)
3284 ! break;
3286 ! /* Process buffer with BLOCKSIZE bytes. Note that
3287 ! BLOCKSIZE % 64 == 0
3288 ! */
3289 ! MD5_Update(cx, buffer, BLOCKSIZE);
3292 ! /* Add the last bytes if necessary. */
3293 ! if (sum > 0)
3294 ! MD5_Update(cx, buffer, sum);
3296 ! MD5_End(cx, dest, &len, MD5_HASH_LEN);
3297 ! MD5_DestroyContext(cx, PR_TRUE);
3298 ! return len;
3302 ! int getMD5sum(const char * fileName,char * sum)
3304 ! unsigned char bin_sum[16];
3305 ! int len=0;
3306 ! if (fileName)
3308 ! FILE *fp=fopen(fileName,"rb");
3309 ! if (fp)
3311 ! len=md5_stream(fp,bin_sum);
3312 ! memset(sum,0,33);
3313 ! for (int i = 0; i < len; ++i)
3314 ! sprintf (sum,"%s%02x",sum, bin_sum[i]);
3315 ! fclose(fp);
3316 ! return 0;
3319 ! return 1;
3322 ! int testMD5sum(const char * fileName,char * sum)
3324 ! char newSum[33]="";
3325 ! if (getMD5sum(fileName,newSum))
3326 ! return 1;
3327 ! return strcmp(newSum,sum);
3329 *** misc/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp Tue Nov 12 20:19:56 2002
3330 --- misc/build/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp Tue Jan 15 13:34:34 2008
3331 ***************
3332 *** 266,273 ****
3333 if (mCardDatabase)
3335 mCardDatabase->EditCard(this, PR_TRUE);
3336 ! mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3337 ! return NS_OK;
3339 else
3340 return NS_ERROR_FAILURE;
3341 --- 266,272 ----
3342 if (mCardDatabase)
3344 mCardDatabase->EditCard(this, PR_TRUE);
3345 ! return mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3347 else
3348 return NS_ERROR_FAILURE;
3349 *** misc/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp Tue Mar 9 15:42:24 2004
3350 --- misc/build/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp Tue Jan 15 13:34:34 2008
3351 ***************
3352 *** 537,543 ****
3356 ! mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3358 return rv;
3360 --- 537,543 ----
3364 ! rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3366 return rv;
3368 ***************
3369 *** 684,689 ****
3370 --- 684,690 ----
3371 return NS_ERROR_NOT_IMPLEMENTED;
3373 nsresult rv = NS_OK;
3375 if (!mDatabase)
3376 rv = GetAbDatabase();
3378 ***************
3379 *** 713,722 ****
3380 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE);
3381 else
3382 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
3383 ! mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3385 NS_IF_ADDREF(*addedCard = newCard);
3386 ! return NS_OK;
3389 NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard)
3390 --- 714,724 ----
3391 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE);
3392 else
3393 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
3394 ! rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3396 + NS_ENSURE_SUCCESS(rv, rv);
3397 NS_IF_ADDREF(*addedCard = newCard);
3398 ! return rv;
3401 NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard)
3402 *** misc/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp Tue Mar 9 16:18:40 2004
3403 --- misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp Tue Jan 15 13:34:34 2008
3404 ***************
3405 *** 97,102 ****
3406 --- 97,103 ----
3408 index_DisplayName = 0,
3409 index_EmailAddress,
3410 + index_SecondEmailAddress,
3411 index_FirstName,
3412 index_LastName,
3413 index_NickName,
3414 ***************
3415 *** 124,155 ****
3417 static const ULONG OutlookCardMAPIProps [] =
3419 ! PR_DISPLAY_NAME_W,
3420 ! PR_EMAIL_ADDRESS_W,
3421 ! PR_GIVEN_NAME_W,
3422 ! PR_SURNAME_W,
3423 ! PR_NICKNAME_W,
3424 ! PR_BUSINESS_TELEPHONE_NUMBER_W,
3425 ! PR_HOME_TELEPHONE_NUMBER_W,
3426 ! PR_BUSINESS_FAX_NUMBER_W,
3427 ! PR_PAGER_TELEPHONE_NUMBER_W,
3428 ! PR_MOBILE_TELEPHONE_NUMBER_W,
3429 ! PR_HOME_ADDRESS_CITY_W,
3430 ! PR_HOME_ADDRESS_STATE_OR_PROVINCE_W,
3431 ! PR_HOME_ADDRESS_POSTAL_CODE_W,
3432 ! PR_HOME_ADDRESS_COUNTRY_W,
3433 ! PR_BUSINESS_ADDRESS_CITY_W,
3434 ! PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W,
3435 ! PR_BUSINESS_ADDRESS_POSTAL_CODE_W,
3436 ! PR_BUSINESS_ADDRESS_COUNTRY_W,
3437 ! PR_TITLE_W,
3438 ! PR_DEPARTMENT_NAME_W,
3439 ! PR_COMPANY_NAME_W,
3440 ! PR_BUSINESS_HOME_PAGE_W,
3441 ! PR_PERSONAL_HOME_PAGE_W,
3442 ! PR_COMMENT_W
3445 nsresult nsAbOutlookCard::Init(const char *aUri)
3447 nsresult retCode = nsRDFResource::Init(aUri) ;
3448 --- 125,158 ----
3450 static const ULONG OutlookCardMAPIProps [] =
3452 ! PR_DISPLAY_NAME_A,//0x8035001E
3453 ! PR_EMAIL_ADDRESS_A,//0x8034001E
3454 ! PR_SECOND_EMAIL_ADDRESS_A,//Second Email Address
3455 ! PR_GIVEN_NAME_A,
3456 ! PR_SURNAME_A,
3457 ! PR_NICKNAME_A,
3458 ! PR_BUSINESS_TELEPHONE_NUMBER_A,
3459 ! PR_HOME_TELEPHONE_NUMBER_A,
3460 ! PR_BUSINESS_FAX_NUMBER_A,
3461 ! PR_PAGER_TELEPHONE_NUMBER_A,
3462 ! PR_MOBILE_TELEPHONE_NUMBER_A,
3463 ! PR_HOME_ADDRESS_CITY_A,
3464 ! PR_HOME_ADDRESS_STATE_OR_PROVINCE_A,
3465 ! PR_HOME_ADDRESS_POSTAL_CODE_A,
3466 ! PR_HOME_ADDRESS_COUNTRY_A,
3467 ! PR_BUSINESS_ADDRESS_CITY_A,
3468 ! PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_A,
3469 ! PR_BUSINESS_ADDRESS_POSTAL_CODE_A,
3470 ! PR_BUSINESS_ADDRESS_COUNTRY_A,
3471 ! PR_TITLE_A,
3472 ! PR_DEPARTMENT_NAME_A,
3473 ! PR_COMPANY_NAME_A,
3474 ! PR_BUSINESS_HOME_PAGE_A,
3475 ! PR_PERSONAL_HOME_PAGE_A,
3476 ! PR_COMMENT_A
3480 nsresult nsAbOutlookCard::Init(const char *aUri)
3482 nsresult retCode = nsRDFResource::Init(aUri) ;
3483 ***************
3484 *** 176,181 ****
3485 --- 179,185 ----
3486 SetDisplayName(unichars [index_DisplayName]->get()) ;
3487 SetNickName(unichars [index_NickName]->get()) ;
3488 SetPrimaryEmail(unichars [index_EmailAddress]->get()) ;
3489 + SetSecondEmail(unichars [index_SecondEmailAddress]->get()) ;
3490 SetWorkPhone(unichars [index_WorkPhoneNumber]->get()) ;
3491 SetHomePhone(unichars [index_HomePhoneNumber]->get()) ;
3492 SetFaxNumber(unichars [index_WorkFaxNumber]->get()) ;
3493 ***************
3494 *** 210,221 ****
3495 nsAutoString unichar ;
3496 nsAutoString unicharBis ;
3498 ! if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_W, unichar)) {
3499 splitString(unichar, unicharBis) ;
3500 SetHomeAddress(unichar.get()) ;
3501 SetHomeAddress2(unicharBis.get()) ;
3503 ! if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_W, unichar)) {
3504 splitString(unichar, unicharBis) ;
3505 SetWorkAddress(unichar.get()) ;
3506 SetWorkAddress2(unicharBis.get()) ;
3507 --- 214,225 ----
3508 nsAutoString unichar ;
3509 nsAutoString unicharBis ;
3511 ! if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_A, unichar)) {
3512 splitString(unichar, unicharBis) ;
3513 SetHomeAddress(unichar.get()) ;
3514 SetHomeAddress2(unicharBis.get()) ;
3516 ! if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_A, unichar)) {
3517 splitString(unichar, unicharBis) ;
3518 SetWorkAddress(unichar.get()) ;
3519 SetWorkAddress2(unicharBis.get()) ;
3520 ***************
3521 *** 297,302 ****
3522 --- 301,307 ----
3523 SetDisplayName(properties [index_DisplayName]) ;
3524 GetNickName(getter_Copies(properties [index_NickName])) ;
3525 GetPrimaryEmail(getter_Copies(properties [index_EmailAddress])) ;
3526 + GetSecondEmail(getter_Copies(properties [index_SecondEmailAddress])) ;
3527 GetWorkPhone(getter_Copies(properties [index_WorkPhoneNumber])) ;
3528 GetHomePhone(getter_Copies(properties [index_HomePhoneNumber])) ;
3529 GetFaxNumber(getter_Copies(properties [index_WorkFaxNumber])) ;
3530 ***************
3531 *** 316,324 ****
3532 GetWebPage1(getter_Copies(properties [index_WorkWebPage])) ;
3533 GetWebPage2(getter_Copies(properties [index_HomeWebPage])) ;
3534 GetNotes(getter_Copies(properties [index_Comments])) ;
3535 ! if (!mapiAddBook->SetPropertiesUString(*mMapiData, OutlookCardMAPIProps,
3536 ! index_LastProp, properties)) {
3537 ! PRINTF(("Cannot set general properties.\n")) ;
3539 delete [] properties ;
3540 nsXPIDLString unichar ;
3541 --- 321,336 ----
3542 GetWebPage1(getter_Copies(properties [index_WorkWebPage])) ;
3543 GetWebPage2(getter_Copies(properties [index_HomeWebPage])) ;
3544 GetNotes(getter_Copies(properties [index_Comments])) ;
3546 ! int i=0;
3547 ! for (i=0;i<index_LastProp;i++)
3549 ! if (!mapiAddBook->SetPropertyUString(*mMapiData,
3550 ! OutlookCardMAPIProps[i],
3551 ! properties[i]))
3553 ! PRINTF(("Cannot set properties:%d.\n",OutlookCardMAPIProps[i])) ;
3556 delete [] properties ;
3557 nsXPIDLString unichar ;
3558 *** misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp Tue Feb 25 22:36:33 2003
3559 --- misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp Tue Jan 15 13:34:34 2008
3560 ***************
3561 *** 124,131 ****
3562 nsCAutoString uri ;
3563 nsCOMPtr<nsIRDFResource> resource ;
3565 ! for (ULONG i = 0 ; i < folders.mNbEntries ; ++ i) {
3566 ! folders.mEntries [i].ToString(entryId) ;
3567 buildAbWinUri(kOutlookDirectoryScheme, abType, uri) ;
3568 uri.Append(entryId) ;
3570 --- 124,131 ----
3571 nsCAutoString uri ;
3572 nsCOMPtr<nsIRDFResource> resource ;
3574 ! for (ULONG i = 0 ; i < folders.GetSize() ; ++ i) {
3575 ! folders[i].ToString(entryId) ;
3576 buildAbWinUri(kOutlookDirectoryScheme, abType, uri) ;
3577 uri.Append(entryId) ;
3579 *** misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp Thu Feb 5 19:33:06 2004
3580 --- misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp Tue Jan 15 13:34:34 2008
3581 ***************
3582 *** 126,132 ****
3583 PRINTF(("Cannot get type.\n")) ;
3584 return NS_ERROR_FAILURE ;
3586 ! if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, unichars)) {
3587 PRINTF(("Cannot get name.\n")) ;
3588 return NS_ERROR_FAILURE ;
3590 --- 126,132 ----
3591 PRINTF(("Cannot get type.\n")) ;
3592 return NS_ERROR_FAILURE ;
3594 ! if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, unichars)) {
3595 PRINTF(("Cannot get name.\n")) ;
3596 return NS_ERROR_FAILURE ;
3598 ***************
3599 *** 163,207 ****
3600 return retCode;
3603 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
3605 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3606 *aCards = nsnull ;
3607 nsCOMPtr<nsISupportsArray> cardList ;
3608 nsresult retCode ;
3610 - mCardList.Reset() ;
3611 if (mIsQueryURI) {
3612 retCode = StartSearch() ;
3613 - NS_NewISupportsArray(getter_AddRefs(cardList)) ;
3615 else {
3616 ! retCode = GetChildCards(getter_AddRefs(cardList), nsnull) ;
3618 if (NS_SUCCEEDED(retCode)) {
3619 // Fill the results array and update the card list
3620 // Also update the address list and notify any changes.
3621 PRUint32 nbCards = 0 ;
3622 ! nsCOMPtr<nsISupports> element ;
3624 - cardList->Enumerate(aCards) ;
3625 - cardList->Count(&nbCards) ;
3626 for (PRUint32 i = 0 ; i < nbCards ; ++ i) {
3627 ! cardList->GetElementAt(i, getter_AddRefs(element)) ;
3628 ! nsVoidKey newKey (NS_STATIC_CAST(void *, element)) ;
3629 ! nsCOMPtr<nsISupports> oldElement = mCardList.Get(&newKey) ;
3631 ! if (!oldElement) {
3632 // We are dealing with a new element (probably directly
3633 // added from Outlook), we may need to sync m_AddressList
3634 ! mCardList.Put(&newKey, element) ;
3635 ! nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
3637 NS_ENSURE_SUCCESS(retCode, retCode) ;
3638 PRBool isMailList = PR_FALSE ;
3640 retCode = card->GetIsMailList(&isMailList) ;
3641 NS_ENSURE_SUCCESS(retCode, retCode) ;
3642 if (isMailList) {
3643 // We can have mailing lists only in folder,
3644 // we must add the directory to m_AddressList
3645 --- 163,247 ----
3646 return retCode;
3649 + nsresult nsAbOutlookDirectory::BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
3650 + PRBool aSearchForOld, PRBool& aIsNewCard)
3651 + {
3652 + nsresult retCode = NS_OK ;
3653 + if (aSearchForOld) {
3654 + nsCStringKey key(uriName) ;
3655 + nsCOMPtr<nsISupports> existingCard = mCardList.Get(&key) ;
3657 + if (existingCard) {
3658 + nsCOMPtr<nsIAbCard> card(do_QueryInterface(existingCard, &retCode)) ;
3660 + NS_ENSURE_SUCCESS(retCode, retCode) ;
3661 + NS_IF_ADDREF(*aNewCard = card) ;
3662 + aIsNewCard = PR_FALSE ;
3663 + return retCode ;
3666 + aIsNewCard = PR_TRUE ;
3667 + nsCOMPtr<nsIRDFResource> resource ;
3669 + nsCOMPtr<nsIAbCard> childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
3670 + NS_ENSURE_SUCCESS(retCode, retCode) ;
3671 + resource = do_QueryInterface(childCard, &retCode) ;
3672 + NS_ENSURE_SUCCESS(retCode, retCode) ;
3673 + retCode = resource->Init(uriName.get()) ;
3674 + NS_ENSURE_SUCCESS(retCode, retCode) ;
3675 + NS_IF_ADDREF(*aNewCard = childCard);
3676 + return retCode ;
3679 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
3681 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3682 *aCards = nsnull ;
3683 nsCOMPtr<nsISupportsArray> cardList ;
3684 + nsCStringArray uriList ;
3685 + nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
3686 nsresult retCode ;
3688 if (mIsQueryURI) {
3689 retCode = StartSearch() ;
3691 else {
3692 ! retCode = GetChildCards(uriList, nsnull) ;
3694 + NS_NewISupportsArray(getter_AddRefs(cardList)) ;
3695 if (NS_SUCCEEDED(retCode)) {
3696 // Fill the results array and update the card list
3697 // Also update the address list and notify any changes.
3698 PRUint32 nbCards = 0 ;
3699 ! nsCAutoString uriName;
3700 ! nsCOMPtr <nsIAbCard> childCard;
3701 ! PRBool searchForOldCards = 0; //(mCardList.Count() != 0) ;
3703 ! nbCards = uriList.Count();
3704 ! NS_NewISupportsArray(getter_AddRefs(m_AddressList));
3706 for (PRUint32 i = 0 ; i < nbCards ; ++ i) {
3707 ! PRBool isNewCard = PR_FALSE ;
3709 ! uriList.CStringAt(i,uriName);
3710 ! retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), searchForOldCards, isNewCard);
3711 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3712 ! cardList->AppendElement(childCard);
3714 ! if (isNewCard) {
3715 // We are dealing with a new element (probably directly
3716 // added from Outlook), we may need to sync m_AddressList
3717 ! nsCStringKey newKey(uriName) ;
3719 ! mCardList.Put(&newKey, childCard) ;
3720 ! nsCOMPtr<nsIAbCard> card (do_QueryInterface(childCard, &retCode)) ;
3722 NS_ENSURE_SUCCESS(retCode, retCode) ;
3723 PRBool isMailList = PR_FALSE ;
3725 retCode = card->GetIsMailList(&isMailList) ;
3726 NS_ENSURE_SUCCESS(retCode, retCode) ;
3728 if (isMailList) {
3729 // We can have mailing lists only in folder,
3730 // we must add the directory to m_AddressList
3731 ***************
3732 *** 224,241 ****
3733 NotifyItemAddition(card) ;
3736 - else {
3737 - NS_ASSERTION(oldElement == element, "Different card stored") ;
3741 return retCode ;
3744 NS_IMETHODIMP nsAbOutlookDirectory::HasCard(nsIAbCard *aCard, PRBool *aHasCard)
3746 if (!aCard || !aHasCard) { return NS_ERROR_NULL_POINTER ; }
3747 ! nsVoidKey key (NS_STATIC_CAST(void *, aCard)) ;
3749 *aHasCard = mCardList.Exists(&key) ;
3750 return NS_OK ;
3751 --- 264,296 ----
3752 NotifyItemAddition(card) ;
3757 + return cardList->Enumerate(aCards) ;
3760 + static nsresult ExtractUriFromCard(nsIAbCard *aCard, nsCString& aUri) {
3761 + nsresult retCode = NS_OK ;
3762 + nsCOMPtr<nsIRDFResource> resource (do_QueryInterface(aCard, &retCode)) ;
3764 + // Receiving a non-RDF card is accepted
3765 + if (NS_FAILED(retCode)) { return NS_OK ; }
3766 + nsXPIDLCString uri ;
3768 + retCode = resource->GetValue(getter_Copies(uri)) ;
3769 + NS_ENSURE_SUCCESS(retCode, retCode) ;
3770 + aUri = uri.get() ;
3771 return retCode ;
3774 NS_IMETHODIMP nsAbOutlookDirectory::HasCard(nsIAbCard *aCard, PRBool *aHasCard)
3776 if (!aCard || !aHasCard) { return NS_ERROR_NULL_POINTER ; }
3777 ! *aHasCard = PR_FALSE ;
3778 ! nsCString uri ;
3780 ! ExtractUriFromCard(aCard, uri) ;
3781 ! nsCStringKey key(uri) ;
3783 *aHasCard = mCardList.Exists(&key) ;
3784 return NS_OK ;
3785 ***************
3786 *** 317,323 ****
3787 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
3789 else {
3790 ! nsVoidKey key (NS_STATIC_CAST(void *, element)) ;
3792 mCardList.Remove(&key) ;
3793 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
3794 --- 372,381 ----
3795 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
3797 else {
3798 ! nsCString uri ;
3800 ! ExtractUriFromCard(card, uri) ;
3801 ! nsCStringKey key(uri) ;
3803 mCardList.Remove(&key) ;
3804 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
3805 ***************
3806 *** 386,392 ****
3808 retCode = CreateCard(aData, addedCard) ;
3809 NS_ENSURE_SUCCESS(retCode, retCode) ;
3810 ! nsVoidKey newKey (NS_STATIC_CAST(void *, *addedCard)) ;
3812 mCardList.Put(&newKey, *addedCard) ;
3813 if (m_IsMailList) { m_AddressList->AppendElement(*addedCard) ; }
3814 --- 444,453 ----
3816 retCode = CreateCard(aData, addedCard) ;
3817 NS_ENSURE_SUCCESS(retCode, retCode) ;
3818 ! nsCString uri ;
3820 ! ExtractUriFromCard(*addedCard, uri) ;
3821 ! nsCStringKey newKey(uri) ;
3823 mCardList.Put(&newKey, *addedCard) ;
3824 if (m_IsMailList) { m_AddressList->AppendElement(*addedCard) ; }
3825 ***************
3826 *** 457,463 ****
3827 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
3828 retCode = GetDirName(getter_Copies(name)) ;
3829 NS_ENSURE_SUCCESS(retCode, retCode) ;
3830 ! if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, name.get())) {
3831 return NS_ERROR_FAILURE ;
3833 retCode = CommitAddressList() ;
3834 --- 518,524 ----
3835 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
3836 retCode = GetDirName(getter_Copies(name)) ;
3837 NS_ENSURE_SUCCESS(retCode, retCode) ;
3838 ! if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, name.get())) {
3839 return NS_ERROR_FAILURE ;
3841 retCode = CommitAddressList() ;
3842 ***************
3843 *** 518,523 ****
3844 --- 579,585 ----
3845 {"DisplayName", PR_DISPLAY_NAME_A},
3846 {"NickName", PR_NICKNAME_A},
3847 {"PrimaryEmail", PR_EMAIL_ADDRESS_A},
3848 + {"SecondEmail",PR_SECOND_EMAIL_ADDRESS_A},
3849 {"WorkPhone", PR_BUSINESS_TELEPHONE_NUMBER_A},
3850 {"HomePhone", PR_HOME_TELEPHONE_NUMBER_A},
3851 {"FaxNumber", PR_BUSINESS_FAX_NUMBER_A},
3852 ***************
3853 *** 1032,1038 ****
3855 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
3857 ! nsVoidKey newKey (NS_STATIC_CAST(void *, aCard)) ;
3858 nsresult retCode = NS_OK ;
3860 mCardList.Put(&newKey, aCard) ;
3861 --- 1094,1103 ----
3863 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
3865 ! nsCString uri ;
3867 ! ExtractUriFromCard(aCard, uri) ;
3868 ! nsCStringKey newKey(uri) ;
3869 nsresult retCode = NS_OK ;
3871 mCardList.Put(&newKey, aCard) ;
3872 ***************
3873 *** 1056,1069 ****
3874 retCode = BuildRestriction(aArguments, arguments) ;
3875 NS_ENSURE_SUCCESS(retCode, retCode) ;
3876 nsCOMPtr<nsISupportsArray> resultsArray ;
3877 PRUint32 nbResults = 0 ;
3879 ! retCode = GetChildCards(getter_AddRefs(resultsArray),
3880 arguments.rt == RES_COMMENT ? nsnull : &arguments) ;
3881 DestroyRestriction(arguments) ;
3882 NS_ENSURE_SUCCESS(retCode, retCode) ;
3883 ! retCode = resultsArray->Count(&nbResults) ;
3884 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3885 nsCOMPtr<nsIAbDirectoryQueryResult> result ;
3886 nsAbDirectoryQueryResult *newResult = nsnull ;
3888 --- 1121,1134 ----
3889 retCode = BuildRestriction(aArguments, arguments) ;
3890 NS_ENSURE_SUCCESS(retCode, retCode) ;
3891 nsCOMPtr<nsISupportsArray> resultsArray ;
3892 + nsCStringArray uriArray ;
3893 PRUint32 nbResults = 0 ;
3895 ! retCode = GetChildCards(uriArray,
3896 arguments.rt == RES_COMMENT ? nsnull : &arguments) ;
3897 DestroyRestriction(arguments) ;
3898 NS_ENSURE_SUCCESS(retCode, retCode) ;
3899 ! nbResults = uriArray.Count() ;
3900 nsCOMPtr<nsIAbDirectoryQueryResult> result ;
3901 nsAbDirectoryQueryResult *newResult = nsnull ;
3903 ***************
3904 *** 1071,1085 ****
3905 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
3907 PRUint32 i = 0 ;
3908 - nsCOMPtr<nsISupports> element ;
3909 nsCOMPtr<nsISupportsArray> propertyValues ;
3911 for (i = 0 ; i < nbResults ; ++ i) {
3912 ! retCode = resultsArray->GetElementAt(i, getter_AddRefs(element)) ;
3913 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3914 ! nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
3916 NS_ENSURE_SUCCESS(retCode, retCode) ;
3917 FillPropertyValues(card, aArguments, getter_AddRefs(propertyValues)) ;
3918 newResult = new nsAbDirectoryQueryResult(0, aArguments,
3919 nsIAbDirectoryQueryResult::queryResultMatch,
3920 --- 1136,1153 ----
3921 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
3923 PRUint32 i = 0 ;
3924 nsCOMPtr<nsISupportsArray> propertyValues ;
3926 + nsCAutoString uriName;
3927 + nsCOMPtr <nsIAbCard> card;
3929 for (i = 0 ; i < nbResults ; ++ i) {
3930 ! PRBool isNewCard = PR_FALSE ;
3932 + uriArray.CStringAt(i,uriName);
3933 + retCode = BuildCardFromURI(uriName,getter_AddRefs(card), PR_FALSE, isNewCard);
3934 NS_ENSURE_SUCCESS(retCode, retCode) ;
3936 FillPropertyValues(card, aArguments, getter_AddRefs(propertyValues)) ;
3937 newResult = new nsAbDirectoryQueryResult(0, aArguments,
3938 nsIAbDirectoryQueryResult::queryResultMatch,
3939 ***************
3940 *** 1104,1116 ****
3941 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3942 *aCards = nsnull ;
3943 nsresult retCode = NS_OK ;
3944 ! nsCOMPtr<nsISupportsArray> cards ;
3945 nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
3946 nsMapiEntryArray cardEntries ;
3947 LPSRestriction restriction = (LPSRestriction) aRestriction ;
3949 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
3950 - retCode = NS_NewISupportsArray(getter_AddRefs(cards)) ;
3951 NS_ENSURE_SUCCESS(retCode, retCode) ;
3952 if (!mapiAddBook->GetCards(*mMapiData, restriction, cardEntries)) {
3953 PRINTF(("Cannot get cards.\n")) ;
3954 --- 1172,1214 ----
3955 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3956 *aCards = nsnull ;
3957 nsresult retCode = NS_OK ;
3959 ! nsCOMPtr<nsISupportsArray> cards;
3960 ! retCode = NS_NewISupportsArray(getter_AddRefs(cards));
3961 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3963 ! nsCStringArray uriList;
3964 ! retCode = GetChildCards(uriList,aRestriction);
3965 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3967 ! nsCAutoString uriName;
3968 ! nsCOMPtr <nsIAbCard> childCard;
3969 ! PRUint32 nbURIs = 0 ;
3970 ! nbURIs = uriList.Count();
3971 ! PRUint32 i = 0 ;
3973 ! for (i = 0 ; i < nbURIs ; ++ i) {
3974 ! PRBool isNewCard = PR_FALSE ;
3976 ! uriList.CStringAt(i,uriName);
3977 ! retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), PR_TRUE, isNewCard);
3978 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
3979 ! cards->AppendElement(childCard);
3980 ! }
3982 ! NS_IF_ADDREF(*aCards = cards);
3983 ! return retCode ;
3986 ! nsresult nsAbOutlookDirectory::GetChildCards(nsCStringArray& aURI,
3987 ! void *aRestriction)
3989 ! nsresult retCode = NS_OK ;
3990 nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
3991 nsMapiEntryArray cardEntries ;
3992 LPSRestriction restriction = (LPSRestriction) aRestriction ;
3994 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
3995 NS_ENSURE_SUCCESS(retCode, retCode) ;
3996 if (!mapiAddBook->GetCards(*mMapiData, restriction, cardEntries)) {
3997 PRINTF(("Cannot get cards.\n")) ;
3998 ***************
3999 *** 1119,1140 ****
4000 nsCAutoString entryId ;
4001 nsCAutoString uriName ;
4002 nsCOMPtr<nsIRDFResource> resource ;
4003 ! nsCOMPtr <nsIAbCard> childCard;
4005 ! for (ULONG card = 0 ; card < cardEntries.mNbEntries ; ++ card) {
4006 ! cardEntries.mEntries [card].ToString(entryId) ;
4007 buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName) ;
4008 uriName.Append(entryId) ;
4009 ! childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
4010 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
4011 ! resource = do_QueryInterface(childCard, &retCode) ;
4012 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
4013 ! retCode = resource->Init(uriName.get()) ;
4014 ! NS_ENSURE_SUCCESS(retCode, retCode) ;
4015 ! cards->AppendElement(childCard) ;
4017 - *aCards = cards ;
4018 - NS_ADDREF(*aCards) ;
4019 return retCode ;
4022 --- 1217,1230 ----
4023 nsCAutoString entryId ;
4024 nsCAutoString uriName ;
4025 nsCOMPtr<nsIRDFResource> resource ;
4026 ! aURI.Clear();
4028 ! for (ULONG card = 0 ; card < cardEntries.GetSize() ; ++ card) {
4029 ! cardEntries [card].ToString(entryId) ;
4030 buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName) ;
4031 uriName.Append(entryId) ;
4032 ! aURI.AppendCString(uriName);
4034 return retCode ;
4037 ***************
4038 *** 1158,1165 ****
4039 nsCAutoString uriName ;
4040 nsCOMPtr <nsIRDFResource> resource ;
4042 ! for (ULONG node = 0 ; node < nodeEntries.mNbEntries ; ++ node) {
4043 ! nodeEntries.mEntries [node].ToString(entryId) ;
4044 buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uriName) ;
4045 uriName.Append(entryId) ;
4046 retCode = gRDFService->GetResource(uriName, getter_AddRefs(resource)) ;
4047 --- 1248,1255 ----
4048 nsCAutoString uriName ;
4049 nsCOMPtr <nsIRDFResource> resource ;
4051 ! for (ULONG node = 0 ; node < nodeEntries.GetSize() ; ++ node) {
4052 ! nodeEntries [node].ToString(entryId) ;
4053 buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uriName) ;
4054 uriName.Append(entryId) ;
4055 retCode = gRDFService->GetResource(uriName, getter_AddRefs(resource)) ;
4056 ***************
4057 *** 1280,1286 ****
4058 // In the case of a mailing list, we cannot directly create a new card,
4059 // we have to create a temporary one in a real folder (to be able to use
4060 // templates) and then copy it to the mailing list.
4061 ! if (m_IsMailList) {
4062 nsMapiEntry parentEntry ;
4063 nsMapiEntry temporaryEntry ;
4065 --- 1370,1376 ----
4066 // In the case of a mailing list, we cannot directly create a new card,
4067 // we have to create a temporary one in a real folder (to be able to use
4068 // templates) and then copy it to the mailing list.
4069 ! if (m_IsMailList && mAbWinType == nsAbWinType_OutlookExp) {
4070 nsMapiEntry parentEntry ;
4071 nsMapiEntry temporaryEntry ;
4073 *** misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h Thu Feb 5 19:33:06 2004
4074 --- misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h Tue Jan 15 13:34:34 2008
4075 ***************
4076 *** 46,51 ****
4077 --- 46,52 ----
4078 #include "nsHashtable.h"
4080 #include "nsISupportsArray.h"
4081 + #include "nsVoidArray.h"
4083 struct nsMapiEntry ;
4085 ***************
4086 *** 92,97 ****
4087 --- 93,100 ----
4088 protected:
4089 // Retrieve hierarchy as cards, with an optional restriction
4090 nsresult GetChildCards(nsISupportsArray **aCards, void *aRestriction) ;
4091 + // Retrieve hierarchy as URIs, with an optional restriction
4092 + nsresult GetChildCards(nsCStringArray& aURI, void *aRestriction) ;
4093 // Retrieve hierarchy as directories
4094 nsresult GetChildNodes(nsISupportsArray **aNodes) ;
4095 // Create a new card
4096 ***************
4097 *** 103,108 ****
4098 --- 106,114 ----
4099 nsresult CommitAddressList(void) ;
4100 // Read MAPI repository
4101 nsresult UpdateAddressList(void) ;
4102 + // Search for an existing card or build a new one
4103 + nsresult BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
4104 + PRBool aSearchForOld, PRBool& aIsNewCard) ;
4106 nsMapiEntry *mMapiData ;
4107 // Container for the query threads
4108 *** misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp Wed Apr 14 22:16:12 2004
4109 --- misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp Tue Jan 15 13:34:34 2008
4110 ***************
4111 *** 41,46 ****
4112 --- 41,49 ----
4113 #define USES_IID_IABContainer
4114 #define USES_IID_IMAPITable
4115 #define USES_IID_IDistList
4116 + #define USES_IID_IMsgStore
4117 + #define USES_IID_IMessage
4118 + #define USES_IID_IMAPIFolder
4120 #include "nsAbWinHelper.h"
4121 #include "nsAbUtils.h"
4122 ***************
4123 *** 59,77 ****
4125 #define PRINTF(args) PR_LOG(gAbWinHelperLog, PR_LOG_DEBUG, args)
4127 - // Small utility to ensure release of all MAPI interfaces
4128 - template <class tInterface> struct nsMapiInterfaceWrapper
4130 - tInterface mInterface ;
4132 - nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
4133 - ~nsMapiInterfaceWrapper(void) {
4134 - if (mInterface != NULL) { mInterface->Release() ; }
4136 - operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
4137 - tInterface operator -> (void) const { return mInterface ; }
4138 - operator tInterface *(void) { return &mInterface ; }
4139 - } ;
4141 static void assignEntryID(LPENTRYID& aTarget, LPENTRYID aSource, ULONG aByteCount)
4143 --- 62,67 ----
4144 ***************
4145 *** 249,272 ****
4146 MOZ_DECL_CTOR_COUNTER(nsMapiEntryArray)
4148 nsMapiEntryArray::nsMapiEntryArray(void)
4149 - : mEntries(NULL), mNbEntries(0)
4151 MOZ_COUNT_CTOR(nsMapiEntryArray) ;
4154 nsMapiEntryArray::~nsMapiEntryArray(void)
4156 ! if (mEntries) { delete [] mEntries ; }
4157 MOZ_COUNT_DTOR(nsMapiEntryArray) ;
4160 void nsMapiEntryArray::CleanUp(void)
4162 ! if (mEntries != NULL) {
4163 ! delete [] mEntries ;
4164 ! mEntries = NULL ;
4165 ! mNbEntries = 0 ;
4169 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
4170 --- 239,266 ----
4171 MOZ_DECL_CTOR_COUNTER(nsMapiEntryArray)
4173 nsMapiEntryArray::nsMapiEntryArray(void)
4175 MOZ_COUNT_CTOR(nsMapiEntryArray) ;
4178 nsMapiEntryArray::~nsMapiEntryArray(void)
4180 ! CleanUp();
4181 MOZ_COUNT_DTOR(nsMapiEntryArray) ;
4183 ! void nsMapiEntryArray::AddItem(nsMapiEntry * aEntries)
4185 ! m_array.AppendElement(aEntries);
4187 void nsMapiEntryArray::CleanUp(void)
4189 ! nsMapiEntry *pEntries;
4190 ! for (int i = 0; i < m_array.Count(); i++)
4192 ! pEntries = (nsMapiEntry *)m_array.ElementAt( i);
4193 ! delete pEntries;
4195 + m_array.Clear();
4198 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
4199 ***************
4200 *** 280,379 ****
4201 // same protection (MAPI is supposed to be thread-safe).
4202 PRLock *nsAbWinHelper::mMutex = PR_NewLock() ;
4204 nsAbWinHelper::nsAbWinHelper(void)
4205 ! : mAddressBook(NULL), mLastError(S_OK)
4207 MOZ_COUNT_CTOR(nsAbWinHelper) ;
4210 nsAbWinHelper::~nsAbWinHelper(void)
4212 MOZ_COUNT_DTOR(nsAbWinHelper) ;
4215 ! BOOL nsAbWinHelper::GetFolders(nsMapiEntryArray& aFolders)
4217 ! aFolders.CleanUp() ;
4218 ! nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
4219 ! nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
4220 ! ULONG objType = 0 ;
4221 ! ULONG rowCount = 0 ;
4222 ! SRestriction restriction ;
4223 ! SPropTagArray folderColumns ;
4225 ! mLastError = mAddressBook->OpenEntry(0, NULL, NULL, 0, &objType,
4226 ! rootFolder) ;
4227 ! if (HR_FAILED(mLastError)) {
4228 ! PRINTF(("Cannot open root %08x.\n", mLastError)) ;
4229 ! return FALSE ;
4231 - mLastError = rootFolder->GetHierarchyTable(0, folders) ;
4232 - if (HR_FAILED(mLastError)) {
4233 - PRINTF(("Cannot get hierarchy %08x.\n", mLastError)) ;
4234 - return FALSE ;
4236 ! // We only take into account modifiable containers,
4237 ! // otherwise, we end up with all the directory services...
4238 ! restriction.rt = RES_BITMASK ;
4239 ! restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
4240 ! restriction.res.resBitMask.relBMR = BMR_NEZ ;
4241 ! restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
4242 ! mLastError = folders->Restrict(&restriction, 0) ;
4243 ! if (HR_FAILED(mLastError)) {
4244 ! PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
4246 ! folderColumns.cValues = 1 ;
4247 ! folderColumns.aulPropTag [0] = PR_ENTRYID ;
4248 ! mLastError = folders->SetColumns(&folderColumns, 0) ;
4249 ! if (HR_FAILED(mLastError)) {
4250 ! PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
4251 ! return FALSE ;
4253 ! mLastError = folders->GetRowCount(0, &rowCount) ;
4254 ! if (HR_SUCCEEDED(mLastError)) {
4255 ! aFolders.mEntries = new nsMapiEntry [rowCount] ;
4256 ! aFolders.mNbEntries = 0 ;
4257 ! do {
4258 ! LPSRowSet rowSet = NULL ;
4260 ! rowCount = 0 ;
4261 ! mLastError = folders->QueryRows(1, 0, &rowSet) ;
4262 ! if (HR_SUCCEEDED(mLastError)) {
4263 ! rowCount = rowSet->cRows ;
4264 ! if (rowCount > 0) {
4265 ! nsMapiEntry& current = aFolders.mEntries [aFolders.mNbEntries ++] ;
4266 ! SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
4268 ! current.Assign(currentValue.Value.bin.cb,
4269 ! NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4271 ! MyFreeProws(rowSet) ;
4273 ! else {
4274 ! PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
4276 ! } while (rowCount > 0) ;
4278 ! return HR_SUCCEEDED(mLastError) ;
4281 BOOL nsAbWinHelper::GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4282 nsMapiEntryArray& aCards)
4284 aCards.CleanUp() ;
4285 ! return GetContents(aParent, aRestriction, &aCards.mEntries, aCards.mNbEntries, 0) ;
4288 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
4290 aNodes.CleanUp() ;
4291 ! return GetContents(aParent, NULL, &aNodes.mEntries, aNodes.mNbEntries, MAPI_DISTLIST) ;
4294 BOOL nsAbWinHelper::GetCardsCount(const nsMapiEntry& aParent, ULONG& aNbCards)
4296 ! aNbCards = 0 ;
4297 ! return GetContents(aParent, NULL, NULL, aNbCards, 0) ;
4300 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
4301 --- 274,328 ----
4302 // same protection (MAPI is supposed to be thread-safe).
4303 PRLock *nsAbWinHelper::mMutex = PR_NewLock() ;
4305 + int nsAbWinHelper::m_clients = 0;
4307 + PRUnichar * nsAbWinHelper::m_pUniBuff = NULL;
4308 + int nsAbWinHelper::m_uniBuffLen = 0;
4309 + char * nsAbWinHelper::m_pCStrBuff = NULL;
4310 + int nsAbWinHelper::m_cstrBuffLen = 0;
4312 nsAbWinHelper::nsAbWinHelper(void)
4313 ! :mLastError(S_OK)
4315 MOZ_COUNT_CTOR(nsAbWinHelper) ;
4316 + m_clients++;
4319 nsAbWinHelper::~nsAbWinHelper(void)
4321 MOZ_COUNT_DTOR(nsAbWinHelper) ;
4322 ! m_clients--;
4323 ! if (!m_clients)
4325 ! delete [] m_pUniBuff;
4326 ! m_pUniBuff = NULL;
4327 ! m_uniBuffLen = 0;
4328 ! delete [] m_pCStrBuff;
4329 ! m_pCStrBuff = NULL;
4330 ! m_cstrBuffLen = 0;
4335 BOOL nsAbWinHelper::GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4336 nsMapiEntryArray& aCards)
4338 aCards.CleanUp() ;
4339 ! return GetContents(aParent, aRestriction, &aCards, 0) ;
4342 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
4344 aNodes.CleanUp() ;
4345 ! return GetContents(aParent, NULL, &aNodes, MAPI_DISTLIST) ;
4348 BOOL nsAbWinHelper::GetCardsCount(const nsMapiEntry& aParent, ULONG& aNbCards)
4350 ! nsMapiEntryArray aCards;
4351 ! BOOL ret=GetContents(aParent, NULL, &aCards, 0) ;
4352 ! aNbCards=aCards.GetSize();
4353 ! return ret;
4356 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
4357 ***************
4358 *** 390,396 ****
4359 aName = values->Value.lpszA ;
4361 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
4362 ! aName.AssignWithConversion(values->Value.lpszW) ;
4365 FreeBuffer(values) ;
4366 --- 339,345 ----
4367 aName = values->Value.lpszA ;
4369 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
4370 ! UnicodeToCStr(values->Value.lpszW,aName) ;
4373 FreeBuffer(values) ;
4374 ***************
4375 *** 410,416 ****
4376 aName = values->Value.lpszW ;
4378 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
4379 ! aName.AssignWithConversion(values->Value.lpszA) ;
4382 FreeBuffer(values) ;
4383 --- 359,365 ----
4384 aName = values->Value.lpszW ;
4386 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
4387 ! CStrToUnicode(values->Value.lpszA,aName) ;
4390 FreeBuffer(values) ;
4391 ***************
4392 *** 431,446 ****
4393 ULONG i = 0 ;
4395 for (i = 0 ; i < valueCount ; ++ i) {
4396 ! if (PROP_ID(values [i].ulPropTag) == PROP_ID(aPropertyTags [i])) {
4397 if (PROP_TYPE(values [i].ulPropTag) == PT_STRING8) {
4398 nsAutoString temp ;
4400 ! temp.AssignWithConversion (values [i].Value.lpszA) ;
4401 aNames.AppendString(temp) ;
4403 else if (PROP_TYPE(values [i].ulPropTag) == PT_UNICODE) {
4404 aNames.AppendString(nsAutoString (values [i].Value.lpszW)) ;
4406 else {
4407 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
4409 --- 380,401 ----
4410 ULONG i = 0 ;
4412 for (i = 0 ; i < valueCount ; ++ i) {
4413 ! if (PROP_TYPE( values [i].ulPropTag) != PT_ERROR && values [i].Value.l != MAPI_E_NOT_FOUND){
4414 if (PROP_TYPE(values [i].ulPropTag) == PT_STRING8) {
4415 nsAutoString temp ;
4417 ! CStrToUnicode(values [i].Value.lpszA,temp) ;
4418 aNames.AppendString(temp) ;
4420 else if (PROP_TYPE(values [i].ulPropTag) == PT_UNICODE) {
4421 aNames.AppendString(nsAutoString (values [i].Value.lpszW)) ;
4423 + else if (aPropertyTags [i] == PR_EMAIL_ADDRESS_A) {
4424 + nsAutoString temp ;
4426 + CStrToUnicode (values [i].Value.lpszA,temp) ;
4427 + aNames.AppendString(temp) ;
4429 else {
4430 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
4432 ***************
4433 *** 466,472 ****
4434 if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount)) { return FALSE ; }
4435 if (valueCount == 1 && values != NULL && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
4436 SYSTEMTIME readableTime ;
4438 if (FileTimeToSystemTime(&values->Value.ft, &readableTime)) {
4439 aYear = readableTime.wYear ;
4440 aMonth = readableTime.wMonth ;
4441 --- 421,426 ----
4442 ***************
4443 *** 518,524 ****
4444 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
4445 ULONG objType = 0 ;
4447 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4448 &IID_IMAPIContainer, 0, &objType,
4449 container) ;
4450 if (HR_FAILED(mLastError)) {
4451 --- 472,478 ----
4452 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
4453 ULONG objType = 0 ;
4455 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4456 &IID_IMAPIContainer, 0, &objType,
4457 container) ;
4458 if (HR_FAILED(mLastError)) {
4459 ***************
4460 *** 537,543 ****
4461 SBinary entry ;
4462 SBinaryArray entryArray ;
4464 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4465 &IID_IABContainer, MAPI_MODIFY, &objType,
4466 container) ;
4467 if (HR_FAILED(mLastError)) {
4468 --- 491,497 ----
4469 SBinary entry ;
4470 SBinaryArray entryArray ;
4472 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4473 &IID_IABContainer, MAPI_MODIFY, &objType,
4474 container) ;
4475 if (HR_FAILED(mLastError)) {
4476 ***************
4477 *** 567,580 ****
4478 value.Value.lpszW = NS_CONST_CAST(WORD *, aValue) ;
4480 else if (PROP_TYPE(aPropertyTag) == PT_STRING8) {
4481 ! alternativeValue.AssignWithConversion(aValue) ;
4482 value.Value.lpszA = NS_CONST_CAST(char *, alternativeValue.get()) ;
4484 else {
4485 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
4486 return TRUE ;
4488 ! return SetMAPIProperties(aObject, 1, &value) ;
4491 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4492 --- 521,535 ----
4493 value.Value.lpszW = NS_CONST_CAST(WORD *, aValue) ;
4495 else if (PROP_TYPE(aPropertyTag) == PT_STRING8) {
4496 ! UnicodeToCStr(aValue,alternativeValue) ;
4497 value.Value.lpszA = NS_CONST_CAST(char *, alternativeValue.get()) ;
4499 else {
4500 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
4501 return TRUE ;
4503 ! LPSPropValue values=&value;
4504 ! return SetMAPIProperties(aObject, 1, values) ;
4507 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4508 ***************
4509 *** 595,601 ****
4510 values [currentValue ++].Value.lpszW = NS_CONST_CAST(WORD *, aValues [i].get()) ;
4512 else if (PROP_TYPE(aPropertiesTag [i]) == PT_STRING8) {
4513 ! alternativeValue.AssignWithConversion(aValues [i].get()) ;
4514 char *av = nsCRT::strdup(alternativeValue.get()) ;
4515 if (!av) {
4516 retCode = FALSE ;
4517 --- 550,556 ----
4518 values [currentValue ++].Value.lpszW = NS_CONST_CAST(WORD *, aValues [i].get()) ;
4520 else if (PROP_TYPE(aPropertiesTag [i]) == PT_STRING8) {
4521 ! UnicodeToCStr(aValues [i].get(),alternativeValue) ;
4522 char *av = nsCRT::strdup(alternativeValue.get()) ;
4523 if (!av) {
4524 retCode = FALSE ;
4525 ***************
4526 *** 633,639 ****
4527 readableTime.wSecond = 0 ;
4528 readableTime.wMilliseconds = 0 ;
4529 if (SystemTimeToFileTime(&readableTime, &value.Value.ft)) {
4530 ! return SetMAPIProperties(aObject, 1, &value) ;
4532 return TRUE ;
4534 --- 588,595 ----
4535 readableTime.wSecond = 0 ;
4536 readableTime.wMilliseconds = 0 ;
4537 if (SystemTimeToFileTime(&readableTime, &value.Value.ft)) {
4538 ! LPSPropValue values=&value;
4539 ! return SetMAPIProperties(aObject, 1, values) ;
4541 return TRUE ;
4543 ***************
4544 *** 645,651 ****
4545 nsMapiInterfaceWrapper<LPABCONT> container ;
4546 ULONG objType = 0 ;
4548 ! mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4549 &IID_IABContainer, MAPI_MODIFY, &objType,
4550 container) ;
4551 if (HR_FAILED(mLastError)) {
4552 --- 601,607 ----
4553 nsMapiInterfaceWrapper<LPABCONT> container ;
4554 ULONG objType = 0 ;
4556 ! mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4557 &IID_IABContainer, MAPI_MODIFY, &objType,
4558 container) ;
4559 if (HR_FAILED(mLastError)) {
4560 ***************
4561 *** 708,714 ****
4562 nsMapiInterfaceWrapper<LPABCONT> container ;
4563 ULONG objType = 0 ;
4565 ! mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4566 &IID_IABContainer, MAPI_MODIFY, &objType,
4567 container) ;
4568 if (HR_FAILED(mLastError)) {
4569 --- 664,670 ----
4570 nsMapiInterfaceWrapper<LPABCONT> container ;
4571 ULONG objType = 0 ;
4573 ! mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4574 &IID_IABContainer, MAPI_MODIFY, &objType,
4575 container) ;
4576 if (HR_FAILED(mLastError)) {
4577 ***************
4578 *** 773,779 ****
4579 nsMapiInterfaceWrapper<LPABCONT> container ;
4580 ULONG objType = 0 ;
4582 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4583 &IID_IABContainer, MAPI_MODIFY, &objType,
4584 container) ;
4585 if (HR_FAILED(mLastError)) {
4586 --- 729,735 ----
4587 nsMapiInterfaceWrapper<LPABCONT> container ;
4588 ULONG objType = 0 ;
4590 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4591 &IID_IABContainer, MAPI_MODIFY, &objType,
4592 container) ;
4593 if (HR_FAILED(mLastError)) {
4594 ***************
4595 *** 810,1003 ****
4596 return TRUE ;
4599 - BOOL nsAbWinHelper::GetDefaultContainer(nsMapiEntry& aContainer)
4601 - LPENTRYID entryId = NULL ;
4602 - ULONG byteCount = 0 ;
4604 - mLastError = mAddressBook->GetPAB(&byteCount, &entryId) ;
4605 - if (HR_FAILED(mLastError)) {
4606 - PRINTF(("Cannot get PAB %08x.\n", mLastError)) ;
4607 - return FALSE ;
4609 - aContainer.Assign(byteCount, entryId) ;
4610 - FreeBuffer(entryId) ;
4611 - return TRUE ;
4614 - enum
4616 - ContentsColumnEntryId = 0,
4617 - ContentsColumnObjectType,
4618 - ContentsColumnsSize
4619 - } ;
4621 - static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
4623 - ContentsColumnsSize,
4625 - PR_ENTRYID,
4626 - PR_OBJECT_TYPE
4628 - } ;
4630 ! BOOL nsAbWinHelper::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4631 ! nsMapiEntry **aList, ULONG& aNbElements, ULONG aMapiType)
4633 ! if (aList != NULL) { *aList = NULL ; }
4634 ! aNbElements = 0 ;
4635 ! nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
4636 ! nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
4637 ! ULONG objType = 0 ;
4638 ! ULONG rowCount = 0 ;
4640 ! mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4641 ! &IID_IMAPIContainer, 0, &objType,
4642 ! parent) ;
4643 ! if (HR_FAILED(mLastError)) {
4644 ! PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
4645 ! return FALSE ;
4647 ! // Here, flags for WAB and MAPI could be different, so this works
4648 ! // only as long as we don't want to use any flag in GetContentsTable
4649 ! mLastError = parent->GetContentsTable(0, contents) ;
4650 ! if (HR_FAILED(mLastError)) {
4651 ! PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
4652 ! return FALSE ;
4654 ! if (aRestriction != NULL) {
4655 ! mLastError = contents->Restrict(aRestriction, 0) ;
4656 ! if (HR_FAILED(mLastError)) {
4657 ! PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
4658 ! return FALSE ;
4661 ! mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
4662 ! if (HR_FAILED(mLastError)) {
4663 ! PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
4664 ! return FALSE ;
4666 ! mLastError = contents->GetRowCount(0, &rowCount) ;
4667 ! if (HR_FAILED(mLastError)) {
4668 ! PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
4669 ! return FALSE ;
4671 ! if (aList != NULL) { *aList = new nsMapiEntry [rowCount] ; }
4672 ! aNbElements = 0 ;
4673 ! do {
4674 ! LPSRowSet rowSet = NULL ;
4676 ! rowCount = 0 ;
4677 ! mLastError = contents->QueryRows(1, 0, &rowSet) ;
4678 ! if (HR_FAILED(mLastError)) {
4679 ! PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
4680 ! return FALSE ;
4682 ! rowCount = rowSet->cRows ;
4683 ! if (rowCount > 0 &&
4684 ! (aMapiType == 0 ||
4685 ! rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)) {
4686 ! if (aList != NULL) {
4687 ! nsMapiEntry& current = (*aList) [aNbElements] ;
4688 ! SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
4690 ! current.Assign(currentValue.Value.bin.cb,
4691 ! NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4693 ! ++ aNbElements ;
4695 - MyFreeProws(rowSet) ;
4696 - } while (rowCount > 0) ;
4697 - return TRUE ;
4700 ! BOOL nsAbWinHelper::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
4701 ! ULONG aNbProperties, LPSPropValue& aValue,
4702 ! ULONG& aValueCount)
4704 ! nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4705 ! ULONG objType = 0 ;
4706 ! LPSPropTagArray properties = NULL ;
4707 ! ULONG i = 0 ;
4709 ! mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
4710 ! &IID_IMAPIProp, 0, &objType,
4711 ! object) ;
4712 ! if (HR_FAILED(mLastError)) {
4713 ! PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4714 ! return FALSE ;
4716 ! AllocateBuffer(CbNewSPropTagArray(aNbProperties),
4717 ! NS_REINTERPRET_CAST(void **, &properties)) ;
4718 ! properties->cValues = aNbProperties ;
4719 ! for (i = 0 ; i < aNbProperties ; ++ i) {
4720 ! properties->aulPropTag [i] = aPropertyTags [i] ;
4722 ! mLastError = object->GetProps(properties, 0, &aValueCount, &aValue) ;
4723 ! FreeBuffer(properties) ;
4724 ! if (HR_FAILED(mLastError)) {
4725 ! PRINTF(("Cannot get props %08x.\n", mLastError)) ;
4727 - return HR_SUCCEEDED(mLastError) ;
4730 ! BOOL nsAbWinHelper::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
4731 ! const LPSPropValue& aValues)
4733 ! nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4734 ! ULONG objType = 0 ;
4735 ! LPSPropProblemArray problems = NULL ;
4737 ! mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
4738 ! &IID_IMAPIProp, MAPI_MODIFY, &objType,
4739 ! object) ;
4740 ! if (HR_FAILED(mLastError)) {
4741 ! PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4742 ! return FALSE ;
4744 ! mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
4745 ! if (HR_FAILED(mLastError)) {
4746 ! PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
4747 ! return FALSE ;
4749 ! if (problems != NULL) {
4750 ! for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
4751 ! PRINTF(("Problem %d: index %d code %08x.\n", i,
4752 ! problems->aProblem [i].ulIndex,
4753 ! problems->aProblem [i].scode)) ;
4756 ! mLastError = object->SaveChanges(0) ;
4757 ! if (HR_FAILED(mLastError)) {
4758 ! PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
4760 ! return HR_SUCCEEDED(mLastError) ;
4763 ! void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
4765 ! if (aRowset == NULL) { return ; }
4766 ! ULONG i = 0 ;
4768 ! for (i = 0 ; i < aRowset->cRows ; ++ i) {
4769 ! FreeBuffer(aRowset->aRow [i].lpProps) ;
4771 ! FreeBuffer(aRowset) ;
4774 nsAbWinHelperGuard::nsAbWinHelperGuard(PRUint32 aType)
4775 : mHelper(NULL)
4777 switch(aType) {
4778 ! case nsAbWinType_Outlook: mHelper = new nsMapiAddressBook ; break ;
4779 ! case nsAbWinType_OutlookExp: mHelper = new nsWabAddressBook ; break ;
4780 default: break ;
4784 nsAbWinHelperGuard::~nsAbWinHelperGuard(void)
4786 - delete mHelper ;
4789 const char *kOutlookDirectoryScheme = "moz-aboutlookdirectory://" ;
4790 --- 766,842 ----
4791 return TRUE ;
4797 ! void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
4799 ! if (aRowset == NULL) { return ; }
4800 ! ULONG i = 0 ;
4802 ! for (i = 0 ; i < aRowset->cRows ; ++ i) {
4803 ! FreeBuffer(aRowset->aRow [i].lpProps) ;
4805 ! FreeBuffer(aRowset) ;
4807 ! void nsAbWinHelper::CStrToUnicode( const char *pStr, nsString& result)
4809 ! result.Truncate( 0);
4810 ! int wLen = MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
4811 ! if (wLen >= m_uniBuffLen)
4813 ! delete [] m_pUniBuff;
4814 ! m_pUniBuff = new PRUnichar[wLen + 64];
4815 ! m_uniBuffLen = wLen + 64;
4817 ! if (wLen)
4819 ! MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
4820 ! result = m_pUniBuff;
4823 ! void nsAbWinHelper::UnicodeToCStr( const PRUnichar *pUStr,nsCString& result)
4825 ! result.Truncate( 0);
4826 ! int cLen = WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, 0,NULL,NULL);
4827 ! if (cLen >= m_cstrBuffLen) {
4828 ! if (m_pCStrBuff)
4829 ! delete [] m_pCStrBuff;
4830 ! m_pCStrBuff = new char[cLen + 64];
4831 ! m_cstrBuffLen = cLen + 64;
4833 ! if (cLen) {
4834 ! WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, m_cstrBuffLen,NULL,NULL);
4835 ! result = m_pCStrBuff;
4839 ! static nsAbWinHelper *getOutlookAddressBook(void) {
4840 ! static nsMapiAddressBook *addressBook = NULL ;
4842 ! if (addressBook == NULL) { addressBook = new nsMapiAddressBook ; }
4843 ! return addressBook ;
4846 ! static nsAbWinHelper *getOutlookExpAddressBook(void) {
4847 ! static nsWabAddressBook *addressBook = NULL ;
4849 ! if (addressBook == NULL) { addressBook = new nsWabAddressBook ; }
4850 ! return addressBook ;
4853 nsAbWinHelperGuard::nsAbWinHelperGuard(PRUint32 aType)
4854 : mHelper(NULL)
4856 switch(aType) {
4857 ! case nsAbWinType_Outlook: mHelper = getOutlookAddressBook() ; break ;
4858 ! case nsAbWinType_OutlookExp: mHelper = getOutlookExpAddressBook() ; break ;
4859 default: break ;
4863 nsAbWinHelperGuard::~nsAbWinHelperGuard(void)
4867 const char *kOutlookDirectoryScheme = "moz-aboutlookdirectory://" ;
4868 *** misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.h Wed Apr 14 22:16:12 2004
4869 --- misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.h Tue Jan 15 13:34:34 2008
4870 ***************
4871 *** 45,50 ****
4872 --- 45,68 ----
4873 #include "nsVoidArray.h"
4874 #include "nsXPIDLString.h"
4876 + #define PR_SECOND_EMAIL_ADDRESS_A 0x8033001E
4877 + #define PR_SCREEN_NAME_A 0x805B001E
4880 + // Small utility to ensure release of all MAPI interfaces
4881 + template <class tInterface> struct nsMapiInterfaceWrapper
4883 + tInterface mInterface ;
4885 + nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
4886 + ~nsMapiInterfaceWrapper(void) {
4887 + if (mInterface ) { mInterface->Release() ; }
4889 + operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
4890 + tInterface operator -> (void) const { return mInterface ; }
4891 + operator tInterface *(void) { return &mInterface ; }
4892 + } ;
4894 struct nsMapiEntry
4896 ULONG mByteCount ;
4897 ***************
4898 *** 62,75 ****
4900 struct nsMapiEntryArray
4902 - nsMapiEntry *mEntries ;
4903 - ULONG mNbEntries ;
4905 nsMapiEntryArray(void) ;
4906 ~nsMapiEntryArray(void) ;
4908 ! const nsMapiEntry& operator [] (int aIndex) const { return mEntries [aIndex] ; }
4909 void CleanUp(void) ;
4912 class nsAbWinHelper
4913 --- 80,107 ----
4915 struct nsMapiEntryArray
4918 nsMapiEntryArray(void) ;
4919 ~nsMapiEntryArray(void) ;
4921 ! void AddItem(nsMapiEntry * aEntries);
4922 ! void AddItem( ULONG mByteCount , LPENTRYID mEntryId )
4924 ! nsMapiEntry * aEntries=new nsMapiEntry();
4925 ! aEntries->Assign(mByteCount,mEntryId);
4926 ! AddItem(aEntries);
4929 ! ULONG GetSize( void) { return( m_array.Count());}
4930 ! nsMapiEntry& operator [] (int aIndex) { return *(nsMapiEntry*)m_array.ElementAt(aIndex); }
4931 ! nsMapiEntry* ElementAt(int aIndex) { return (nsMapiEntry*)m_array.ElementAt(aIndex); }
4932 void CleanUp(void) ;
4933 + void Remove(nsMapiEntry * aEntries){ m_array.RemoveElement(aEntries); }
4934 + void Remove(int index){ m_array.RemoveElementAt(index); }
4935 + ULONG IndexOf(nsMapiEntry * aEntries){return m_array.IndexOf(aEntries);};
4936 + private:
4937 + nsVoidArray m_array;
4941 class nsAbWinHelper
4942 ***************
4943 *** 79,85 ****
4944 virtual ~nsAbWinHelper(void) ;
4946 // Get the top address books
4947 ! BOOL GetFolders(nsMapiEntryArray& aFolders) ;
4948 // Get a list of entries for cards/mailing lists in a folder/mailing list
4949 BOOL GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4950 nsMapiEntryArray& aCards) ;
4951 --- 111,117 ----
4952 virtual ~nsAbWinHelper(void) ;
4954 // Get the top address books
4955 ! virtual BOOL GetFolders(nsMapiEntryArray& aFolders) =0;
4956 // Get a list of entries for cards/mailing lists in a folder/mailing list
4957 BOOL GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4958 nsMapiEntryArray& aCards) ;
4959 ***************
4960 *** 97,114 ****
4961 BOOL GetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4962 ULONG aNbProperties, nsStringArray& aValues) ;
4963 // Get the value of a MAPI property of type SYSTIME
4964 ! BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
4965 WORD& aYear, WORD& aMonth, WORD& aDay) ;
4966 - // Get the value of a MAPI property of type LONG
4967 - BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
4968 // Get the value of a MAPI property of type BIN
4969 BOOL GetPropertyBin(const nsMapiEntry& aObject, ULONG aPropertyTag, nsMapiEntry& aValue) ;
4970 // Tests if a container contains an entry
4971 BOOL TestOpenEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
4972 - // Delete an entry in the address book
4973 - BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
4974 // Set the value of a MAPI property of type string in unicode
4975 ! BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
4976 const PRUnichar *aValue) ;
4977 // Same as previous, but with a bunch of properties in one call
4978 BOOL SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4979 --- 129,142 ----
4980 BOOL GetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4981 ULONG aNbProperties, nsStringArray& aValues) ;
4982 // Get the value of a MAPI property of type SYSTIME
4983 ! virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
4984 WORD& aYear, WORD& aMonth, WORD& aDay) ;
4985 // Get the value of a MAPI property of type BIN
4986 BOOL GetPropertyBin(const nsMapiEntry& aObject, ULONG aPropertyTag, nsMapiEntry& aValue) ;
4987 // Tests if a container contains an entry
4988 BOOL TestOpenEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
4989 // Set the value of a MAPI property of type string in unicode
4990 ! virtual BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
4991 const PRUnichar *aValue) ;
4992 // Same as previous, but with a bunch of properties in one call
4993 BOOL SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
4994 ***************
4995 *** 117,148 ****
4996 BOOL SetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
4997 WORD aYear, WORD aMonth, WORD aDay) ;
4998 // Create entry in the address book
4999 ! BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5000 // Create a distribution list in the address book
5001 ! BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5002 // Copy an existing entry in the address book
5003 ! BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
5004 // Get a default address book container
5005 ! BOOL GetDefaultContainer(nsMapiEntry& aContainer) ;
5006 // Is the helper correctly initialised?
5007 ! BOOL IsOK(void) const { return mAddressBook != NULL ; }
5009 protected:
5010 HRESULT mLastError ;
5011 - LPADRBOOK mAddressBook ;
5012 static PRUint32 mEntryCounter ;
5013 static PRLock *mMutex ;
5015 // Retrieve the contents of a container, with an optional restriction
5016 ! BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5017 ! nsMapiEntry **aList, ULONG &aNbElements, ULONG aMapiType) ;
5018 // Retrieve the values of a set of properties on a MAPI object
5019 ! BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5020 ULONG aNbProperties,
5021 ! LPSPropValue& aValues, ULONG& aValueCount) ;
5022 // Set the values of a set of properties on a MAPI object
5023 ! BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5024 ! const LPSPropValue& aValues) ;
5025 // Clean-up a rowset returned by QueryRows
5026 void MyFreeProws(LPSRowSet aSet) ;
5027 // Allocation of a buffer for transmission to interfaces
5028 --- 145,188 ----
5029 BOOL SetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
5030 WORD aYear, WORD aMonth, WORD aDay) ;
5031 // Create entry in the address book
5032 ! virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5033 ! // Delete an entry in the address book
5034 ! virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
5035 // Create a distribution list in the address book
5036 ! virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5037 // Copy an existing entry in the address book
5038 ! virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
5039 // Get a default address book container
5040 ! virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer) =0;
5041 // Is the helper correctly initialised?
5042 ! virtual BOOL IsOK(void) =0;/*const { return mAddressBook != NULL ; }*/
5044 ! // Get the value of a MAPI property of type LONG
5045 ! virtual BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
5047 protected:
5048 HRESULT mLastError ;
5049 static PRUint32 mEntryCounter ;
5050 static PRLock *mMutex ;
5052 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5053 + LPENTRYID lpEntryID,
5054 + LPCIID lpInterface,
5055 + ULONG ulFlags,
5056 + ULONG FAR * lpulObjType,
5057 + LPUNKNOWN FAR * lppUnk
5058 + ) = 0;
5060 // Retrieve the contents of a container, with an optional restriction
5061 ! virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5062 ! nsMapiEntryArray *aList, ULONG aMapiType) =0;
5063 // Retrieve the values of a set of properties on a MAPI object
5064 ! virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5065 ULONG aNbProperties,
5066 ! LPSPropValue& aValues, ULONG& aValueCount) =0;
5067 // Set the values of a set of properties on a MAPI object
5068 ! virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5069 ! LPSPropValue& aValues) =0;
5070 // Clean-up a rowset returned by QueryRows
5071 void MyFreeProws(LPSRowSet aSet) ;
5072 // Allocation of a buffer for transmission to interfaces
5073 ***************
5074 *** 150,156 ****
5075 --- 190,205 ----
5076 // Destruction of a buffer provided by the interfaces
5077 virtual void FreeBuffer(LPVOID aBuffer) = 0 ;
5079 + static void CStrToUnicode( const char *pStr, nsString& result);
5080 + static void UnicodeToCStr( const PRUnichar *pStr, nsCString& result);
5082 private:
5083 + static int m_clients;
5084 + static PRUnichar * m_pUniBuff;
5085 + static int m_uniBuffLen;
5086 + static char * m_pCStrBuff;
5087 + static int m_cstrBuffLen;
5091 enum nsAbWinType
5092 ***************
5093 *** 168,173 ****
5094 --- 217,223 ----
5096 nsAbWinHelper *operator ->(void) { return mHelper ; }
5098 + static void FreeWinAbLibrarys();
5099 private:
5100 nsAbWinHelper *mHelper ;
5102 *** misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp Wed Dec 24 18:18:08 2003
5103 --- misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp Tue Jan 15 13:34:34 2008
5104 ***************
5105 *** 97,102 ****
5106 --- 97,105 ----
5108 static const char kMailListAddressFormat[] = "Address%d";
5110 + extern int getMD5sum(const char * fileName,char * sum);
5111 + extern int testMD5sum(const char * fileName,char * sum);
5113 static NS_DEFINE_CID(kCMorkFactory, NS_MORK_CID);
5115 nsAddrDatabase::nsAddrDatabase()
5116 ***************
5117 *** 166,171 ****
5118 --- 169,175 ----
5119 m_LastRecordKey(0),
5120 m_dbDirectory(nsnull)
5122 + memset(m_dbMd5Sum,0,33);
5125 nsAddrDatabase::~nsAddrDatabase()
5126 ***************
5127 *** 720,726 ****
5128 NS_RELEASE(oldFile); // always release our file ref, store has own
5132 nsCRT::free(nativeFileName);
5134 if (NS_SUCCEEDED(ret) && thumb)
5135 --- 724,734 ----
5136 NS_RELEASE(oldFile); // always release our file ref, store has own
5140 ! ret = getMD5sum(nativeFileName,m_dbMd5Sum);
5141 ! if (ret == 1)
5142 ! ret = NS_ERROR_FAILURE;
5144 nsCRT::free(nativeFileName);
5146 if (NS_SUCCEEDED(ret) && thumb)
5147 ***************
5148 *** 817,822 ****
5149 --- 825,841 ----
5150 nsresult err = NS_OK;
5151 nsIMdbThumb *commitThumb = nsnull;
5153 + const char *pFilename = m_dbName.GetCString(); /* do not free */
5154 + char *nativeFileName = nsCRT::strdup(pFilename);
5155 + #if defined(XP_PC) || defined(XP_MAC)
5156 + UnixToNative(nativeFileName);
5157 + #endif
5158 + if (testMD5sum(nativeFileName,m_dbMd5Sum))
5160 + nsCRT::free(nativeFileName);
5161 + return NS_ERROR_FILE_ACCESS_DENIED;
5164 if (commitType == nsAddrDBCommitType::kLargeCommit || commitType == nsAddrDBCommitType::kSessionCommit)
5166 mdb_percent outActualWaste = 0;
5167 ***************
5168 *** 867,872 ****
5169 --- 886,895 ----
5170 // ### do something with error, but clear it now because mork errors out on commits.
5171 if (GetEnv())
5172 GetEnv()->ClearErrors();
5173 + if (NS_SUCCEEDED(err) && getMD5sum(nativeFileName,m_dbMd5Sum))
5174 + err = NS_ERROR_FAILURE;
5175 + nsCRT::free(nativeFileName);
5177 return err;
5180 *** misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.h Wed Jan 28 18:22:13 2004
5181 --- misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.h Tue Jan 15 13:34:34 2008
5182 ***************
5183 *** 396,401 ****
5184 --- 396,402 ----
5185 nsIMdbTable *m_mdbPabTable;
5186 nsIMdbTable *m_mdbDeletedCardsTable;
5187 nsFileSpec m_dbName;
5188 + char m_dbMd5Sum[33];
5189 PRBool m_mdbTokensInitialized;
5190 nsVoidArray /*<nsIAddrDBListener>*/ *m_ChangeListeners;
5192 *** misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp Tue Oct 30 08:59:16 2001
5193 --- misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp Tue Jan 15 13:34:34 2008
5194 ***************
5195 *** 41,46 ****
5196 --- 41,62 ----
5198 #include "prlog.h"
5200 + static char * stristr(const char *big, const char *little)
5202 + PRUint32 len;
5204 + if (!big || !little || !*big || !*little)
5205 + return 0;
5206 + len = strlen(little);
5208 + for( ; *big; big++ )
5209 + if(!_strnicmp (big, little, 1) && ! _strnicmp (big, little, len) )
5210 + return (char *)big;
5212 + return (char *)0;
5216 #ifdef PR_LOGGING
5217 static PRLogModuleInfo* gMapiAddressBookLog
5218 = PR_NewLogModule("nsMapiAddressBookLog");
5219 ***************
5220 *** 48,53 ****
5221 --- 64,123 ----
5223 #define PRINTF(args) PR_LOG(gMapiAddressBookLog, PR_LOG_DEBUG, args)
5225 + #define OUTLOOK_EMAIL_DIAPLAY_MAPI_ID 0x00008005 //use to get and set display
5226 + #define OUTLOOK_EMAIL1_MAPI_ID 0x00008084 //use to get and set primary email address
5227 + #define OUTLOOK_EMAIL2_MAPI_ID 0x00008094 //use to get and set second email address
5228 + #define OUTLOOK_EMAIL_SCREEN_NAME 0x8061001E //use to get and set screen name
5229 + #define OUTLOOK_EMAIL_ORGID 0x00008085 //use to get orginal entryid to add to distlist
5230 + #define OUTLOOK_EMAIL_LIST1 0x00008054 //use to get distlist table
5231 + #define OUTLOOK_EMAIL_LIST2 0x00008055 //use to set distlist table
5233 + static const TagMap TagMaps[]={
5234 + {PR_DISPLAY_NAME_A, OUTLOOK_EMAIL_DIAPLAY_MAPI_ID, PT_STRING8},
5235 + {PR_EMAIL_ADDRESS_A, OUTLOOK_EMAIL1_MAPI_ID, PT_STRING8},
5236 + {PR_SECOND_EMAIL_ADDRESS_A, OUTLOOK_EMAIL2_MAPI_ID, PT_STRING8},
5237 + {PR_SCREEN_NAME_A, OUTLOOK_EMAIL_SCREEN_NAME, PT_STRING8}};
5239 + enum {
5240 + ieidPR_ENTRYID = 0,
5241 + ieidPR_OBJECT_TYPE,
5242 + ieidPR_DISPLAY_NAME,
5243 + ieidPR_MESSAGE_CLASS,
5244 + ieidPR_STORE_ENTRYID,
5245 + ieidPR_MESSAGE_RECIPIENTS,
5246 + ieidMax
5247 + };
5249 + static const SizedSPropTagArray(ieidMax, ptaEid)=
5251 + ieidMax,
5253 + PR_ENTRYID,
5254 + PR_OBJECT_TYPE,
5255 + PR_DISPLAY_NAME,
5256 + PR_MESSAGE_CLASS,
5257 + PR_STORE_ENTRYID,
5258 + PR_MESSAGE_RECIPIENTS
5260 + };
5262 + enum
5264 + ContentsColumnEntryId = 0,
5265 + ContentsColumnObjectType,
5266 + ContentsColumnMessageClass,
5267 + ContentsColumnsSize
5268 + } ;
5270 + static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
5272 + ContentsColumnsSize,
5274 + PR_ENTRYID,
5275 + PR_OBJECT_TYPE,
5276 + PR_MESSAGE_CLASS
5278 + } ;
5280 HMODULE nsMapiAddressBook::mLibrary = NULL ;
5281 PRInt32 nsMapiAddressBook::mLibUsage = 0 ;
5282 ***************
5283 *** 60,66 ****
5284 BOOL nsMapiAddressBook::mInitialized = FALSE ;
5285 BOOL nsMapiAddressBook::mLogonDone = FALSE ;
5286 LPMAPISESSION nsMapiAddressBook::mRootSession = NULL ;
5287 ! LPADRBOOK nsMapiAddressBook::mRootBook = NULL ;
5289 BOOL nsMapiAddressBook::LoadMapiLibrary(void)
5291 --- 130,136 ----
5292 BOOL nsMapiAddressBook::mInitialized = FALSE ;
5293 BOOL nsMapiAddressBook::mLogonDone = FALSE ;
5294 LPMAPISESSION nsMapiAddressBook::mRootSession = NULL ;
5295 ! #define MAPI_NO_COINIT 8
5297 BOOL nsMapiAddressBook::LoadMapiLibrary(void)
5299 ***************
5300 *** 92,98 ****
5301 mMAPILogonEx = NS_REINTERPRET_CAST(LPMAPILOGONEX,
5302 GetProcAddress(mLibrary, "MAPILogonEx")) ;
5303 if (!mMAPILogonEx) { return FALSE ; }
5304 ! MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS } ;
5305 HRESULT retCode = mMAPIInitialize(&mapiInit) ;
5307 if (HR_FAILED(retCode)) {
5308 --- 162,168 ----
5309 mMAPILogonEx = NS_REINTERPRET_CAST(LPMAPILOGONEX,
5310 GetProcAddress(mLibrary, "MAPILogonEx")) ;
5311 if (!mMAPILogonEx) { return FALSE ; }
5312 ! MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS | MAPI_NO_COINIT } ;
5313 HRESULT retCode = mMAPIInitialize(&mapiInit) ;
5315 if (HR_FAILED(retCode)) {
5316 ***************
5317 *** 106,127 ****
5318 MAPI_NEW_SESSION,
5319 &mRootSession) ;
5320 if (HR_FAILED(retCode)) {
5321 ! PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ; return FALSE ;
5323 mLogonDone = TRUE ;
5324 ! retCode = mRootSession->OpenAddressBook(0, NULL, 0, &mRootBook) ;
5325 ! if (HR_FAILED(retCode)) {
5326 ! PRINTF(("Cannot open MAPI address book %08x.\n", retCode)) ;
5328 return HR_SUCCEEDED(retCode) ;
5331 void nsMapiAddressBook::FreeMapiLibrary(void)
5333 if (mLibrary) {
5334 ! if (-- mLibUsage == 0) {
5336 - if (mRootBook) { mRootBook->Release() ; }
5337 if (mRootSession) {
5338 if (mLogonDone) {
5339 mRootSession->Logoff(NULL, 0, 0) ;
5340 --- 176,194 ----
5341 MAPI_NEW_SESSION,
5342 &mRootSession) ;
5343 if (HR_FAILED(retCode)) {
5344 ! PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ;
5345 ! return FALSE ;
5347 mLogonDone = TRUE ;
5349 return HR_SUCCEEDED(retCode) ;
5352 void nsMapiAddressBook::FreeMapiLibrary(void)
5354 if (mLibrary) {
5355 ! if (--mLibUsage < 0) {
5357 if (mRootSession) {
5358 if (mLogonDone) {
5359 mRootSession->Logoff(NULL, 0, 0) ;
5360 ***************
5361 *** 135,140 ****
5362 --- 202,208 ----
5365 FreeLibrary(mLibrary) ;
5366 + mRootSession = NULL;
5367 mLibrary = NULL ;
5370 ***************
5371 *** 146,152 ****
5372 : nsAbWinHelper()
5374 BOOL result = Initialize() ;
5376 NS_ASSERTION(result == TRUE, "Couldn't initialize Mapi Helper") ;
5377 MOZ_COUNT_CTOR(nsMapiAddressBook) ;
5379 --- 214,219 ----
5380 ***************
5381 *** 154,175 ****
5382 nsMapiAddressBook::~nsMapiAddressBook(void)
5384 nsAutoLock guard(mMutex) ;
5386 FreeMapiLibrary() ;
5387 MOZ_COUNT_DTOR(nsMapiAddressBook) ;
5390 BOOL nsMapiAddressBook::Initialize(void)
5392 ! if (mAddressBook) { return TRUE ; }
5393 nsAutoLock guard(mMutex) ;
5395 if (!LoadMapiLibrary()) {
5396 PRINTF(("Cannot load library.\n")) ;
5397 return FALSE ;
5399 ! mAddressBook = mRootBook ;
5400 ! return TRUE ;
5403 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
5404 --- 221,1102 ----
5405 nsMapiAddressBook::~nsMapiAddressBook(void)
5407 nsAutoLock guard(mMutex) ;
5408 ! CleanUpMDB();
5409 FreeMapiLibrary() ;
5410 MOZ_COUNT_DTOR(nsMapiAddressBook) ;
5413 + LPSPropValue nsMapiAddressBook::GetMapiProperty( LPMAPIPROP pProp, ULONG tag)
5415 + if (!pProp)
5416 + return( NULL);
5418 + int sz = CbNewSPropTagArray( 1);
5419 + SPropTagArray *pTag = (SPropTagArray *) new char[sz];
5420 + pTag->cValues = 1;
5421 + pTag->aulPropTag[0] = tag;
5422 + LPSPropValue lpProp = NULL;
5423 + ULONG cValues = 0;
5424 + HRESULT hr = pProp->GetProps( pTag, 0, &cValues, &lpProp);
5425 + delete pTag;
5426 + if (HR_FAILED( hr) || (cValues != 1)) {
5427 + if (lpProp)
5428 + mMAPIFreeBuffer( lpProp);
5429 + return( NULL);
5431 + else {
5432 + if (PROP_TYPE( lpProp->ulPropTag) == PT_ERROR) {
5433 + if (lpProp->Value.l == MAPI_E_NOT_FOUND) {
5434 + mMAPIFreeBuffer( lpProp);
5435 + lpProp = NULL;
5440 + return( lpProp);
5442 + BOOL nsMapiAddressBook::GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal)
5444 + if (!pVal)
5445 + return( FALSE);
5447 + BOOL bResult = TRUE;
5448 + switch (PROP_TYPE(pVal->ulPropTag))
5450 + case PT_BINARY:
5451 + cbEntryId = pVal->Value.bin.cb;
5452 + mMAPIAllocateBuffer( cbEntryId, (LPVOID *) &lpEntryId);
5453 + memcpy( lpEntryId, pVal->Value.bin.lpb, cbEntryId);
5454 + break;
5456 + default:
5457 + PRINTF(( "EntryId not in BINARY prop value\n"));
5458 + bResult = FALSE;
5459 + break;
5462 + if (pVal && delVal)
5463 + mMAPIFreeBuffer( pVal);
5465 + return( bResult);
5468 + BOOL nsMapiAddressBook::HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
5470 + LPMDB lpMsgStore;
5471 + ULONG objType=0;
5472 + HRESULT hr;
5474 + if (oType == MAPI_MESSAGE)
5475 + return FALSE;
5476 + if (oType == MAPI_STORE)
5478 + hr=mRootSession->OpenEntry(
5479 + cb,
5480 + pEntry,
5481 + &IID_IMsgStore,
5482 + MAPI_BEST_ACCESS,
5483 + &objType,
5484 + (IUnknown**)&lpMsgStore);
5485 + if (FAILED(hr))
5486 + return FALSE ;
5487 + //Add MDB to a list to make it can be released when class destroyed.
5488 + //We must leave it openned or else we can't open address store in it.
5489 + AddToMDBArray(lpMsgStore);
5491 + LPSPropValue pVal;
5492 + pVal=GetMapiProperty(lpMsgStore,PR_IPM_SUBTREE_ENTRYID);
5495 + if (pVal) {
5496 + ULONG cbEntry;
5497 + LPENTRYID pEntry;
5498 + nsMapiInterfaceWrapper<LPMAPICONTAINER> lpSubTree;
5500 + if (GetEntryIdFromProp( pVal, cbEntry, pEntry)) {
5501 + // Open up the folder!
5502 + BOOL bResult = TRUE;
5503 + bResult = lpMsgStore->OpenEntry(
5504 + cbEntry,
5505 + pEntry,
5506 + NULL,
5507 + MAPI_BEST_ACCESS,
5508 + &objType,
5509 + lpSubTree);
5510 + mMAPIFreeBuffer( pEntry);
5511 + if (!bResult && *(LPMAPICONTAINER*)&lpSubTree) {
5512 + // Iterate the subtree with the results going into the folder list
5513 + bResult = IterateHierarchy(*(LPMAPICONTAINER*)&lpSubTree,aFolders);
5515 + else {
5516 + PRINTF(( "GetStoreFolders: Error opening sub tree.\n"));
5519 + else {
5520 + PRINTF(( "GetStoreFolders: Error getting entryID from sub tree property val.\n"));
5523 + else {
5524 + PRINTF(( "GetStoreFolders: Error getting sub tree property.\n"));
5527 + else
5529 + PRINTF(("Type:%d\n",oType));
5532 + return TRUE ;
5535 + BOOL nsMapiAddressBook::IterateHierarchy(LPMAPICONTAINER pFolder,nsMapiEntryArray& aFolders, ULONG flags)
5537 + // flags can be CONVENIENT_DEPTH or 0
5538 + // CONVENIENT_DEPTH will return all depths I believe instead
5539 + // of just children
5540 + HRESULT hr;
5541 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
5542 + hr = pFolder->GetHierarchyTable( CONVENIENT_DEPTH , lpTable);
5543 + if (HR_FAILED(hr)) {
5544 + PRINTF(( "IterateHierarchy: GetContentsTable failed: 0x%lx, %d\n", (long)hr, (int)hr));
5545 + return( FALSE);
5548 + ULONG rowCount;
5549 + hr = lpTable->GetRowCount( 0, &rowCount);
5550 + if (!rowCount) {
5551 + return( TRUE);
5554 + hr = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
5555 + if (HR_FAILED(hr)) {
5556 + PRINTF(( "IterateHierarchy: SetColumns failed: 0x%lx, %d\n", (long)hr, (int)hr));
5557 + return( FALSE);
5560 + hr = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
5561 + if (HR_FAILED(hr)) {
5562 + PRINTF(( "IterateHierarchy: SeekRow failed: 0x%lx, %d\n", (long)hr, (int)hr));
5563 + return( FALSE);
5566 + int cNumRows = 0;
5567 + LPSRowSet lpRow;
5568 + BOOL keepGoing = TRUE;
5569 + BOOL bResult = TRUE;
5570 + do {
5572 + lpRow = NULL;
5573 + hr = lpTable->QueryRows( 1, 0, &lpRow);
5575 + if (HR_FAILED(hr))
5577 + PRINTF(( "QueryRows failed: 0x%lx, %d\n", (long)hr, (int)hr));
5578 + bResult = FALSE;
5579 + break;
5582 + if (lpRow){
5583 + cNumRows = lpRow->cRows;
5585 + if (cNumRows) {
5586 + LPENTRYID lpEntry = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
5587 + ULONG cb = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
5588 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
5590 + keepGoing = HandleHierarchyItem( oType, cb, lpEntry,aFolders);
5593 + MyFreeProws(lpRow);
5596 + } while ( SUCCEEDED(hr) && cNumRows && lpRow && keepGoing);
5599 + if (bResult && !keepGoing)
5600 + bResult = FALSE;
5602 + return( bResult);
5604 + BOOL nsMapiAddressBook::HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
5606 + ULONG objType=0;
5607 + if (oType == MAPI_FOLDER)
5609 + nsMapiInterfaceWrapper<LPMAPICONTAINER> pFolder ;
5610 + if (!mRootSession->OpenEntry(
5611 + cb,
5612 + pEntry,
5613 + 0,
5614 + MAPI_BEST_ACCESS,
5615 + &objType,
5616 + pFolder))
5618 + LPSPropValue pVal;
5621 + pVal = GetMapiProperty(*(LPMAPICONTAINER*)&pFolder, PR_CONTAINER_CLASS);
5622 + if (pVal)
5624 + if (strcmp("IPF.Contact",pVal->Value.lpszA) == 0)
5626 + SPropValue *currentValue=GetMapiProperty( *(LPMAPICONTAINER*)&pFolder, PR_ENTRYID);
5628 + aFolders.AddItem(currentValue->Value.bin.cb,
5629 + NS_REINTERPRET_CAST(LPENTRYID, currentValue->Value.bin.lpb)) ;
5635 + else
5637 + PRINTF(( "GetStoreFolders - HandleHierarchyItem: Unhandled ObjectType: %ld\n", oType));
5640 + return( TRUE);
5644 + BOOL nsMapiAddressBook::GetFolders(nsMapiEntryArray& aFolders)
5646 + aFolders.CleanUp() ;
5647 + nsMapiInterfaceWrapper<LPMAPICONTAINER> rootFolder ;
5648 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
5649 + ULONG objType = 0 ;
5650 + ULONG rowCount = 0 ;
5652 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
5654 + mLastError = mRootSession->GetMsgStoresTable( 0, lpTable);
5655 + if (HR_FAILED(mLastError)) {
5656 + PRINTF(("Cannot open MAPI MsgStores %08x.\n", mLastError));
5657 + return mLastError;
5660 + mLastError = lpTable->GetRowCount( 0, &rowCount);
5662 + mLastError = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
5663 + if (FAILED(mLastError))
5664 + return( mLastError);
5665 + mLastError = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
5666 + if (FAILED(mLastError))
5667 + return mLastError;
5669 + int cNumRows = 0;
5670 + LPSRowSet lpRow;
5671 + BOOL keepGoing = TRUE;
5672 + BOOL bResult = TRUE;
5673 + do {
5675 + lpRow = NULL;
5676 + mLastError = lpTable->QueryRows( 1, 0, &lpRow);
5678 + if (HR_FAILED(mLastError)){
5679 + bResult = FALSE;
5680 + break;
5683 + if (lpRow){
5684 + cNumRows = lpRow->cRows;
5686 + if (cNumRows) {
5687 + LPENTRYID lpEID = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
5688 + ULONG cbEID = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
5689 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
5692 + keepGoing = HandleContentsItem( oType, cbEID, lpEID,aFolders);
5694 + MyFreeProws( lpRow);
5697 + } while ( SUCCEEDED(mLastError) && cNumRows && lpRow && keepGoing);
5700 + return HR_SUCCEEDED(mLastError) ;
5702 + BOOL nsMapiAddressBook::CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction)
5704 + ULONG conditionType = 0 ;
5705 + ULONG ulResIndex;
5706 + if (!aRestriction)
5707 + return FALSE;
5708 + for (ulResIndex=0;ulResIndex < aRestrictionNum;ulResIndex++)
5710 + conditionType = aRestriction[ulResIndex].rt;
5711 + switch (conditionType)
5713 + case RES_EXIST :
5714 + aRestriction[ulResIndex].res.resExist.ulPropTag =
5715 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resExist.ulPropTag);
5716 + break ;
5717 + case RES_BITMASK :
5718 + aRestriction[ulResIndex].res.resBitMask.ulPropTag =
5719 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resBitMask.ulPropTag);
5720 + break ;
5721 + case RES_CONTENT :
5722 + aRestriction[ulResIndex].res.resContent.ulPropTag =
5723 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.ulPropTag);
5724 + aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag =
5725 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag);
5726 + break ;
5727 + case RES_PROPERTY :
5728 + aRestriction[ulResIndex].res.resProperty.ulPropTag =
5729 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.ulPropTag);
5730 + aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag =
5731 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag);
5732 + break ;
5733 + case RES_SIZE :
5734 + aRestriction[ulResIndex].res.resSize.ulPropTag =
5735 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resSize.ulPropTag);
5736 + break ;
5737 + case RES_COMPAREPROPS :
5738 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag1 =
5739 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag1);
5740 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag2 =
5741 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag2);
5742 + break ;
5743 + case RES_NOT :
5744 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resNot.lpRes);
5745 + break;
5746 + case RES_AND :
5747 + CorrectRestriction(aMapiProp,
5748 + aRestriction[ulResIndex].res.resAnd.cRes,
5749 + aRestriction[ulResIndex].res.resAnd.lpRes);
5750 + break;
5751 + case RES_OR :
5752 + CorrectRestriction(aMapiProp,
5753 + aRestriction[ulResIndex].res.resOr.cRes,
5754 + aRestriction[ulResIndex].res.resOr.lpRes);
5755 + break;
5757 + case RES_COMMENT :
5758 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resComment.lpRes);
5759 + aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag =
5760 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag);
5761 + break;
5762 + case RES_SUBRESTRICTION :
5763 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resSub.lpRes);
5764 + break;
5765 + default:
5766 + return FALSE;
5769 + return TRUE;
5771 + BOOL nsMapiAddressBook::Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList)
5773 + if (!aRestriction)
5774 + return FALSE;
5776 + ULONG conditionType = 0 ;
5778 + nsMapiEntryArray listOut;
5779 + ULONG listindex=0;
5781 + nsMapiEntryArray listDel;
5782 + ULONG delindex=0;
5784 + ULONG listsize;
5785 + ULONG resCount = 0;
5786 + ULONG resIndex = 0;
5788 + listsize = aList->GetSize();
5789 + conditionType = aRestriction->rt;
5790 + switch (conditionType)
5792 + case RES_EXIST :
5793 + case RES_BITMASK :
5794 + case RES_CONTENT :
5795 + case RES_PROPERTY :
5796 + case RES_SIZE :
5797 + case RES_COMPAREPROPS :
5798 + case RES_COMMENT :
5799 + case RES_SUBRESTRICTION :
5801 + while(listindex < aList->GetSize())
5803 + if (!FilterOnOneRow(aList->ElementAt(listindex),aRestriction))
5804 + aList->Remove(listindex);
5805 + else
5806 + listindex++;
5809 + break;
5810 + case RES_NOT :
5811 + aRestriction->res.resNot.ulReserved = 1;
5812 + case RES_AND :
5813 + case RES_OR :
5815 + if (conditionType == RES_OR)
5817 + for(listindex=0;listindex<aList->GetSize();listindex++)
5819 + listDel.AddItem(aList->ElementAt(listindex));
5823 + resCount = aRestriction->res.resAnd.cRes;
5824 + //notice that SAndRestriction ,SNotRestriction ,SOrRestriction
5825 + //use the same struct
5826 + for (resIndex = 0;resIndex < resCount;resIndex++)
5828 + //can't call listOut.CleanUp() here
5829 + //because it will destroy all Element too
5830 + while(listOut.GetSize())
5832 + listOut.Remove(0);
5835 + for(listindex=0;listindex<aList->GetSize();listindex++)
5837 + listOut.AddItem(aList->ElementAt(listindex));
5840 + Filter(&aRestriction->res.resAnd.lpRes[resIndex],&listOut);
5841 + if (conditionType == RES_NOT)
5843 + for(listindex=0;listindex<listOut.GetSize();listindex++)
5845 + aList->Remove(listOut.ElementAt(listindex));
5848 + else if (conditionType == RES_AND )
5850 + for(listindex=0;listindex<listOut.GetSize();listindex++)
5852 + if (!aList->IndexOf(listOut.ElementAt(listindex)))
5854 + aList->Remove(listOut.ElementAt(listindex));
5858 + else if (conditionType == RES_OR )
5860 + for(listindex=0;listindex<listOut.GetSize();listindex++)
5862 + listDel.Remove(listOut.ElementAt(listindex));
5864 + if (listDel.GetSize() == 0)
5866 + break;
5870 + if (conditionType == RES_OR)
5872 + for(listindex=0;listindex<listDel.GetSize();listindex++)
5874 + aList->Remove(listDel.ElementAt(listindex));
5880 + while(listDel.GetSize())
5882 + listDel.Remove(0);
5884 + while(listOut.GetSize())
5886 + listOut.Remove(0);
5890 + return TRUE;
5893 + BOOL nsMapiAddressBook::FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction)
5895 + LPMAPIPROP object ;
5896 + ULONG objType = 0 ;
5897 + LPSPropValue realValue = NULL ;
5898 + LPSPropValue resValue = NULL ;
5899 + ULONG valueCount = 0 ;
5901 + mLastError = OpenEntry(aEntry->mByteCount, aEntry->mEntryId,
5902 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
5903 + (IUnknown **)&object) ;
5905 + if (HR_FAILED(mLastError)) {
5906 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5907 + return FALSE ;
5910 + ULONG conditionType = 0 ;
5911 + conditionType = aRestriction->rt;
5913 + switch (conditionType)
5915 + case RES_EXIST :
5916 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resExist.ulPropTag,1,realValue,valueCount))
5917 + return FALSE;
5918 + resValue = NULL;
5919 + break ;
5920 + case RES_CONTENT :
5921 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resContent.ulPropTag,1,realValue,valueCount))
5922 + return FALSE;
5923 + resValue = aRestriction->res.resContent.lpProp;
5924 + break ;
5925 + case RES_PROPERTY :
5926 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resProperty.ulPropTag,1,realValue,valueCount))
5927 + return FALSE;
5928 + resValue = aRestriction->res.resProperty.lpProp;
5929 + break ;
5930 + case RES_BITMASK :
5931 + return FALSE; //not support
5932 + break ;
5933 + case RES_SIZE :
5934 + return FALSE;//not been used now
5935 + break ;
5936 + case RES_COMPAREPROPS :
5937 + return FALSE;//not been used now
5938 + break ;
5939 + case RES_NOT :
5940 + return FALSE;//not need care here
5941 + break;
5942 + case RES_AND :
5943 + return FALSE;//not need care here
5944 + break;
5945 + case RES_OR :
5946 + return FALSE;//not need care here
5947 + break;
5948 + case RES_COMMENT :
5949 + return TRUE;//comment
5950 + break;
5951 + case RES_SUBRESTRICTION :
5952 + return FALSE;//not been used now
5953 + break ;
5955 + return AtomyFilter(aRestriction,realValue,resValue);
5959 + BOOL nsMapiAddressBook::AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue)
5961 + ULONG conditionType = 0 ;
5962 + conditionType = aRestriction->rt;
5964 + BOOL bTagEq=(aRealValue &&
5965 + PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) &&
5966 + aFilterValue;
5967 + // PROP_TYPE( aRealValue->ulPropTag ) == PROP_TYPE( aFilterValue->ulPropTag ));
5968 + switch (conditionType)
5970 + case RES_EXIST :
5971 + return (aRealValue && PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) ;
5972 + break ;
5973 + case RES_CONTENT :
5974 + if (bTagEq)
5976 + switch(aRestriction->res.resContent.ulFuzzyLevel)
5978 + case FL_FULLSTRING :
5979 + return !stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA);
5980 + break;
5981 + case FL_PREFIX :
5982 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == aRealValue->Value.lpszA;
5983 + break;
5984 + case FL_SUBSTRING :
5985 + default:
5986 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
5987 + break;
5990 + return FALSE;
5991 + break ;
5992 + case RES_PROPERTY :
5993 + if (bTagEq)
5995 + switch(aRestriction->res.resProperty.relop)
5997 + case RELOP_GE :
5998 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) >= 0;
5999 + break;
6000 + case RELOP_GT :
6001 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) > 0;
6002 + break;
6003 + case RELOP_LE :
6004 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) <= 0;
6005 + break;
6006 + case RELOP_LT :
6007 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) < 0;
6008 + break;
6009 + case RELOP_EQ :
6010 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == 0;
6011 + break;
6012 + case RELOP_NE :
6013 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != 0;
6014 + break;
6015 + case RELOP_RE :
6016 + default:
6017 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
6018 + break;
6022 + return FALSE;
6023 + break ;
6024 + case RES_BITMASK :
6025 + return FALSE; //not support
6026 + break ;
6027 + case RES_SIZE :
6028 + return FALSE;//not been used now
6029 + break ;
6030 + case RES_COMPAREPROPS :
6031 + return FALSE;//not been used now
6032 + break ;
6033 + case RES_NOT :
6034 + return FALSE;//not need care here
6035 + break;
6036 + case RES_AND :
6037 + return FALSE;//not need care here
6038 + break;
6039 + case RES_OR :
6040 + return FALSE;//not need care here
6041 + break;
6042 + case RES_COMMENT :
6043 + return TRUE;//comment
6044 + break;
6045 + case RES_SUBRESTRICTION :
6046 + return FALSE;//not been used now
6047 + break ;
6049 + return TRUE;
6052 + BOOL nsMapiAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
6053 + nsMapiEntryArray *aList, ULONG aMapiType)
6055 + if (aList)
6056 + aList->CleanUp();
6058 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
6059 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
6060 + ULONG objType = 0 ;
6061 + ULONG rowCount = 0 ;
6064 + nsMapiInterfaceWrapper<LPMAPIPROP> pFolder;
6065 + nsCString cs;
6066 + aParent.ToString(cs);
6068 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
6069 + 0, MAPI_BEST_ACCESS, &objType, pFolder);
6070 + if (HR_FAILED(mLastError))
6072 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
6073 + return FALSE;
6077 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&pFolder,PR_MESSAGE_CLASS);
6078 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
6080 + HRESULT hr;
6081 + LPSPropValue aValue = NULL ;
6082 + ULONG aValueCount = 0 ;
6084 + LPSPropTagArray properties = NULL ;
6085 + mMAPIAllocateBuffer(CbNewSPropTagArray(1),
6086 + (void **)&properties);
6087 + properties->cValues = 1;
6088 + properties->aulPropTag [0] = GetEmailPropertyTag(*(LPMAPIPROP*)&pFolder,OUTLOOK_EMAIL_LIST1);
6089 + hr = pFolder->GetProps(properties, 0, &aValueCount, &aValue) ;
6091 + SBinaryArray *sa=&aValue->Value.MVbin;
6093 + LPENTRYID lpEID;
6094 + ULONG cbEID;
6096 + ULONG idx;
6097 + nsMapiEntry testEntry;
6098 + nsCString sClass;
6099 + for (idx=0;sa->lpbin && idx<sa->cValues ;idx++)
6101 + lpEID= (LPENTRYID) sa->lpbin[idx].lpb;
6102 + cbEID = sa->lpbin[idx].cb;
6103 + testEntry.Assign(sa->lpbin[idx].cb,NS_REINTERPRET_CAST(LPENTRYID,sa->lpbin[idx].lpb));
6105 + if (GetPropertyString(testEntry,PR_MESSAGE_CLASS,sClass)) //Error get property
6107 + aList->AddItem(cbEID,lpEID);
6110 + Filter(aRestriction,aList);
6112 + else
6114 + if (aRestriction && !CorrectRestriction(*(LPMAPICONTAINER*)&pFolder,1,aRestriction))
6115 + return FALSE;
6116 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
6117 + &IID_IMAPIContainer, MAPI_BEST_ACCESS, &objType,
6118 + parent) ;
6119 + if (HR_FAILED(mLastError)) {
6120 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
6121 + return FALSE ;
6124 + mLastError = parent->GetContentsTable(0, contents) ;
6125 + if (HR_FAILED(mLastError)) {
6126 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
6127 + return FALSE;
6129 + if (aRestriction) {
6130 + mLastError = contents->Restrict(aRestriction, TBL_BATCH) ;
6131 + if (HR_FAILED(mLastError)) {
6132 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
6133 + return FALSE ;
6136 + mLastError = contents->SetColumns((LPSPropTagArray)&ContentsColumns, 0);
6137 + if (HR_FAILED(mLastError)) {
6138 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
6139 + return FALSE ;
6141 + mLastError = contents->GetRowCount(0, &rowCount) ;
6142 + if (HR_FAILED(mLastError)) {
6143 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
6144 + return FALSE ;
6146 + do {
6147 + LPSRowSet rowSet = NULL ;
6149 + rowCount = 0 ;
6150 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
6151 + if (HR_FAILED(mLastError)) {
6152 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
6153 + return FALSE ;
6155 + rowCount = rowSet->cRows ;
6156 + if (rowCount > 0 && aList)
6158 + if (aMapiType == 0 || rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)
6160 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
6161 + aList->AddItem(currentValue.Value.bin.cb,
6162 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
6164 + else if (aMapiType == MAPI_DISTLIST)
6166 + if (strcmp("IPM.DistList",rowSet->aRow->lpProps[ContentsColumnMessageClass].Value.lpszA)==0)
6168 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
6169 + aList->AddItem(currentValue.Value.bin.cb,
6170 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
6176 + MyFreeProws(rowSet) ;
6177 + } while (rowCount > 0) ;
6181 + return TRUE ;
6184 + BOOL nsMapiAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
6185 + ULONG aNbProperties, LPSPropValue& aValue,
6186 + ULONG& aValueCount)
6188 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
6189 + ULONG objType = 0 ;
6190 + LPSPropTagArray properties = NULL ;
6191 + ULONG i = 0 ;
6193 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
6194 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6195 + object) ;
6197 + if (HR_FAILED(mLastError)) {
6198 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
6199 + return FALSE ;
6201 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
6202 + NS_REINTERPRET_CAST(void **, &properties));
6203 + properties->cValues = aNbProperties ;
6204 + for (i = 0 ; i < aNbProperties ; ++ i)
6206 + properties->aulPropTag [i] = GetRealMapiPropertyTag(*(LPMAPIPROP*)&object,aPropertyTags [i],TRUE);
6208 + mLastError = object->GetProps(properties, 0 , &aValueCount, &aValue) ;
6209 + FreeBuffer(properties) ;
6211 + if (HR_FAILED(mLastError)) {
6212 + PRINTF(("Error get props %08x.\n", mLastError)) ;
6214 + return HR_SUCCEEDED(mLastError);
6217 + BOOL nsMapiAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
6218 + LPSPropValue& aValues)
6220 + nsMapiInterfaceWrapper<LPMESSAGE> object;
6221 + ULONG objType = 0 ;
6222 + LPSPropProblemArray problems = NULL ;
6223 + ULONG i = 0 ;
6225 + LPMDB lpMsgStore=GetMsgStore(aObject);
6227 + if (!lpMsgStore)
6229 + return FALSE;
6231 + mLastError = lpMsgStore->OpenEntry(aObject.mByteCount, aObject.mEntryId,
6232 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
6233 + object) ;
6234 + lpMsgStore->Release();
6236 + if (HR_FAILED(mLastError)) {
6237 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
6238 + return FALSE ;
6240 + for (i = 0 ; i < aNbProperties ; ++ i)
6242 + aValues[i].ulPropTag = GetRealMapiPropertyTag(*(LPMESSAGE*)&object,aValues[i].ulPropTag,TRUE);
6244 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
6245 + if (HR_FAILED(mLastError)) {
6246 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
6247 + return FALSE ;
6249 + if (problems) {
6250 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
6251 + PRINTF(("Problem %d: index %d code %08x.\n", i,
6252 + problems->aProblem [i].ulIndex,
6253 + problems->aProblem [i].scode)) ;
6256 + mLastError = object->SaveChanges(0) ;
6257 + if (MAPI_E_OBJECT_CHANGED == mLastError)
6259 + mLastError = object->SaveChanges(FORCE_SAVE ) ;
6261 + return HR_SUCCEEDED(mLastError) ;
6264 + BOOL nsMapiAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
6266 + return FALSE ;
6269 + BOOL nsMapiAddressBook::IsOK(void)
6271 + return mRootSession && mLibUsage;
6274 BOOL nsMapiAddressBook::Initialize(void)
6277 nsAutoLock guard(mMutex) ;
6279 if (!LoadMapiLibrary()) {
6280 PRINTF(("Cannot load library.\n")) ;
6281 return FALSE ;
6283 ! return TRUE;
6286 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
6287 ***************
6288 *** 182,188 ****
6289 --- 1109,1911 ----
6290 mMAPIFreeBuffer(aBuffer) ;
6293 + ULONG nsMapiAddressBook::GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID)
6295 + static GUID emailGUID =
6297 + 0x00062004, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
6298 + };
6301 + MAPINAMEID mapiNameID;
6302 + mapiNameID.lpguid = &emailGUID;
6303 + mapiNameID.ulKind = MNID_ID;
6304 + mapiNameID.Kind.lID = nameID;
6306 + LPMAPINAMEID lpMapiNames = &mapiNameID;
6307 + LPSPropTagArray lpMailTagArray = NULL;
6309 + HRESULT result = lpProp->GetIDsFromNames(1L, &lpMapiNames, 0, &lpMailTagArray);
6310 + if (result == S_OK)
6312 + ULONG lTag = lpMailTagArray->aulPropTag[0];
6313 + mMAPIFreeBuffer(lpMailTagArray);
6314 + return lTag;
6316 + return 0L;
6318 + ULONG nsMapiAddressBook::GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest)
6320 + LPSPropValue addr;
6321 + ULONG upRealTag=aPropertyTag;
6322 + ULONG lSize=sizeof(TagMaps) / sizeof(TagMap);
6324 + for(int i=0; i<lSize; i++)
6326 + if (TagMaps[i].AddressTag == aPropertyTag)
6329 + ULONG kPriEmailColumn=GetEmailPropertyTag(lpProp,TagMaps[i].NameID);
6330 + if (aTest)
6332 + if (PR_DISPLAY_NAME_A == aPropertyTag)
6334 + //We need not change PR_DISPLAY_NAME_A tag if we are not using an address
6335 + LPSPropValue msgClass=GetMapiProperty(lpProp,PR_MESSAGE_CLASS);
6336 + if (msgClass && !strcmp("IPM.Contact",msgClass->Value.lpszA))
6338 + if (kPriEmailColumn)
6339 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
6341 + else
6343 + FreeBuffer(msgClass);
6344 + upRealTag = aPropertyTag;
6347 + else //PR_DISPLAY_NAME_A == aPropertyTag
6349 + addr=GetMapiProperty(lpProp,aPropertyTag);
6350 + if (!addr || PROP_TYPE( addr->ulPropTag) == PT_ERROR ||
6351 + addr->Value.l == MAPI_E_NOT_FOUND)
6353 + if (kPriEmailColumn)
6354 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
6358 + else //aTest
6360 + if (kPriEmailColumn)
6361 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
6364 + break; //we find it,exit
6368 + return upRealTag;
6371 + BOOL nsMapiAddressBook::GetPropertyLong(const nsMapiEntry& aObject,
6372 + ULONG aPropertyTag,
6373 + ULONG& aValue)
6375 + aValue = 0 ;
6376 + LPSPropValue values = NULL ;
6377 + ULONG valueCount = 0 ;
6379 + if (PR_OBJECT_TYPE == aPropertyTag)
6381 + nsMapiInterfaceWrapper<LPMAPIFOLDER> pFolder ;
6382 + ULONG objType=0;
6383 + mLastError = OpenEntry(aObject.mByteCount,aObject.mEntryId,
6384 + NULL,MAPI_BEST_ACCESS,&objType, pFolder);
6385 + if (HR_FAILED(mLastError))
6387 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
6388 + return FALSE;
6390 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIFOLDER*)&pFolder,PR_MESSAGE_CLASS);
6391 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
6393 + FreeBuffer(msgClass);
6394 + aValue = MAPI_DISTLIST;
6395 + return TRUE;
6399 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
6400 + return FALSE ;
6402 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_LONG) {
6403 + aValue = values->Value.ul ;
6405 + FreeBuffer(values) ;
6406 + return TRUE ;
6409 + BOOL nsMapiAddressBook::GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
6410 + WORD& aYear, WORD& aMonth, WORD& aDay)
6412 + aYear = 0;
6413 + aMonth = 0;
6414 + aDay = 0;
6415 + LPSPropValue values = NULL ;
6416 + ULONG valueCount = 0 ;
6418 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
6419 + return FALSE ;
6421 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
6422 + SYSTEMTIME readableTime ;
6423 + FILETIME localTime ;
6424 + FileTimeToLocalFileTime(&values->Value.ft,&localTime);
6425 + if (FileTimeToSystemTime(&localTime, &readableTime)) {
6426 + aYear = readableTime.wYear ;
6427 + aMonth = readableTime.wMonth ;
6428 + aDay = readableTime.wDay ;
6431 + FreeBuffer(values) ;
6432 + return TRUE ;
6435 + HRESULT nsMapiAddressBook::OpenEntry(ULONG cbEntryID,
6436 + LPENTRYID lpEntryID,
6437 + LPCIID lpInterface,
6438 + ULONG ulFlags,
6439 + ULONG FAR * lpulObjType,
6440 + LPUNKNOWN FAR * lppUnk
6444 + int err;
6445 + HRESULT rv;
6446 + __try
6448 + rv=mRootSession->OpenEntry(cbEntryID,
6449 + lpEntryID,
6450 + lpInterface,
6451 + ulFlags ,
6452 + lpulObjType,
6453 + lppUnk
6454 + );
6455 + }__except(err)
6457 + return (-1);
6460 + if (HR_FAILED(rv) && !m_MDBArray.Count())
6462 + //There are no openned Message store,so we have to open them all
6463 + nsMapiEntryArray aFolders;
6464 + if (GetFolders(aFolders))
6466 + __try
6468 + rv=mRootSession->OpenEntry(cbEntryID,
6469 + lpEntryID,
6470 + lpInterface,
6471 + ulFlags ,
6472 + lpulObjType,
6473 + lppUnk
6474 + );
6475 + }__except(err)
6477 + return (-1);
6481 + return rv;
6485 + BOOL nsMapiAddressBook::AddEntryToList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
6487 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
6488 + ULONG objType = 0 ;
6490 + nsMapiEntry parentEntry;
6491 + if (!GetEntryParent(aDistlist,parentEntry))
6492 + return FALSE;
6494 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
6496 + if (!lpMsgStore)
6497 + return FALSE;
6498 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
6499 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6500 + container) ;
6501 + lpMsgStore->Release();
6503 + if (HR_FAILED(mLastError))
6504 + return FALSE ;
6507 + /*
6508 + When add mail address to distlist,Mapi need update 2 tag.
6509 + */
6510 + //update OUTLOOK_EMAIL_LIST1
6511 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
6512 + SBinaryArray oldChilds;
6513 + LPSBinary bins=NULL;
6514 + SBinaryArray newChilds;
6515 + LPSPropValue oldChildValue = NULL ;
6516 + ULONG valueCount = 0 ;
6518 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
6520 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
6521 + return FALSE;
6524 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
6526 + oldChilds = oldChildValue->Value.MVbin;
6527 + newChilds.cValues=oldChilds.cValues + 1;
6528 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6529 + newChilds.lpbin = bins;
6530 + for (ULONG i=0;i<oldChilds.cValues;i++)
6532 + newChilds.lpbin[i].lpb = oldChilds.lpbin[i].lpb;
6533 + newChilds.lpbin[i].cb = oldChilds.lpbin[i].cb;
6536 + else
6538 + newChilds.cValues = 1;
6539 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6540 + newChilds.lpbin = bins;
6543 + nsMapiEntry orgEntryID;
6544 + if (!GetPropertyBin(aNewEntry,
6545 + GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_ORGID) | PT_BINARY,
6546 + orgEntryID))
6548 + return FALSE;
6550 + newChilds.lpbin[newChilds.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
6551 + newChilds.lpbin[newChilds.cValues-1].cb = orgEntryID.mByteCount;
6553 + SPropValue childs;
6554 + childs.ulPropTag = listTag;
6555 + childs.Value.MVbin = newChilds;
6557 + LPSPropProblemArray problems = NULL ;
6558 + mLastError = container->SetProps(1, &childs, &problems) ;
6559 + if (HR_FAILED(mLastError)) {
6560 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
6561 + return FALSE ;
6564 + //update OUTLOOK_EMAIL_LIST2
6565 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
6566 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
6568 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
6569 + return FALSE;
6572 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
6574 + oldChilds = oldChildValue->Value.MVbin;
6575 + newChilds.cValues=oldChilds.cValues + 1;
6576 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6577 + newChilds.lpbin = bins;
6578 + for (ULONG i=0;i<oldChilds.cValues;i++)
6580 + newChilds.lpbin[i].lpb = oldChilds.lpbin[i].lpb;
6581 + newChilds.lpbin[i].cb = oldChilds.lpbin[i].cb;
6584 + else
6586 + newChilds.cValues = 1;
6587 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6588 + newChilds.lpbin = bins;
6591 + /*
6592 + Need more work here.
6593 + There are two kind of mail address in outlook DistList.
6594 + One is sample,not include in parent folder.
6595 + The other is a link to a unattached address in parents folders.
6596 + Currently we can only add first kind of address to a outlook distlist.
6597 + */
6599 + newChilds.lpbin[newChilds.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
6600 + newChilds.lpbin[newChilds.cValues-1].cb = orgEntryID.mByteCount;
6602 + childs.ulPropTag = listTag;
6603 + childs.Value.MVbin = newChilds;
6605 + mLastError = container->SetProps(1, &childs, &problems) ;
6606 + if (HR_FAILED(mLastError))
6608 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
6609 + return FALSE ;
6612 + mMAPIFreeBuffer(bins);
6614 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
6615 + if (HR_FAILED(mLastError)) {
6616 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
6617 + return FALSE ;
6620 + return TRUE ;
6622 + BOOL nsMapiAddressBook::DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
6624 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
6625 + ULONG objType = 0 ;
6627 + nsMapiEntry parentEntry;
6628 + if (!GetEntryParent(aDistlist,parentEntry))
6629 + return FALSE;
6631 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
6632 + if (!lpMsgStore)
6633 + return FALSE;
6635 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
6636 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6637 + container) ;
6638 + lpMsgStore->Release();
6640 + if (HR_FAILED(mLastError))
6641 + return FALSE ;
6642 + /*
6643 + When delete mail address from distlist,Mapi need update 2 tag.
6644 + */
6645 + //update OUTLOOK_EMAIL_LIST1
6646 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
6648 + SBinaryArray oldChilds;
6649 + LPSBinary bins=NULL;
6650 + SBinaryArray newChilds;
6651 + LPSPropValue oldChildValue = NULL ;
6652 + ULONG valueCount = 0 ;
6654 + newChilds.lpbin=NULL;
6656 + ULONG lDeleteEntry=0;
6657 + ULONG newIndex=0;
6658 + ULONG oldIndex=0;
6659 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
6661 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
6662 + return FALSE;
6665 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
6667 + oldChilds = oldChildValue->Value.MVbin;
6668 + newChilds.cValues=oldChilds.cValues - 1;
6669 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6670 + newChilds.lpbin = bins;
6671 + for (oldIndex=0;oldIndex<oldChilds.cValues;oldIndex++)
6673 + if ( oldChilds.lpbin[oldIndex].cb == aNewEntry.mByteCount &&
6674 + !memcmp((void*)(oldChilds.lpbin[oldIndex].lpb+4),
6675 + (void*)(aNewEntry.mEntryId->ab),
6676 + oldChilds.lpbin[oldIndex].cb-4))
6678 + lDeleteEntry=oldIndex;
6680 + else
6682 + newChilds.lpbin[newIndex].lpb = oldChilds.lpbin[oldIndex].lpb;
6683 + newChilds.lpbin[newIndex].cb = oldChilds.lpbin[oldIndex].cb;
6684 + newIndex++;
6688 + else
6689 + return FALSE;
6692 + SPropValue childs;
6693 + LPSPropProblemArray problems = NULL ;
6695 + if (newChilds.cValues == 0)
6697 + SPropTagArray delTags;
6698 + delTags.cValues = 1;
6699 + delTags.aulPropTag[0] = listTag;
6701 + mLastError = container->DeleteProps(&delTags, &problems) ;
6703 + else
6705 + childs.ulPropTag = listTag;
6706 + childs.Value.MVbin = newChilds;
6707 + mLastError = container->SetProps(1, &childs, &problems) ;
6710 + if (HR_FAILED(mLastError)) {
6711 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
6712 + return FALSE ;
6715 + //update OUTLOOK_EMAIL_LIST2
6716 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
6717 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
6719 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
6720 + return FALSE;
6723 + newIndex=0;
6724 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
6726 + oldChilds = oldChildValue->Value.MVbin;
6727 + newChilds.cValues=oldChilds.cValues - 1;
6728 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6729 + newChilds.lpbin = bins;
6730 + for (oldIndex=0;oldIndex<oldChilds.cValues;oldIndex++)
6732 + if (oldIndex != lDeleteEntry)
6734 + newChilds.lpbin[newIndex].lpb = oldChilds.lpbin[oldIndex].lpb;
6735 + newChilds.lpbin[newIndex].cb = oldChilds.lpbin[oldIndex].cb;
6736 + newIndex++;
6740 + else
6742 + newChilds.cValues = 1;
6743 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6744 + newChilds.lpbin = bins;
6749 + if (newChilds.cValues == 0)
6751 + SPropTagArray delTags;
6752 + delTags.cValues = 1;
6753 + delTags.aulPropTag[0] = listTag;
6755 + mLastError = container->DeleteProps(&delTags, &problems) ;
6757 + else
6759 + childs.ulPropTag = listTag;
6760 + childs.Value.MVbin = newChilds;
6761 + mLastError = container->SetProps(1, &childs, &problems) ;
6763 + if (HR_FAILED(mLastError)) {
6764 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
6765 + return FALSE ;
6768 + mMAPIFreeBuffer(bins);
6770 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
6771 + if (HR_FAILED(mLastError)) {
6772 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
6773 + return FALSE ;
6776 + return TRUE ;
6779 + BOOL nsMapiAddressBook::GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry)
6781 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
6782 + ULONG objType = 0 ;
6783 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
6784 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6785 + (IUnknown **)&object) ;
6787 + if (HR_FAILED(mLastError)) {
6788 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
6789 + return FALSE ;
6791 + SPropValue *parentID=GetMapiProperty(*(LPMAPIPROP*)&object, PR_PARENT_ENTRYID);
6793 + if (parentID->Value.l == MAPI_E_NOT_FOUND)
6794 + return FALSE;
6795 + aParentEntry.Assign(parentID->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, parentID->Value.bin.lpb));
6796 + return TRUE;
6798 + BOOL nsMapiAddressBook::CreateEntryInList(const nsMapiEntry& aDistlist, nsMapiEntry& aNewEntry)
6800 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
6801 + ULONG objType = 0 ;
6803 + nsMapiEntry parentEntry;
6804 + if (!GetEntryParent(aDistlist,parentEntry))
6806 + return FALSE;
6808 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6809 + if (!CreateEntry(parentEntry,aNewEntry)) //Create a entry in parent folder
6810 + return FALSE;
6812 + return AddEntryToList(aDistlist,aNewEntry);
6815 + BOOL nsMapiAddressBook::CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
6817 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
6818 + ULONG objType = 0 ;
6820 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
6821 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
6822 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6823 + object) ;
6825 + if (HR_FAILED(mLastError)) {
6826 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
6827 + return NULL ;
6829 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
6831 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
6832 + return CreateEntryInList(aParent,aNewEntry); //Create entry in DistList
6834 + LPMDB lpMsgStore=GetMsgStore(aParent);
6836 + if (!lpMsgStore)
6837 + return FALSE;
6839 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
6840 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6841 + container) ;
6842 + lpMsgStore->Release();
6844 + if (HR_FAILED(mLastError))
6845 + return FALSE;
6847 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6849 + mLastError = container->CreateMessage(&IID_IMessage,
6850 + 0,
6851 + newEntry) ;
6852 + if (HR_FAILED(mLastError)) {
6853 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
6854 + return FALSE ;
6856 + SPropValue messageclass ;
6857 + LPSPropProblemArray problems = NULL ;
6858 + nsCString tempName ;
6860 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
6861 + tempName.Assign("IPM.Contact") ;
6862 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
6863 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
6864 + if (HR_FAILED(mLastError)) {
6865 + PRINTF(("Cannot set temporary name %08x.\n", mLastError)) ;
6866 + return FALSE ;
6868 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
6869 + if (HR_FAILED(mLastError)) {
6870 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
6871 + return FALSE ;
6874 + SPropTagArray property ;
6875 + LPSPropValue value = NULL ;
6876 + ULONG valueCount = 0 ;
6878 + property.cValues = 1 ;
6879 + property.aulPropTag [0] = PR_ENTRYID ;
6880 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
6881 + if (HR_FAILED(mLastError) || valueCount != 1) {
6882 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
6883 + return FALSE ;
6885 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
6886 + FreeBuffer(value) ;
6887 + return TRUE ;
6890 + BOOL nsMapiAddressBook::CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
6892 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
6893 + ULONG objType = 0 ;
6895 + LPMDB lpMsgStore=GetMsgStore(aParent);
6896 + if (!lpMsgStore)
6897 + return FALSE;
6898 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
6899 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6900 + container) ;
6901 + lpMsgStore->Release();
6903 + if (HR_FAILED(mLastError)) {
6904 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
6905 + return FALSE ;
6908 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6909 + mLastError = container->CreateMessage(&IID_IMAPIProp,
6910 + 0,
6911 + newEntry) ;
6912 + if (HR_FAILED(mLastError)) {
6913 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
6914 + return FALSE ;
6916 + SPropValue messageclass ;
6917 + LPSPropProblemArray problems = NULL ;
6918 + nsCString tempName ;
6920 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
6921 + tempName.Assign("IPM.DistList") ;
6922 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
6923 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
6924 + if (HR_FAILED(mLastError)) {
6925 + PRINTF(("Cannot set PR_MESSAGE_CLASS_A %08x.\n", mLastError)) ;
6926 + return FALSE ;
6928 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
6929 + if (HR_FAILED(mLastError)) {
6930 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
6931 + return FALSE ;
6934 + ULONG valueCount = 0 ;
6935 + SPropTagArray property ;
6936 + LPSPropValue value = NULL ;
6938 + property.cValues = 1 ;
6939 + property.aulPropTag [0] = PR_ENTRYID ;
6940 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
6941 + if (HR_FAILED(mLastError) || valueCount != 1) {
6942 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
6943 + return FALSE ;
6945 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
6947 + FreeBuffer(value) ;
6948 + return TRUE ;
6952 + BOOL nsMapiAddressBook::CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource,
6953 + nsMapiEntry& aTarget)
6955 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
6956 + nsMapiInterfaceWrapper<LPMAPIFOLDER> targetFolder ;
6957 + ULONG objType = 0 ;
6958 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
6959 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
6960 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6961 + object) ;
6963 + if (HR_FAILED(mLastError)) {
6964 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
6965 + return FALSE ;
6967 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
6969 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
6971 + //Add Entry To DistList
6972 + if (!AddEntryToList(aContainer,aSource))
6973 + return FALSE;
6974 + aTarget.Assign(aSource.mByteCount,aSource.mEntryId);
6975 + return TRUE;
6978 + SBinary entry ;
6979 + SBinaryArray entryArray ;
6981 + entry.cb = aSource.mByteCount ;
6982 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aSource.mEntryId) ;
6983 + entryArray.cValues = 1 ;
6984 + entryArray.lpbin = &entry ;
6986 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
6987 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6988 + container) ;
6989 + if (HR_FAILED(mLastError)) {
6990 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
6991 + return FALSE ;
6994 + mLastError = OpenEntry(aTarget.mByteCount, aTarget.mEntryId,
6995 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6996 + targetFolder) ;
6997 + if (HR_FAILED(mLastError)) {
6998 + PRINTF(("Cannot open Target folder %08x.\n", mLastError)) ;
6999 + return FALSE ;
7002 + nsMapiInterfaceWrapper<LPMAPIPROP> newEntry ;
7004 + mLastError = container->CopyMessages(&entryArray,
7005 + &IID_IMessage,
7006 + (void*)&targetFolder,
7007 + 0,
7008 + NULL,
7009 + NULL) ;
7010 + if (HR_FAILED(mLastError)) {
7011 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
7012 + return FALSE ;
7014 + return TRUE ;
7017 + BOOL nsMapiAddressBook::DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry)
7019 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
7020 + ULONG objType = 0 ;
7021 + SBinary entry ;
7022 + SBinaryArray entryArray ;
7025 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
7026 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
7027 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
7028 + object) ;
7030 + if (HR_FAILED(mLastError)) {
7031 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
7032 + return FALSE ;
7034 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
7036 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
7037 + return DeleteEntryFromList(aContainer,aEntry); //Delete Entry from DistList
7039 + LPMDB lpMsgStore=GetMsgStore(aContainer);
7040 + if (!lpMsgStore)
7041 + return FALSE;
7043 + mLastError = lpMsgStore->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
7044 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
7045 + container) ;
7046 + lpMsgStore->Release();
7047 + if (HR_FAILED(mLastError)) {
7048 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
7049 + return FALSE ;
7051 + entry.cb = aEntry.mByteCount ;
7052 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aEntry.mEntryId) ;
7053 + entryArray.cValues = 1 ;
7054 + entryArray.lpbin = &entry ;
7055 + mLastError = container->DeleteMessages(&entryArray, 0,0,0) ;
7056 + if (HR_FAILED(mLastError)) {
7057 + PRINTF(("Cannot delete entry %08x.\n", mLastError)) ;
7058 + return FALSE ;
7060 + return TRUE ;
7063 + //Use to open message store in write mode
7064 + LPMDB nsMapiAddressBook::GetMsgStore(const nsMapiEntry& aEntry)
7066 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
7067 + ULONG objType=0;
7069 + mLastError = OpenEntry(aEntry.mByteCount, aEntry.mEntryId,
7070 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
7071 + object) ;
7072 + if (HR_FAILED(mLastError)) {
7073 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
7074 + return NULL ;
7076 + SPropValue *svMsgSore=GetMapiProperty( *(LPMAPIPROP*)&object, PR_STORE_ENTRYID);;
7078 + LPMDB lpMsgStore=NULL;
7079 + mLastError=mRootSession->OpenMsgStore(0,
7080 + svMsgSore->Value.bin.cb,
7081 + (ENTRYID*)svMsgSore->Value.bin.lpb,
7082 + &IID_IMsgStore,
7083 + MAPI_BEST_ACCESS ,
7084 + &lpMsgStore);
7086 + if (HR_FAILED(mLastError)) {
7087 + PRINTF(("Cannot open MsgStore %08x.\n", mLastError)) ;
7088 + return NULL ;
7091 + return lpMsgStore;
7093 *** misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h Fri Sep 28 22:06:25 2001
7094 --- misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h Tue Jan 15 13:34:35 2008
7095 ***************
7096 *** 40,51 ****
7097 --- 40,81 ----
7099 #include "nsAbWinHelper.h"
7101 + struct TagMap
7103 + ULONG AddressTag;
7104 + ULONG NameID;
7105 + ULONG TypeMask;
7106 + };
7107 class nsMapiAddressBook : public nsAbWinHelper
7109 public :
7110 nsMapiAddressBook(void) ;
7111 virtual ~nsMapiAddressBook(void) ;
7113 + // Get the top address books
7114 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
7116 + // Get a default address book container
7117 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
7118 + // Is the helper correctly initialised?
7119 + virtual BOOL IsOK(void);
7120 + virtual BOOL GetPropertyLong(const nsMapiEntry& aObject,
7121 + ULONG aPropertyTag,
7122 + ULONG& aValue);
7123 + // Get the value of a MAPI property of type SYSTIME
7124 + virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
7125 + WORD& aYear, WORD& aMonth, WORD& aDay);
7126 + // Create entry in the address book
7127 + virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
7128 + // Delete an entry in the address book
7129 + virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
7130 + // Create a distribution list in the address book
7131 + virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
7132 + // Copy an existing entry in the address book
7133 + virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
7135 + static void FreeMapiLibrary(void) ;
7137 protected :
7138 // Class members to handle the library/entry points
7139 static HMODULE mLibrary ;
7140 ***************
7141 *** 67,85 ****
7142 static BOOL mInitialized ;
7143 static BOOL mLogonDone ;
7144 static LPMAPISESSION mRootSession ;
7145 ! static LPADRBOOK mRootBook ;
7147 // Load the MAPI environment
7148 BOOL Initialize(void) ;
7149 // Allocation of a buffer for transmission to interfaces
7150 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
7151 // Destruction of a buffer provided by the interfaces
7152 virtual void FreeBuffer(LPVOID aBuffer) ;
7153 // Library management
7154 static BOOL LoadMapiLibrary(void) ;
7155 ! static void FreeMapiLibrary(void) ;
7157 private :
7160 #endif // nsMapiAddressBook_h___
7161 --- 97,173 ----
7162 static BOOL mInitialized ;
7163 static BOOL mLogonDone ;
7164 static LPMAPISESSION mRootSession ;
7167 // Load the MAPI environment
7168 BOOL Initialize(void) ;
7170 + virtual HRESULT OpenEntry(ULONG cbEntryID,
7171 + LPENTRYID lpEntryID,
7172 + LPCIID lpInterface,
7173 + ULONG ulFlags,
7174 + ULONG FAR * lpulObjType,
7175 + LPUNKNOWN FAR * lppUnk
7176 + );
7179 + // Retrieve the contents of a container, with an optional restriction
7180 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
7181 + nsMapiEntryArray *aList, ULONG aMapiType) ;
7182 + // Retrieve the values of a set of properties on a MAPI object
7183 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
7184 + ULONG aNbProperties,
7185 + LPSPropValue& aValues, ULONG& aValueCount) ;
7186 + // Set the values of a set of properties on a MAPI object
7187 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
7188 + LPSPropValue& aValues);
7191 // Allocation of a buffer for transmission to interfaces
7192 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
7193 // Destruction of a buffer provided by the interfaces
7194 virtual void FreeBuffer(LPVOID aBuffer) ;
7195 // Library management
7196 static BOOL LoadMapiLibrary(void) ;
7198 ! BOOL HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
7199 ! LPSPropValue GetMapiProperty( LPMAPIPROP pProp, ULONG tag);
7200 ! BOOL GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal=FALSE);
7201 ! BOOL HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
7202 ! BOOL IterateHierarchy(IMAPIContainer * pFolder, nsMapiEntryArray& aFolders,ULONG flags=0);
7203 ! ULONG GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID);
7204 ! ULONG GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest=FALSE);
7205 ! LPMDB GetMsgStore(const nsMapiEntry& aEntry);
7206 ! BOOL CreateEntryInList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry);
7207 ! BOOL AddEntryToList(const nsMapiEntry& aParent,const nsMapiEntry& aNewEntry);
7208 ! BOOL DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry);
7209 ! BOOL GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry);
7210 ! BOOL CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction);
7212 ! //filter
7213 ! BOOL Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList);
7214 ! BOOL FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction);
7215 ! BOOL AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue);
7217 ! void AddToMDBArray(LPMDB aMDB)
7219 ! m_MDBArray.AppendElement(aMDB);
7221 ! void CleanUpMDB()
7223 ! LPMDB mdb;
7224 ! for (int i = 0; i < m_MDBArray.Count(); i++)
7226 ! mdb = (LPMDB)m_MDBArray.ElementAt(i);
7227 ! mdb->Release();
7229 ! m_MDBArray.Clear();
7232 private :
7233 + //use to keep all openned MsgStore,if we not open a message store,we can't open any thing on it
7234 + //so we have to kill message stores openned
7235 + nsVoidArray m_MDBArray;
7238 #endif // nsMapiAddressBook_h___
7239 *** misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp Tue Oct 30 08:59:16 2001
7240 --- misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp Tue Jan 15 13:34:35 2008
7241 ***************
7242 *** 47,52 ****
7243 --- 47,68 ----
7245 #define PRINTF(args) PR_LOG(gWabAddressBookLog, PR_LOG_DEBUG, args)
7247 + enum
7249 + ContentsColumnEntryId = 0,
7250 + ContentsColumnObjectType,
7251 + ContentsColumnsSize
7252 + } ;
7254 + static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
7256 + ContentsColumnsSize,
7258 + PR_ENTRYID,
7259 + PR_OBJECT_TYPE
7261 + } ;
7263 HMODULE nsWabAddressBook::mLibrary = NULL ;
7264 PRInt32 nsWabAddressBook::mLibUsage = 0 ;
7265 LPWABOPEN nsWabAddressBook::mWABOpen = NULL ;
7266 ***************
7267 *** 95,101 ****
7268 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
7270 nsWabAddressBook::nsWabAddressBook(void)
7271 ! : nsAbWinHelper()
7273 BOOL result = Initialize() ;
7275 --- 111,117 ----
7276 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
7278 nsWabAddressBook::nsWabAddressBook(void)
7279 ! : nsAbWinHelper(),mAddressBook(NULL)
7281 BOOL result = Initialize() ;
7283 ***************
7284 *** 110,118 ****
7285 MOZ_COUNT_DTOR(nsWabAddressBook) ;
7288 BOOL nsWabAddressBook::Initialize(void)
7290 - if (mAddressBook) { return TRUE ; }
7291 nsAutoLock guard(mMutex) ;
7293 if (!LoadWabLibrary()) {
7294 --- 126,379 ----
7295 MOZ_COUNT_DTOR(nsWabAddressBook) ;
7298 + BOOL nsWabAddressBook::GetFolders(nsMapiEntryArray& aFolders)
7300 + aFolders.CleanUp() ;
7301 + nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
7302 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
7303 + ULONG objType = 0 ;
7304 + ULONG rowCount = 0 ;
7305 + SRestriction restriction ;
7306 + SPropTagArray folderColumns ;
7308 + mLastError = OpenEntry(0, NULL, NULL, 0, &objType,
7309 + rootFolder);
7310 + if (HR_FAILED(mLastError)){
7311 + PRINTF(("Cannot open root %08x.\n", mLastError));
7312 + return FALSE;
7314 + mLastError = rootFolder->GetHierarchyTable(0, folders);
7315 + if (HR_FAILED(mLastError)){
7316 + PRINTF(("Cannot get hierarchy %08x.\n", mLastError));
7317 + return FALSE;
7319 + // We only take into account modifiable containers,
7320 + // otherwise, we end up with all the directory services...
7321 + restriction.rt = RES_BITMASK ;
7322 + restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
7323 + restriction.res.resBitMask.relBMR = BMR_NEZ ;
7324 + restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
7325 + mLastError = folders->Restrict(&restriction, 0) ;
7326 + if (HR_FAILED(mLastError)) {
7327 + PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
7329 + folderColumns.cValues = 1 ;
7330 + folderColumns.aulPropTag [0] = PR_ENTRYID ;
7331 + mLastError = folders->SetColumns(&folderColumns, 0) ;
7332 + if (HR_FAILED(mLastError)) {
7333 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
7334 + return FALSE ;
7336 + mLastError = folders->GetRowCount(0, &rowCount) ;
7337 + if (HR_SUCCEEDED(mLastError)) {
7338 + do {
7339 + LPSRowSet rowSet = NULL ;
7341 + rowCount = 0 ;
7342 + mLastError = folders->QueryRows(1, 0, &rowSet) ;
7343 + if (HR_SUCCEEDED(mLastError)) {
7344 + rowCount = rowSet->cRows ;
7345 + if (rowCount > 0) {
7346 + SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
7348 + aFolders.AddItem(currentValue.Value.bin.cb,
7349 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
7351 + MyFreeProws(rowSet) ;
7353 + else {
7354 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
7356 + } while (rowCount > 0) ;
7358 + return HR_SUCCEEDED(mLastError) ;
7360 + BOOL nsWabAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
7361 + nsMapiEntryArray *aList, ULONG aMapiType)
7363 + if (aList) { aList->CleanUp(); }
7364 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
7365 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
7366 + ULONG objType = 0 ;
7367 + ULONG rowCount = 0 ;
7369 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
7370 + &IID_IMAPIContainer, 0, &objType,
7371 + parent) ;
7372 + if (HR_FAILED(mLastError)) {
7373 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
7374 + return FALSE ;
7376 + // Here, flags for WAB and MAPI could be different, so this works
7377 + // only as long as we don't want to use any flag in GetContentsTable
7378 + mLastError = parent->GetContentsTable(0, contents) ;
7379 + if (HR_FAILED(mLastError)) {
7380 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
7381 + return FALSE ;
7383 + if (aRestriction) {
7384 + mLastError = contents->Restrict(aRestriction, 0) ;
7385 + if (HR_FAILED(mLastError)) {
7386 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
7387 + return FALSE ;
7390 + int entryId = ContentsColumnEntryId ;
7391 + int objectType = ContentsColumnObjectType ;
7393 + if (aRestriction)
7395 + LPSPropTagArray allColumns = NULL ;
7397 + mLastError = contents->QueryColumns(TBL_ALL_COLUMNS, &allColumns) ;
7398 + if (HR_FAILED(mLastError)) {
7399 + PRINTF(("Cannot query columns %08x.\n", mLastError)) ;
7400 + return FALSE ;
7403 + for (unsigned int j = 0 ; j < allColumns->cValues ; ++ j) {
7404 + if (allColumns->aulPropTag [j] == PR_ENTRYID) {
7405 + entryId = j ;
7407 + else if (allColumns->aulPropTag [j] == PR_OBJECT_TYPE) {
7408 + objectType = j ;
7411 + mLastError = contents->SetColumns(allColumns, 0) ;
7412 + if (HR_FAILED(mLastError)) {
7413 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
7414 + return FALSE ;
7416 + FreeBuffer(allColumns) ;
7418 + else
7421 + mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
7422 + if (HR_FAILED(mLastError)) {
7423 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
7424 + return FALSE ;
7426 + }
7428 + mLastError = contents->GetRowCount(0, &rowCount) ;
7429 + if (HR_FAILED(mLastError)) {
7430 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
7431 + return FALSE ;
7433 + do {
7434 + LPSRowSet rowSet = NULL ;
7436 + rowCount = 0 ;
7437 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
7438 + if (HR_FAILED(mLastError)) {
7439 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
7440 + return FALSE ;
7442 + rowCount = rowSet->cRows ;
7443 + if (rowCount > 0 &&
7444 + (aMapiType == 0 ||
7445 + rowSet->aRow->lpProps[objectType].Value.ul == aMapiType)) {
7446 + if (aList) {
7447 + SPropValue& currentValue = rowSet->aRow->lpProps[entryId] ;
7449 + aList->AddItem(currentValue.Value.bin.cb,
7450 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
7454 + MyFreeProws(rowSet) ;
7455 + } while (rowCount > 0) ;
7456 + return TRUE ;
7459 + BOOL nsWabAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
7460 + ULONG aNbProperties, LPSPropValue& aValue,
7461 + ULONG& aValueCount)
7463 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
7464 + IMsgStore * mdb=NULL;
7465 + ULONG objType = 0 ;
7466 + LPSPropTagArray properties = NULL ;
7467 + ULONG i = 0 ;
7469 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
7470 + &IID_IMAPIProp, 0, &objType,
7471 + object) ;
7473 + if (HR_FAILED(mLastError)){
7474 + PRINTF(("Cannot open entry %08x.\n", mLastError));
7475 + return FALSE;
7477 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
7478 + NS_REINTERPRET_CAST(void **, &properties));
7479 + properties->cValues = aNbProperties;
7480 + for (i = 0 ; i < aNbProperties ; ++ i) {
7481 + properties->aulPropTag [i] = aPropertyTags [i];
7483 + mLastError = object->GetProps(properties, 0, &aValueCount, &aValue);
7484 + FreeBuffer(properties);
7485 + if (HR_FAILED(mLastError)){
7486 + PRINTF(("Cannot get props %08x.\n", mLastError));
7488 + return HR_SUCCEEDED(mLastError) ;
7491 + BOOL nsWabAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
7492 + LPSPropValue& aValues)
7494 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
7495 + ULONG objType = 0 ;
7496 + LPSPropProblemArray problems = NULL ;
7498 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
7499 + &IID_IMAPIProp, MAPI_MODIFY, &objType,
7500 + object) ;
7501 + if (HR_FAILED(mLastError)) {
7502 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
7503 + return FALSE ;
7505 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
7506 + if (HR_FAILED(mLastError)) {
7507 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
7508 + return FALSE ;
7510 + if (problems) {
7511 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
7512 + PRINTF(("Problem %d: index %d code %08x.\n", i,
7513 + problems->aProblem [i].ulIndex,
7514 + problems->aProblem [i].scode));
7517 + mLastError = object->SaveChanges(0) ;
7518 + if (HR_FAILED(mLastError)) {
7519 + PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
7521 + return HR_SUCCEEDED(mLastError) ;
7524 + BOOL nsWabAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
7526 + LPENTRYID entryId = NULL;
7527 + ULONG byteCount = 0;
7529 + mLastError = mAddressBook->GetPAB(&byteCount, &entryId);
7530 + if (HR_FAILED(mLastError)){
7531 + PRINTF(("Cannot get PAB %08x.\n", mLastError));
7532 + return FALSE;
7534 + aContainer.Assign(byteCount, entryId);
7535 + FreeBuffer(entryId) ;
7536 + return TRUE ;
7539 + BOOL nsWabAddressBook::IsOK(void)
7541 + return mAddressBook != NULL ;
7544 BOOL nsWabAddressBook::Initialize(void)
7546 nsAutoLock guard(mMutex) ;
7548 if (!LoadWabLibrary()) {
7549 *** misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.h Fri Sep 28 22:06:25 2001
7550 --- misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.h Tue Jan 15 13:34:35 2008
7551 ***************
7552 *** 47,52 ****
7553 --- 47,61 ----
7554 nsWabAddressBook(void) ;
7555 virtual ~nsWabAddressBook(void) ;
7557 + // Get the top address books
7558 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
7560 + // Get a default address book container
7561 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
7562 + // Is the helper correctly initialised?
7563 + virtual BOOL IsOK(void);
7564 + static void FreeWabLibrary(void) ;
7566 protected :
7567 // Session and address book that will be shared by all instances
7568 // (see nsMapiAddressBook.h for details)
7569 ***************
7570 *** 57,71 ****
7571 static HMODULE mLibrary ;
7572 static LPWABOPEN mWABOpen ;
7574 // Load the WAB environment
7575 BOOL Initialize(void) ;
7576 // Allocation of a buffer for transmission to interfaces
7577 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
7578 // Destruction of a buffer provided by the interfaces
7579 virtual void FreeBuffer(LPVOID aBuffer) ;
7580 // Manage the library
7581 static BOOL LoadWabLibrary(void) ;
7582 - static void FreeWabLibrary(void) ;
7584 private :
7586 --- 66,111 ----
7587 static HMODULE mLibrary ;
7588 static LPWABOPEN mWABOpen ;
7590 + LPADRBOOK mAddressBook ;
7592 // Load the WAB environment
7593 BOOL Initialize(void) ;
7595 + virtual HRESULT OpenEntry(ULONG cbEntryID,
7596 + LPENTRYID lpEntryID,
7597 + LPCIID lpInterface,
7598 + ULONG ulFlags,
7599 + ULONG FAR * lpulObjType,
7600 + LPUNKNOWN FAR * lppUnk
7603 + return mAddressBook->OpenEntry(cbEntryID,
7604 + lpEntryID,
7605 + lpInterface,
7606 + ulFlags,
7607 + lpulObjType,
7608 + lppUnk
7609 + );
7613 + // Retrieve the contents of a container, with an optional restriction
7614 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
7615 + nsMapiEntryArray *aList, ULONG aMapiType) ;
7616 + // Retrieve the values of a set of properties on a MAPI object
7617 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
7618 + ULONG aNbProperties,
7619 + LPSPropValue& aValues, ULONG& aValueCount) ;
7620 + // Set the values of a set of properties on a MAPI object
7621 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
7622 + LPSPropValue& aValues) ;
7624 // Allocation of a buffer for transmission to interfaces
7625 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
7626 // Destruction of a buffer provided by the interfaces
7627 virtual void FreeBuffer(LPVOID aBuffer) ;
7628 // Manage the library
7629 static BOOL LoadWabLibrary(void) ;
7631 private :
7633 *** misc/mozilla/mailnews/base/src/nsMessengerWinIntegration.cpp Mon Feb 9 23:48:47 2004
7634 --- misc/build/mozilla/mailnews/base/src/nsMessengerWinIntegration.cpp Tue Jan 15 13:34:35 2008
7635 ***************
7636 *** 713,720 ****
7637 --- 713,725 ----
7639 if (mUseWideCharBiffIcon)
7641 + #ifdef __MINGW32__
7642 + ::wcsncpy( mWideBiffIconData.szTip, NS_REINTERPRET_CAST(LPCWSTR, aToolTipString), toolTipBufSize);
7643 + if (wcslen(NS_REINTERPRET_CAST(LPCWSTR, aToolTipString)) >= toolTipBufSize)
7644 + #else
7645 ::wcsncpy( mWideBiffIconData.szTip, aToolTipString, toolTipBufSize);
7646 if (wcslen(aToolTipString) >= toolTipBufSize)
7647 + #endif
7648 mWideBiffIconData.szTip[toolTipBufSize - 1] = 0;
7650 else
7651 ***************
7652 *** 754,760 ****
7653 --- 759,769 ----
7654 // now we need to copy over any left over tool tip strings
7655 if (mWideBiffIconData.szTip)
7657 + #ifdef __MINGW32__
7658 + const PRUnichar * oldTooltipString = reinterpret_cast<PRUnichar*>(mWideBiffIconData.szTip);
7659 + #else
7660 const PRUnichar * oldTooltipString = mWideBiffIconData.szTip;
7661 + #endif
7662 SetToolTipStringOnIconData(oldTooltipString);
7665 ***************
7666 *** 954,960 ****
7667 --- 963,973 ----
7668 registryUnreadMailCountKey,
7669 sizeof(registryUnreadMailCountKey))))
7671 + #ifdef __MINGW32__
7672 + if (wcscmp(registryUnreadMailCountKey, NS_REINTERPRET_CAST(LPCWSTR, currentUnreadMailCountKey.get()))==0) {
7673 + #else
7674 if (wcscmp(registryUnreadMailCountKey, currentUnreadMailCountKey.get())==0) {
7675 + #endif
7676 nsAutoString deleteKey;
7677 deleteKey.Assign(NS_LITERAL_STRING(UNREADMAILNODEKEY).get());
7678 deleteKey.Append(currentUnreadMailCountKey.get());
7679 ***************
7680 *** 1016,1024 ****
7681 --- 1029,1043 ----
7684 // Write the info into the registry
7685 + #ifdef __MINGW32__
7686 + HRESULT hr = mSHSetUnreadMailCount(NS_REINTERPRET_CAST(LPCWSTR, pBuffer.get()),
7687 + mCurrentUnreadCount,
7688 + NS_REINTERPRET_CAST(LPCWSTR, commandLinerForAppLaunch.get()));
7689 + #else
7690 HRESULT hr = mSHSetUnreadMailCount(pBuffer.get(),
7691 mCurrentUnreadCount,
7692 commandLinerForAppLaunch.get());
7693 + #endif
7696 // do this last
7697 *** misc/mozilla/mailnews/mime/src/mimeeobj.h Fri Sep 28 22:07:42 2001
7698 --- misc/build/mozilla/mailnews/mime/src/mimeeobj.h Tue Jan 15 13:34:35 2008
7699 ***************
7700 *** 54,60 ****
7701 MimeLeafClass leaf;
7704 ! extern MimeExternalObjectClass mimeExternalObjectClass;
7706 struct MimeExternalObject {
7707 MimeLeaf leaf;
7708 --- 54,60 ----
7709 MimeLeafClass leaf;
7712 ! extern "C" MimeExternalObjectClass mimeExternalObjectClass;
7714 struct MimeExternalObject {
7715 MimeLeaf leaf;
7716 *** misc/mozilla/modules/libpref/src/Makefile.in Fri Jan 16 20:22:37 2004
7717 --- misc/build/mozilla/modules/libpref/src/Makefile.in Tue Jan 15 13:34:35 2008
7718 ***************
7719 *** 78,84 ****
7720 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
7721 endif
7723 ! EXTRA_DSO_LDOPTS = \
7724 $(LIBS_DIR) \
7725 $(MOZ_JS_LIBS) \
7726 $(MOZ_COMPONENT_LIBS) \
7727 --- 78,84 ----
7728 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
7729 endif
7731 ! EXTRA_DSO_LDOPTS += \
7732 $(LIBS_DIR) \
7733 $(MOZ_JS_LIBS) \
7734 $(MOZ_COMPONENT_LIBS) \
7735 ***************
7736 *** 89,91 ****
7737 --- 89,92 ----
7738 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, \
7739 all.js mailnews.js editor.js \
7740 aix.js beos.js unix.js winpref.js os2prefs.js openvms.js photon.js)
7742 *** misc/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp Thu Sep 2 01:45:24 2004
7743 --- misc/build/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp Tue Jan 15 13:34:35 2008
7744 ***************
7745 *** 834,841 ****
7746 void
7747 nsHttpConnectionMgr::OnMsgUpdateParam(nsresult status, void *param)
7749 ! PRUint16 name = (PRUint32(param) & 0xFFFF0000) >> 16;
7750 ! PRUint16 value = PRUint32(param) & 0x0000FFFF;
7752 switch (name) {
7753 case MAX_CONNECTIONS:
7754 --- 834,841 ----
7755 void
7756 nsHttpConnectionMgr::OnMsgUpdateParam(nsresult status, void *param)
7758 ! PRUint16 name = (NS_PTR_TO_INT32(param) & 0xFFFF0000) >> 16;
7759 ! PRUint16 value = NS_PTR_TO_INT32(param) & 0x0000FFFF;
7761 switch (name) {
7762 case MAX_CONNECTIONS:
7763 *** misc/mozilla/nsprpub/build/cygwin-wrapper Thu Apr 3 01:22:38 2003
7764 --- misc/build/mozilla/nsprpub/build/cygwin-wrapper Tue Jan 15 13:34:35 2008
7765 ***************
7766 *** 1,4 ****
7767 ! #!/bin/sh
7769 # Stupid wrapper to avoid win32 dospath/cygdrive issues
7771 --- 1,4 ----
7772 ! #!/bin/bash
7774 # Stupid wrapper to avoid win32 dospath/cygdrive issues
7776 ***************
7777 *** 18,23 ****
7778 shift
7779 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
7780 else
7781 ! args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
7783 exec $prog $args
7784 --- 18,57 ----
7785 shift
7786 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
7787 else
7788 ! for i in "${@}"
7789 ! do
7790 ! # The original version missed mounted paths, the new version below
7791 ! # doesn't transform /para as this is most likely a parameter.
7792 ! eval 'notinpath=${i%%'${mountpoint}'/[a-zA-Z]/*}'
7793 ! if ! test "$notinpath" = "$i"; then
7794 ! # found $mountpoint
7795 ! eval 'restpath=${i#'${notinpath}${mountpoint}'/[a-zA-Z]/}'
7796 ! eval 'withdrive=${i#'${notinpath}${mountpoint}'/}'
7797 ! driveletter=${withdrive%%/*}
7798 ! i=${notinpath}${driveletter}:/${restpath}
7799 ! else
7800 ! # check for potential path. Precheck using shell methods
7801 ! doconvert=""
7802 ! # Shortcut -X<path> when path does not begin with '/'
7803 ! noswitch=${i#-[a-zA-Z]}
7804 ! if test "$noswitch" != "$i"; then
7805 ! test "${noswitch#/}" != "$noswitch" && doconvert="1"
7806 ! fi
7807 ! # Precheck for possible path. Consider only absolute paths that contain at least
7808 ! # a second / to prevent converting of /abc parameters.
7809 ! test -z "$doconvert" -a "${i#/[a-zA-Z0-9_.-]*/}" != "$i" && doconvert="1"
7810 ! if test -n "$doconvert"; then
7811 ! # Can be a path. If forking grep would be faster or we could require bash 3
7812 ! # this regexp would be all that's needed to find pathnames that need converting
7813 ! pathname=`echo $i | grep -oE '^(-[a-zA-Z])?/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_./-]+$'`
7814 ! eval 'notinpath=${i%'${pathname}'}'
7815 ! if test "$notinpath" != "$i" -a "$pathname" != "${pathname#/}"; then
7816 ! pathname=`cygpath -am "$pathname"`
7817 ! i=${notinpath}${pathname}
7818 ! fi
7819 ! fi
7820 ! fi
7821 ! args="${args} ${i}"
7822 ! done
7824 exec $prog $args
7825 *** misc/mozilla/nsprpub/config/autoconf.mk.in Sat Mar 22 16:28:52 2003
7826 --- misc/build/mozilla/nsprpub/config/autoconf.mk.in Tue Jan 15 13:34:35 2008
7827 ***************
7828 *** 22,27 ****
7829 --- 22,28 ----
7830 RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
7831 OBJDIR_NAME = @OBJDIR_NAME@
7832 OBJDIR = @OBJDIR@
7833 + LIB_PREFIX = @LIB_PREFIX@
7834 OBJ_SUFFIX = @OBJ_SUFFIX@
7835 LIB_SUFFIX = @LIB_SUFFIX@
7836 DLL_SUFFIX = @DLL_SUFFIX@
7837 *** misc/mozilla/nsprpub/config/rules.mk Tue Sep 16 04:00:28 2003
7838 --- misc/build/mozilla/nsprpub/config/rules.mk Tue Jan 15 13:34:35 2008
7839 ***************
7840 *** 101,119 ****
7841 ifdef LIBRARY_NAME
7842 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
7845 ! # Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
7846 ! # other platforms do not.
7848 ! ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
7849 ! LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
7850 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
7851 ! IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
7852 ! else
7853 ! LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
7854 ! SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
7855 ! IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
7856 ! endif
7858 else
7860 --- 101,109 ----
7861 ifdef LIBRARY_NAME
7862 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
7864 ! LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
7865 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
7866 ! IMPORT_LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
7868 else
7870 *** misc/mozilla/nsprpub/configure Tue Sep 14 23:14:38 2004
7871 --- misc/build/mozilla/nsprpub/configure Tue Jan 15 13:34:35 2008
7872 ***************
7873 *** 2724,2729 ****
7874 --- 2724,2730 ----
7875 LIB_SUFFIX=a
7876 DLL_SUFFIX=so
7877 ASM_SUFFIX=s
7878 + LIB_PREFIX=lib
7879 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
7880 PR_MD_ASFILES=
7881 PR_MD_CSRCS=
7882 ***************
7883 *** 3407,3413 ****
7886 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
7887 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
7888 if test "$MOZ_OBJFORMAT" = "elf"; then
7889 DLL_SUFFIX=so
7890 else
7891 --- 3408,3414 ----
7894 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
7895 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
7896 if test "$MOZ_OBJFORMAT" = "elf"; then
7897 DLL_SUFFIX=so
7898 else
7899 ***************
7900 *** 3861,3867 ****
7901 CC="$CC -mno-cygwin"
7902 CXX="$CXX -mno-cygwin"
7903 DLL_SUFFIX=dll
7904 ! MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
7905 RC=$WINDRES
7906 # Use temp file for windres (bug 213281)
7907 RCFLAGS='-O coff --use-temp-file'
7908 --- 3862,3868 ----
7909 CC="$CC -mno-cygwin"
7910 CXX="$CXX -mno-cygwin"
7911 DLL_SUFFIX=dll
7912 ! MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
7913 RC=$WINDRES
7914 # Use temp file for windres (bug 213281)
7915 RCFLAGS='-O coff --use-temp-file'
7916 ***************
7917 *** 3878,3883 ****
7918 --- 3879,3885 ----
7919 OBJ_SUFFIX=obj
7920 LIB_SUFFIX=lib
7921 DLL_SUFFIX=dll
7922 + LIB_PREFIX=
7924 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
7926 ***************
7927 *** 5634,5639 ****
7928 --- 5636,5642 ----
7929 CC="\$(CYGWIN_WRAPPER) $CC"
7930 CXX="\$(CYGWIN_WRAPPER) $CXX"
7931 RC="\$(CYGWIN_WRAPPER) $RC"
7932 + LD="\$(CYGWIN_WRAPPER) $LD"
7934 esac
7936 ***************
7937 *** 6004,6009 ****
7938 --- 6007,6013 ----
7939 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
7940 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
7941 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
7942 + s%@LIB_PREFIX@%$LIB_PREFIX%g
7943 s%@MKSHLIB@%$MKSHLIB%g
7944 s%@DSO_CFLAGS@%$DSO_CFLAGS%g
7945 s%@DSO_LDOPTS@%$DSO_LDOPTS%g
7946 *** misc/mozilla/nsprpub/configure.in Tue Sep 14 23:14:38 2004
7947 --- misc/build/mozilla/nsprpub/configure.in Tue Jan 15 13:34:36 2008
7948 ***************
7949 *** 922,928 ****
7950 AC_DEFINE(HAVE_BSD_FLOCK)
7951 AC_DEFINE(HAVE_SOCKLEN_T)
7952 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
7953 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
7954 if test "$MOZ_OBJFORMAT" = "elf"; then
7955 DLL_SUFFIX=so
7956 else
7957 --- 922,928 ----
7958 AC_DEFINE(HAVE_BSD_FLOCK)
7959 AC_DEFINE(HAVE_SOCKLEN_T)
7960 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
7961 ! MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
7962 if test "$MOZ_OBJFORMAT" = "elf"; then
7963 DLL_SUFFIX=so
7964 else
7965 *** misc/mozilla/nsprpub/lib/ds/Makefile.in Wed Apr 9 23:49:32 2003
7966 --- misc/build/mozilla/nsprpub/lib/ds/Makefile.in Tue Jan 15 13:34:36 2008
7967 ***************
7968 *** 80,97 ****
7969 OS_LIBS = -lc
7970 endif
7972 ifeq ($(OS_ARCH),SunOS)
7973 OS_LIBS = -lc
7974 MAPFILE = $(OBJDIR)/pldsmap.sun
7975 GARBAGE += $(MAPFILE)
7976 ifdef NS_USE_GCC
7977 ifdef GCC_USE_GNU_LD
7978 ! MKSHLIB += -Wl,--version-script,$(MAPFILE)
7979 else
7980 ! MKSHLIB += -Wl,-M,$(MAPFILE)
7981 endif
7982 else
7983 ! MKSHLIB += -M $(MAPFILE)
7984 endif
7985 endif
7987 --- 80,101 ----
7988 OS_LIBS = -lc
7989 endif
7991 + ifeq ($(OS_ARCH),Linux)
7992 + MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
7993 + endif
7995 ifeq ($(OS_ARCH),SunOS)
7996 OS_LIBS = -lc
7997 MAPFILE = $(OBJDIR)/pldsmap.sun
7998 GARBAGE += $(MAPFILE)
7999 ifdef NS_USE_GCC
8000 ifdef GCC_USE_GNU_LD
8001 ! MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8002 else
8003 ! MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
8004 endif
8005 else
8006 ! MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
8007 endif
8008 endif
8010 *** misc/mozilla/nsprpub/lib/libc/src/Makefile.in Wed Apr 9 23:49:35 2003
8011 --- misc/build/mozilla/nsprpub/lib/libc/src/Makefile.in Tue Jan 15 13:34:36 2008
8012 ***************
8013 *** 90,107 ****
8014 OS_LIBS = -lc
8015 endif
8017 ifeq ($(OS_ARCH),SunOS)
8018 OS_LIBS = -lc
8019 MAPFILE = $(OBJDIR)/plcmap.sun
8020 GARBAGE += $(MAPFILE)
8021 ifdef NS_USE_GCC
8022 ifdef GCC_USE_GNU_LD
8023 ! MKSHLIB += -Wl,--version-script,$(MAPFILE)
8024 else
8025 ! MKSHLIB += -Wl,-M,$(MAPFILE)
8026 endif
8027 else
8028 ! MKSHLIB += -M $(MAPFILE)
8029 endif
8030 endif
8032 --- 90,111 ----
8033 OS_LIBS = -lc
8034 endif
8036 + ifeq ($(OS_ARCH),Linux)
8037 + MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8038 + endif
8040 ifeq ($(OS_ARCH),SunOS)
8041 OS_LIBS = -lc
8042 MAPFILE = $(OBJDIR)/plcmap.sun
8043 GARBAGE += $(MAPFILE)
8044 ifdef NS_USE_GCC
8045 ifdef GCC_USE_GNU_LD
8046 ! MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8047 else
8048 ! MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
8049 endif
8050 else
8051 ! MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
8052 endif
8053 endif
8055 *** misc/mozilla/nsprpub/pr/include/prtypes.h Tue Sep 16 22:30:38 2003
8056 --- misc/build/mozilla/nsprpub/pr/include/prtypes.h Tue Jan 15 13:34:36 2008
8057 ***************
8058 *** 450,456 ****
8060 #ifndef __PRUNICHAR__
8061 #define __PRUNICHAR__
8062 ! #if defined(WIN32) || defined(XP_MAC)
8063 typedef wchar_t PRUnichar;
8064 #else
8065 typedef PRUint16 PRUnichar;
8066 --- 450,456 ----
8068 #ifndef __PRUNICHAR__
8069 #define __PRUNICHAR__
8070 ! #if !defined(__MINGW32__) && (defined(WIN32) || defined(XP_MAC))
8071 typedef wchar_t PRUnichar;
8072 #else
8073 typedef PRUint16 PRUnichar;
8074 *** misc/mozilla/nsprpub/pr/src/misc/prnetdb.c Thu Sep 2 01:44:37 2004
8075 --- misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c Tue Jan 15 13:34:36 2008
8076 ***************
8077 *** 105,111 ****
8078 #define _PR_HAVE_GETPROTO_R_INT
8079 #endif
8081 ! #if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
8082 #define _PR_HAVE_GETPROTO_R
8083 #define _PR_HAVE_5_ARG_GETPROTO_R
8084 #endif
8085 --- 105,112 ----
8086 #define _PR_HAVE_GETPROTO_R_INT
8087 #endif
8089 ! #if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) || \
8090 ! (defined(__FreeBSD__) && __FreeBSD_version > 601103)
8091 #define _PR_HAVE_GETPROTO_R
8092 #define _PR_HAVE_5_ARG_GETPROTO_R
8093 #endif
8094 *** misc/mozilla/profile/src/nsProfile.cpp Sat Apr 24 19:15:40 2004
8095 --- misc/build/mozilla/profile/src/nsProfile.cpp Tue Jan 15 13:34:36 2008
8096 ***************
8097 *** 37,43 ****
8098 --- 37,45 ----
8100 #include "nscore.h"
8101 #include "nsProfile.h"
8102 + #ifdef MOZ_PROFILELOCKING
8103 #include "nsProfileLock.h"
8104 + #endif
8105 #include "nsIPrefService.h"
8106 #include "nsIPrefBranch.h"
8108 ***************
8109 *** 499,510 ****
8110 --- 501,514 ----
8111 profileURLStr = PROFILE_MANAGER_URL;
8112 if (exists)
8114 + #ifdef MOZ_PROFILELOCKING
8115 // If the profile is locked, we need the UI
8116 nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(curProfileDir));
8117 nsProfileLock tempLock;
8118 rv = tempLock.Lock(localFile);
8119 if (NS_FAILED(rv))
8120 profileURLStr = PROFILE_MANAGER_URL;
8121 + #endif
8124 else
8125 ***************
8126 *** 1173,1179 ****
8128 else
8129 isSwitch = PR_FALSE;
8131 nsProfileLock localLock;
8132 nsCOMPtr<nsILocalFile> localProfileDir(do_QueryInterface(profileDir, &rv));
8133 if (NS_FAILED(rv)) return rv;
8134 --- 1177,1183 ----
8136 else
8137 isSwitch = PR_FALSE;
8138 ! #ifdef MOZ_PROFILELOCKING
8139 nsProfileLock localLock;
8140 nsCOMPtr<nsILocalFile> localProfileDir(do_QueryInterface(profileDir, &rv));
8141 if (NS_FAILED(rv)) return rv;
8142 ***************
8143 *** 1183,1189 ****
8144 NS_ERROR("Could not get profile directory lock.");
8145 return rv;
8148 nsCOMPtr<nsIObserverService> observerService =
8149 do_GetService("@mozilla.org/observer-service;1", &rv);
8150 NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
8151 --- 1187,1193 ----
8152 NS_ERROR("Could not get profile directory lock.");
8153 return rv;
8155 ! #endif
8156 nsCOMPtr<nsIObserverService> observerService =
8157 do_GetService("@mozilla.org/observer-service;1", &rv);
8158 NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
8159 ***************
8160 *** 1237,1244 ****
8161 --- 1241,1250 ----
8162 UpdateCurrentProfileModTime(PR_FALSE);
8165 + #ifdef MOZ_PROFILELOCKING
8166 // Do the profile switch
8167 localLock.Unlock(); // gDirServiceProvider will get and hold its own lock
8168 + #endif
8169 gDirServiceProvider->SetProfileDir(profileDir);
8170 mCurrentProfileName.Assign(aCurrentProfile);
8171 gProfileDataAccess->SetCurrentProfile(aCurrentProfile);
8172 *** misc/mozilla/security/coreconf/FreeBSD.mk Thu Mar 27 02:17:25 2003
8173 --- misc/build/mozilla/security/coreconf/FreeBSD.mk Tue Jan 15 13:34:36 2008
8174 ***************
8175 *** 63,69 ****
8177 ARCH = freebsd
8179 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
8181 ifeq ($(MOZ_OBJFORMAT),elf)
8182 DLL_SUFFIX = so
8183 --- 63,69 ----
8185 ARCH = freebsd
8187 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
8189 ifeq ($(MOZ_OBJFORMAT),elf)
8190 DLL_SUFFIX = so
8191 *** misc/mozilla/security/coreconf/Linux.mk Wed Feb 11 03:33:51 2004
8192 --- misc/build/mozilla/security/coreconf/Linux.mk Tue Jan 15 13:34:36 2008
8193 ***************
8194 *** 54,59 ****
8195 --- 54,66 ----
8196 OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8197 CPU_ARCH = m68k
8198 else
8199 + ifeq ($(OS_TEST),ppc64)
8200 + OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8201 + CPU_ARCH = ppc
8202 + ifeq ($(USE_64),1)
8203 + ARCHFLAG = -m64
8204 + endif
8205 + else
8206 ifeq ($(OS_TEST),ppc)
8207 OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8208 CPU_ARCH = ppc
8209 ***************
8210 *** 117,129 ****
8211 endif
8212 endif
8213 endif
8216 LIBC_TAG = _glibc
8218 ifeq ($(OS_RELEASE),2.0)
8219 OS_REL_CFLAGS += -DLINUX2_0
8220 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8221 ifdef BUILD_OPT
8222 OPTIMIZER = -O2
8223 endif
8224 --- 124,137 ----
8225 endif
8226 endif
8227 endif
8228 + endif
8231 LIBC_TAG = _glibc
8233 ifeq ($(OS_RELEASE),2.0)
8234 OS_REL_CFLAGS += -DLINUX2_0
8235 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8236 ifdef BUILD_OPT
8237 OPTIMIZER = -O2
8238 endif
8239 ***************
8240 *** 138,144 ****
8241 OS_PTHREAD = -lpthread
8242 endif
8244 ! OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
8245 OS_LIBS = -L/lib $(OS_PTHREAD) -ldl -lc
8247 ifdef USE_PTHREADS
8248 --- 146,152 ----
8249 OS_PTHREAD = -lpthread
8250 endif
8252 ! OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -ansi -Wall -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
8253 OS_LIBS = -L/lib $(OS_PTHREAD) -ldl -lc
8255 ifdef USE_PTHREADS
8256 ***************
8257 *** 148,154 ****
8258 ARCH = linux
8260 DSO_CFLAGS = -fPIC
8261 ! DSO_LDOPTS = -shared
8262 DSO_LDFLAGS =
8264 # INCLUDES += -I/usr/include -Y/usr/include/linux
8265 --- 156,163 ----
8266 ARCH = linux
8268 DSO_CFLAGS = -fPIC
8269 ! DSO_LDOPTS = -shared $(ARCHFLAG)
8270 ! DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8271 DSO_LDFLAGS =
8273 # INCLUDES += -I/usr/include -Y/usr/include/linux
8274 *** misc/mozilla/security/coreconf/Linux2.1.mk Wed Nov 7 21:58:09 2001
8275 --- misc/build/mozilla/security/coreconf/Linux2.1.mk Tue Jan 15 13:34:36 2008
8276 ***************
8277 *** 36,42 ****
8278 include $(CORE_DEPTH)/coreconf/Linux.mk
8279 ifeq ($(OS_RELEASE),2.1)
8280 OS_REL_CFLAGS += -DLINUX2_1
8281 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8282 ifdef BUILD_OPT
8283 OPTIMIZER = -O2
8284 endif
8285 --- 36,42 ----
8286 include $(CORE_DEPTH)/coreconf/Linux.mk
8287 ifeq ($(OS_RELEASE),2.1)
8288 OS_REL_CFLAGS += -DLINUX2_1
8289 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8290 ifdef BUILD_OPT
8291 OPTIMIZER = -O2
8292 endif
8293 *** misc/mozilla/security/coreconf/Linux2.2.mk Wed Nov 7 21:56:18 2001
8294 --- misc/build/mozilla/security/coreconf/Linux2.2.mk Tue Jan 15 13:34:36 2008
8295 ***************
8296 *** 36,42 ****
8297 include $(CORE_DEPTH)/coreconf/Linux.mk
8299 OS_REL_CFLAGS += -DLINUX2_1
8300 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8301 ifdef BUILD_OPT
8302 OPTIMIZER = -O2
8303 endif
8304 --- 36,42 ----
8305 include $(CORE_DEPTH)/coreconf/Linux.mk
8307 OS_REL_CFLAGS += -DLINUX2_1
8308 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8309 ifdef BUILD_OPT
8310 OPTIMIZER = -O2
8311 endif
8312 *** misc/mozilla/security/coreconf/Linux2.4.mk Wed Nov 7 21:56:18 2001
8313 --- misc/build/mozilla/security/coreconf/Linux2.4.mk Tue Jan 15 13:34:36 2008
8314 ***************
8315 *** 36,42 ****
8316 include $(CORE_DEPTH)/coreconf/Linux.mk
8318 OS_REL_CFLAGS += -DLINUX2_1
8319 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8320 ifdef BUILD_OPT
8321 OPTIMIZER = -O2
8322 endif
8323 --- 36,42 ----
8324 include $(CORE_DEPTH)/coreconf/Linux.mk
8326 OS_REL_CFLAGS += -DLINUX2_1
8327 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8328 ifdef BUILD_OPT
8329 OPTIMIZER = -O2
8330 endif
8331 *** misc/mozilla/security/coreconf/Linux2.5.mk Sun Jan 27 01:45:37 2002
8332 --- misc/build/mozilla/security/coreconf/Linux2.5.mk Tue Jan 15 13:34:36 2008
8333 ***************
8334 *** 36,42 ****
8335 include $(CORE_DEPTH)/coreconf/Linux.mk
8337 OS_REL_CFLAGS += -DLINUX2_1
8338 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8339 ifdef BUILD_OPT
8340 OPTIMIZER = -O2
8341 endif
8342 --- 36,42 ----
8343 include $(CORE_DEPTH)/coreconf/Linux.mk
8345 OS_REL_CFLAGS += -DLINUX2_1
8346 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8347 ifdef BUILD_OPT
8348 OPTIMIZER = -O2
8349 endif
8350 *** misc/mozilla/security/coreconf/Linux2.6.mk Sat Jul 19 23:21:50 2003
8351 --- misc/build/mozilla/security/coreconf/Linux2.6.mk Tue Jan 15 13:34:36 2008
8352 ***************
8353 *** 36,42 ****
8354 include $(CORE_DEPTH)/coreconf/Linux.mk
8356 OS_REL_CFLAGS += -DLINUX2_1
8357 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8358 ifdef BUILD_OPT
8359 OPTIMIZER = -O2
8360 endif
8361 --- 36,42 ----
8362 include $(CORE_DEPTH)/coreconf/Linux.mk
8364 OS_REL_CFLAGS += -DLINUX2_1
8365 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8366 ifdef BUILD_OPT
8367 OPTIMIZER = -O2
8368 endif
8369 *** misc/mozilla/security/coreconf/SunOS5.mk Sat Oct 16 01:52:29 2004
8370 --- misc/build/mozilla/security/coreconf/SunOS5.mk Tue Jan 15 13:34:36 2008
8371 ***************
8372 *** 164,175 ****
8373 --- 164,177 ----
8375 # ld options:
8376 # -G: produce a shared object
8377 + # -R '$ORIGIN': search for dependencies in same directory
8378 # -z defs: no unresolved symbols allowed
8379 ifdef NS_USE_GCC
8380 ifeq ($(USE_64), 1)
8381 DSO_LDOPTS += -m64
8382 endif
8383 DSO_LDOPTS += -shared -h $(notdir $@)
8384 + DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8385 else
8386 ifeq ($(USE_64), 1)
8387 ifeq ($(OS_TEST),i86pc)
8388 ***************
8389 *** 179,184 ****
8390 --- 181,187 ----
8391 endif
8392 endif
8393 DSO_LDOPTS += -G -h $(notdir $@)
8394 + DSO_LDOPTS += -R '$$ORIGIN'
8395 endif
8397 # -KPIC generates position independent code for use in shared libraries.
8398 *** misc/mozilla/security/coreconf/WIN32.mk Tue Sep 14 23:14:39 2004
8399 --- misc/build/mozilla/security/coreconf/WIN32.mk Tue Jan 15 13:34:36 2008
8400 ***************
8401 *** 39,62 ****
8402 DEFAULT_COMPILER = cl
8404 ifdef NS_USE_GCC
8405 ! CC = gcc
8406 ! CCC = g++
8407 ! LINK = ld
8408 ! AR = ar
8409 AR += cr $@
8410 ! RANLIB = ranlib
8411 BSDECHO = echo
8412 ! RC = windres.exe -O coff --use-temp-file
8413 ! LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
8414 else
8415 ! CC = cl
8416 ! CCC = cl
8417 ! LINK = link
8418 ! AR = lib
8419 AR += -NOLOGO -OUT:"$@"
8420 RANLIB = echo
8421 BSDECHO = echo
8422 ! RC = rc.exe
8423 endif
8425 ifdef BUILD_TREE
8426 --- 39,62 ----
8427 DEFAULT_COMPILER = cl
8429 ifdef NS_USE_GCC
8430 ! CC = $(CYGWIN_WRAPPER) gcc
8431 ! CCC = $(CYGWIN_WRAPPER) g++
8432 ! LINK = $(CYGWIN_WRAPPER) ld
8433 ! AR = $(CYGWIN_WRAPPER) ar
8434 AR += cr $@
8435 ! RANLIB = $(CYGWIN_WRAPPER) ranlib
8436 BSDECHO = echo
8437 ! RC = $(CYGWIN_WRAPPER) windres.exe -O coff --use-temp-file
8438 ! LINK_DLL =$(CYGWIN_WRAPPER) $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
8439 else
8440 ! CC = $(CYGWIN_WRAPPER) cl
8441 ! CCC = $(CYGWIN_WRAPPER) cl
8442 ! LINK = $(CYGWIN_WRAPPER) link
8443 ! AR = $(CYGWIN_WRAPPER) lib
8444 AR += -NOLOGO -OUT:"$@"
8445 RANLIB = echo
8446 BSDECHO = echo
8447 ! RC = $(CYGWIN_WRAPPER) rc.exe
8448 endif
8450 ifdef BUILD_TREE
8451 ***************
8452 *** 64,70 ****
8453 else
8454 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
8455 endif
8456 ! NSINSTALL = nsinstall
8458 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
8459 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
8460 --- 64,70 ----
8461 else
8462 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
8463 endif
8464 ! NSINSTALL = $(CYGWIN_WRAPPER) nsinstall
8466 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
8467 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
8468 ***************
8469 *** 87,93 ****
8470 ifdef NS_USE_GCC
8471 OS_CFLAGS += -mno-cygwin -mms-bitfields
8472 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
8473 ! DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
8474 ifdef BUILD_OPT
8475 OPTIMIZER += -O2
8476 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
8477 --- 87,93 ----
8478 ifdef NS_USE_GCC
8479 OS_CFLAGS += -mno-cygwin -mms-bitfields
8480 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
8481 ! DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
8482 ifdef BUILD_OPT
8483 OPTIMIZER += -O2
8484 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
8485 *** misc/mozilla/security/coreconf/WIN954.0.mk Sat Oct 16 01:52:29 2004
8486 --- misc/build/mozilla/security/coreconf/WIN954.0.mk Tue Jan 15 13:34:36 2008
8487 ***************
8488 *** 64,66 ****
8489 --- 64,70 ----
8490 endif
8491 endif
8492 DEFINES += -DWIN95
8494 + ifdef NS_USE_GCC
8495 + NSPR31_LIB_PREFIX = lib
8496 + endif
8497 *** misc/mozilla/security/coreconf/command.mk Fri Feb 15 23:53:12 2002
8498 --- misc/build/mozilla/security/coreconf/command.mk Tue Jan 15 13:34:36 2008
8499 ***************
8500 *** 42,48 ****
8501 LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
8502 LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
8503 NFSPWD = $(NSINSTALL_DIR)/nfspwd
8504 ! CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
8505 $(XCFLAGS)
8506 RANLIB = echo
8507 TAR = /bin/tar
8508 --- 42,48 ----
8509 LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
8510 LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
8511 NFSPWD = $(NSINSTALL_DIR)/nfspwd
8512 ! CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
8513 $(XCFLAGS)
8514 RANLIB = echo
8515 TAR = /bin/tar
8516 *** misc/mozilla/security/coreconf/rules.mk Tue Mar 23 01:56:47 2004
8517 --- misc/build/mozilla/security/coreconf/rules.mk Tue Jan 15 13:34:36 2008
8518 ***************
8519 *** 286,292 ****
8520 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
8521 @$(MAKE_OBJDIR)
8522 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
8523 ! $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS))
8524 else
8525 ifdef XP_OS2_VACPP
8526 $(MKPROG) -Fe$@ $(CFLAGS) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8527 --- 286,292 ----
8528 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
8529 @$(MAKE_OBJDIR)
8530 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
8531 ! $(MKPROG) $(OBJS) -Fe$@ -link $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8532 else
8533 ifdef XP_OS2_VACPP
8534 $(MKPROG) -Fe$@ $(CFLAGS) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8535 ***************
8536 *** 301,311 ****
8537 $(LIBRARY): $(OBJS)
8538 @$(MAKE_OBJDIR)
8539 rm -f $@
8540 - ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
8541 - $(AR) $(subst /,\\,$(OBJS))
8542 - else
8543 $(AR) $(OBJS)
8544 - endif
8545 $(RANLIB) $@
8548 --- 301,307 ----
8549 ***************
8550 *** 340,346 ****
8551 ifdef NS_USE_GCC
8552 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8553 else
8554 ! $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES))
8555 endif
8556 else
8557 ifdef XP_OS2_VACPP
8558 --- 336,342 ----
8559 ifdef NS_USE_GCC
8560 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8561 else
8562 ! $(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8563 endif
8564 else
8565 ifdef XP_OS2_VACPP
8566 ***************
8567 *** 406,423 ****
8568 endif
8570 ifdef NEED_ABSOLUTE_PATH
8571 ! abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
8572 else
8573 ! abspath = $(1)
8574 endif
8576 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8577 @$(MAKE_OBJDIR)
8578 ifdef USE_NT_C_SYNTAX
8579 ! $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8580 else
8581 ifdef NEED_ABSOLUTE_PATH
8582 ! $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8583 else
8584 $(CC) -o $@ -c $(CFLAGS) $<
8585 endif
8586 --- 402,419 ----
8587 endif
8589 ifdef NEED_ABSOLUTE_PATH
8590 ! mozabspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
8591 else
8592 ! mozabspath = $(1)
8593 endif
8595 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8596 @$(MAKE_OBJDIR)
8597 ifdef USE_NT_C_SYNTAX
8598 ! $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8599 else
8600 ifdef NEED_ABSOLUTE_PATH
8601 ! $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8602 else
8603 $(CC) -o $@ -c $(CFLAGS) $<
8604 endif
8605 ***************
8606 *** 425,434 ****
8608 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8609 ifdef USE_NT_C_SYNTAX
8610 ! $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8611 else
8612 ifdef NEED_ABSOLUTE_PATH
8613 ! $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8614 else
8615 $(CC) -o $@ -c $(CFLAGS) $<
8616 endif
8617 --- 421,430 ----
8619 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8620 ifdef USE_NT_C_SYNTAX
8621 ! $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8622 else
8623 ifdef NEED_ABSOLUTE_PATH
8624 ! $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8625 else
8626 $(CC) -o $@ -c $(CFLAGS) $<
8627 endif
8628 ***************
8629 *** 457,466 ****
8630 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
8631 @$(MAKE_OBJDIR)
8632 ifdef USE_NT_C_SYNTAX
8633 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8634 else
8635 ifdef NEED_ABSOLUTE_PATH
8636 ! $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8637 else
8638 $(CCC) -o $@ -c $(CFLAGS) $<
8639 endif
8640 --- 453,462 ----
8641 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
8642 @$(MAKE_OBJDIR)
8643 ifdef USE_NT_C_SYNTAX
8644 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8645 else
8646 ifdef NEED_ABSOLUTE_PATH
8647 ! $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8648 else
8649 $(CCC) -o $@ -c $(CFLAGS) $<
8650 endif
8651 ***************
8652 *** 481,490 ****
8653 rm -f $(OBJDIR)/t_$*.cc
8654 else
8655 ifdef USE_NT_C_SYNTAX
8656 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8657 else
8658 ifdef NEED_ABSOLUTE_PATH
8659 ! $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8660 else
8661 $(CCC) -o $@ -c $(CFLAGS) $<
8662 endif
8663 --- 477,486 ----
8664 rm -f $(OBJDIR)/t_$*.cc
8665 else
8666 ifdef USE_NT_C_SYNTAX
8667 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8668 else
8669 ifdef NEED_ABSOLUTE_PATH
8670 ! $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8671 else
8672 $(CCC) -o $@ -c $(CFLAGS) $<
8673 endif
8674 *** misc/mozilla/security/manager/Makefile.in Tue Mar 23 05:15:56 2004
8675 --- misc/build/mozilla/security/manager/Makefile.in Tue Jan 15 13:34:36 2008
8676 ***************
8677 *** 89,94 ****
8678 --- 89,95 ----
8679 endif
8680 ifeq ($(OS_ARCH),WINNT)
8681 DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
8682 + DEFAULT_GMAKE_FLAGS += CYGWIN_WRAPPER=@CYGWIN_WRAPPER@
8683 ifdef MOZ_DEBUG
8684 ifndef MOZ_NO_DEBUG_RTL
8685 DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
8686 *** misc/mozilla/security/nss/cmd/shlibsign/Makefile Wed Apr 16 00:42:09 2003
8687 --- misc/build/mozilla/security/nss/cmd/shlibsign/Makefile Tue Jan 15 13:34:36 2008
8688 ***************
8689 *** 103,109 ****
8690 --- 103,113 ----
8691 ifeq ($(OS_TARGET), OS2)
8692 @cmd.exe /c sign.cmd $(DIST) $(OBJDIR) $(OS_TARGET) $<
8693 else
8694 + ifeq ($(OS_TARGET), WIN95)
8695 + @sh $(CYGWIN_WRAPPER) ./sign.sh $(DIST) $(OBJDIR) $(OS_TARGET) $<
8696 + else
8697 @sh ./sign.sh $(DIST) $(OBJDIR) $(OS_TARGET) $<
8698 + endif
8699 endif
8701 libs install :: $(CHECKLOC)
8702 *** misc/mozilla/security/nss/lib/ckfw/builtins/config.mk Sat Oct 16 01:52:32 2004
8703 --- misc/build/mozilla/security/nss/lib/ckfw/builtins/config.mk Tue Jan 15 13:34:36 2008
8704 ***************
8705 *** 59,67 ****
8706 DSO_LDOPTS = -bundle
8707 endif
8709 - ifeq ($(OS_TARGET),SunOS)
8710 - # The -R '$ORIGIN' linker option instructs this library to search for its
8711 - # dependencies in the same directory where it resides.
8712 - MKSHLIB += -R '$$ORIGIN'
8713 - endif
8715 --- 59,62 ----
8716 *** misc/mozilla/security/nss/lib/freebl/Makefile Sat Oct 16 01:52:33 2004
8717 --- misc/build/mozilla/security/nss/lib/freebl/Makefile Tue Jan 15 13:34:36 2008
8718 ***************
8719 *** 179,189 ****
8721 # Note: -xarch=v8 or v9 is now done in coreconf
8722 ifeq ($(OS_TARGET),SunOS)
8724 - # The -R '$ORIGIN' linker option instructs this library to search for its
8725 - # dependencies in the same directory where it resides.
8726 - MKSHLIB += -R '$$ORIGIN'
8728 ifeq ($(CPU_ARCH),sparc)
8729 ifndef NS_USE_GCC
8730 ifdef USE_HYBRID
8731 --- 179,184 ----
8732 ***************
8733 *** 199,205 ****
8734 MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
8735 endif # GCC_USE_GNU_LD
8736 else
8737 ! MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
8738 endif # NS_USE_GCC
8739 ifdef USE_PURE_32
8740 # this builds for Sparc v8 pure 32-bit architecture
8741 --- 194,200 ----
8742 MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
8743 endif # GCC_USE_GNU_LD
8744 else
8745 ! MKSHLIB += -z defs -z now -z text -M mapfile.Solaris
8746 endif # NS_USE_GCC
8747 ifdef USE_PURE_32
8748 # this builds for Sparc v8 pure 32-bit architecture
8749 *** misc/mozilla/security/nss/lib/nss/config.mk Sat Oct 16 01:52:33 2004
8750 --- misc/build/mozilla/security/nss/lib/nss/config.mk Tue Jan 15 13:34:36 2008
8751 ***************
8752 *** 107,120 ****
8753 # The -R '$ORIGIN' linker option instructs this library to search for its
8754 # dependencies in the same directory where it resides.
8755 ifeq ($(USE_64), 1)
8756 ! MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1/sparcv9:/usr/lib/mps/sparcv9'
8757 else
8758 ! MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
8759 ! endif
8760 ! else
8761 ! MKSHLIB += -R '$$ORIGIN'
8762 ! endif
8763 ! endif
8766 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
8767 --- 107,118 ----
8768 # The -R '$ORIGIN' linker option instructs this library to search for its
8769 # dependencies in the same directory where it resides.
8770 ifeq ($(USE_64), 1)
8771 ! DSO_LDOPTS += -R /usr/lib/mps/secv1/sparcv9:/usr/lib/mps/sparcv9
8772 else
8773 ! DSO_LDOPTS += -R /usr/lib/mps/secv1:/usr/lib/mps
8774 ! endif # USE_64
8775 ! endif # BUILD_SUN_PKG
8776 ! endif # SunOS
8779 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
8780 *** misc/mozilla/security/nss/lib/nss/nss.def Sat Oct 16 01:52:33 2004
8781 --- misc/build/mozilla/security/nss/lib/nss/nss.def Tue Jan 15 13:34:36 2008
8782 ***************
8783 *** 60,65 ****
8784 --- 60,66 ----
8785 CERT_CheckCertValidTimes;
8786 CERT_CreateCertificateRequest;
8787 CERT_ChangeCertTrust;
8788 + CERT_DecodeDERCertificate;
8789 CERT_DecodeDERCrl;
8790 CERT_DestroyCertificateRequest;
8791 CERT_DestroyCertList;
8792 *** misc/mozilla/security/nss/lib/pki1/oiddata.h Fri Jan 4 06:22:07 2002
8793 --- misc/build/mozilla/security/nss/lib/pki1/oiddata.h Tue Jan 15 13:34:36 2008
8794 ***************
8795 *** 39,49 ****
8796 static const char OIDDATA_CVS_ID[] = "@(#) $RCSfile$ $Revision$ $Date$ $Name$ ; @(#) $RCSfile$ $Revision$ $Date$ $Name$";
8797 #endif /* DEBUG */
8799 #ifndef NSSPKI1T_H
8800 #include "nsspki1t.h"
8801 #endif /* NSSPKI1T_H */
8803 ! extern const NSSOID nss_builtin_oids[];
8804 extern const PRUint32 nss_builtin_oid_count;
8806 /*extern const nssAttributeTypeAliasTable nss_attribute_type_aliases[];*/
8807 --- 39,50 ----
8808 static const char OIDDATA_CVS_ID[] = "@(#) $RCSfile$ $Revision$ $Date$ $Name$ ; @(#) $RCSfile$ $Revision$ $Date$ $Name$";
8809 #endif /* DEBUG */
8811 + #include "pki1t.h"
8812 #ifndef NSSPKI1T_H
8813 #include "nsspki1t.h"
8814 #endif /* NSSPKI1T_H */
8816 ! extern const NSSOID *nss_builtin_oids;
8817 extern const PRUint32 nss_builtin_oid_count;
8819 /*extern const nssAttributeTypeAliasTable nss_attribute_type_aliases[];*/
8820 *** misc/mozilla/security/nss/lib/smime/config.mk Sat Oct 16 01:52:34 2004
8821 --- misc/build/mozilla/security/nss/lib/smime/config.mk Tue Jan 15 13:34:36 2008
8822 ***************
8823 *** 85,94 ****
8824 ../pkcs12 \
8825 ../pkcs7 \
8826 $(NULL)
8828 - ifeq ($(OS_TARGET),SunOS)
8829 - # The -R '$ORIGIN' linker option instructs this library to search for its
8830 - # dependencies in the same directory where it resides.
8831 - MKSHLIB += -R '$$ORIGIN'
8832 - endif
8834 --- 85,87 ----
8835 *** misc/mozilla/security/nss/lib/softoken/config.mk Sat Oct 16 01:52:35 2004
8836 --- misc/build/mozilla/security/nss/lib/softoken/config.mk Tue Jan 15 13:34:36 2008
8837 ***************
8838 *** 83,94 ****
8839 $(NULL)
8840 endif
8842 - ifeq ($(OS_TARGET),SunOS)
8843 - # The -R '$ORIGIN' linker option instructs this library to search for its
8844 - # dependencies in the same directory where it resides.
8845 - MKSHLIB += -R '$$ORIGIN'
8846 - endif
8848 ifeq ($(OS_TARGET),WINCE)
8849 DEFINES += -DDBM_USING_NSPR
8850 endif
8851 --- 83,88 ----
8852 *** misc/mozilla/security/nss/lib/ssl/config.mk Sat Oct 16 01:52:35 2004
8853 --- misc/build/mozilla/security/nss/lib/ssl/config.mk Tue Jan 15 13:34:36 2008
8854 ***************
8855 *** 78,87 ****
8856 EXTRA_SHARED_LIBS += -dylib_file @executable_path/libsoftokn3.dylib:$(DIST)/lib/libsoftokn3.dylib
8857 endif
8859 - ifeq ($(OS_TARGET),SunOS)
8860 - # The -R '$ORIGIN' linker option instructs this library to search for its
8861 - # dependencies in the same directory where it resides.
8862 - MKSHLIB += -R '$$ORIGIN'
8863 - endif
8865 endif
8866 --- 78,81 ----
8867 *** misc/mozilla/uriloader/exthandler/win/nsOSHelperAppService.cpp Wed Oct 20 18:26:10 2004
8868 --- misc/build/mozilla/uriloader/exthandler/win/nsOSHelperAppService.cpp Tue Jan 15 13:34:36 2008
8869 ***************
8870 *** 171,183 ****
8871 --- 171,191 ----
8874 DWORD bufSz;
8875 + #ifdef __MINGW32__
8876 + LONG err = ::RegQueryValueExW( hKey, NS_REINTERPRET_CAST(LPCWSTR, pValueName), NULL, NULL, NULL, &bufSz);
8877 + #else
8878 LONG err = ::RegQueryValueExW( hKey, pValueName, NULL, NULL, NULL, &bufSz);
8879 + #endif
8880 if (err == ERROR_SUCCESS) {
8881 PRUnichar* pBytes = new PRUnichar[bufSz];
8882 if (!pBytes)
8883 return PR_FALSE;
8885 + #ifdef __MINGW32__
8886 + err = ::RegQueryValueExW( hKey, NS_REINTERPRET_CAST(LPCWSTR, pValueName), NULL, NULL, (BYTE*)pBytes, &bufSz);
8887 + #else
8888 err = ::RegQueryValueExW( hKey, pValueName, NULL, NULL, (BYTE*)pBytes, &bufSz);
8889 + #endif
8890 if (err != ERROR_SUCCESS) {
8891 delete [] pBytes;
8892 return PR_FALSE;
8893 ***************
8894 *** 263,269 ****
8895 --- 271,281 ----
8896 HKEY fileTypeKey = 0;
8897 LONG rc;
8898 if (mIsNT) {
8899 + #ifdef __MINGW32__
8900 + rc = ::RegOpenKeyExW( HKEY_CLASSES_ROOT, NS_REINTERPRET_CAST(LPCWSTR, fileType.get()), 0, KEY_QUERY_VALUE, &fileTypeKey );
8901 + #else
8902 rc = ::RegOpenKeyExW( HKEY_CLASSES_ROOT, fileType.get(), 0, KEY_QUERY_VALUE, &fileTypeKey );
8903 + #endif
8905 else {
8906 nsCAutoString ansiKey;
8907 *** misc/mozilla/webshell/tests/viewer/Makefile.in Thu Apr 8 10:06:32 2004
8908 --- misc/build/mozilla/webshell/tests/viewer/Makefile.in Tue Jan 15 13:34:36 2008
8909 ***************
8910 *** 163,169 ****
8911 GTK_LIBS = unix/gtk/libviewer_gtk_s.a -lgtksuperwin $(XP_LIBS) $(MOZ_GTK_LDFLAGS)
8913 XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS))
8914 ! XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(LIB_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
8916 EXTRA_DEPS = \
8917 $(XP_DIST_DEP_LIBS) \
8918 --- 163,169 ----
8919 GTK_LIBS = unix/gtk/libviewer_gtk_s.a -lgtksuperwin $(XP_LIBS) $(MOZ_GTK_LDFLAGS)
8921 XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS))
8922 ! XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(DLL_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
8924 EXTRA_DEPS = \
8925 $(XP_DIST_DEP_LIBS) \
8926 *** misc/mozilla/widget/src/gtk2/nsDragService.cpp Thu Oct 30 02:48:41 2003
8927 --- misc/build/mozilla/widget/src/gtk2/nsDragService.cpp Tue Jan 15 13:34:36 2008
8928 ***************
8929 *** 838,844 ****
8930 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8931 listTarget->target = g_strdup(gMimeListType);
8932 listTarget->flags = 0;
8933 ! listTarget->info = (guint)listAtom;
8934 PR_LOG(sDragLm, PR_LOG_DEBUG,
8935 ("automatically adding target %s with id %ld\n",
8936 listTarget->target, listAtom));
8937 --- 838,844 ----
8938 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8939 listTarget->target = g_strdup(gMimeListType);
8940 listTarget->flags = 0;
8941 ! listTarget->info = GPOINTER_TO_UINT(listAtom);
8942 PR_LOG(sDragLm, PR_LOG_DEBUG,
8943 ("automatically adding target %s with id %ld\n",
8944 listTarget->target, listAtom));
8945 ***************
8946 *** 877,883 ****
8947 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8948 listTarget->target = g_strdup(gTextUriListType);
8949 listTarget->flags = 0;
8950 ! listTarget->info = (guint)listAtom;
8951 PR_LOG(sDragLm, PR_LOG_DEBUG,
8952 ("automatically adding target %s with \
8953 id %ld\n", listTarget->target, listAtom));
8954 --- 877,883 ----
8955 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8956 listTarget->target = g_strdup(gTextUriListType);
8957 listTarget->flags = 0;
8958 ! listTarget->info = GPOINTER_TO_UINT(listAtom);
8959 PR_LOG(sDragLm, PR_LOG_DEBUG,
8960 ("automatically adding target %s with \
8961 id %ld\n", listTarget->target, listAtom));
8962 ***************
8963 *** 914,920 ****
8964 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8965 target->target = g_strdup(flavorStr);
8966 target->flags = 0;
8967 ! target->info = (guint)atom;
8968 PR_LOG(sDragLm, PR_LOG_DEBUG,
8969 ("adding target %s with id %ld\n",
8970 target->target, atom));
8971 --- 914,920 ----
8972 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8973 target->target = g_strdup(flavorStr);
8974 target->flags = 0;
8975 ! target->info = GPOINTER_TO_UINT(atom);
8976 PR_LOG(sDragLm, PR_LOG_DEBUG,
8977 ("adding target %s with id %ld\n",
8978 target->target, atom));
8979 ***************
8980 *** 931,937 ****
8981 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8982 plainTarget->target = g_strdup(kTextMime);
8983 plainTarget->flags = 0;
8984 ! plainTarget->info = (guint)plainAtom;
8985 PR_LOG(sDragLm, PR_LOG_DEBUG,
8986 ("automatically adding target %s with \
8987 id %ld\n", plainTarget->target, plainAtom));
8988 --- 931,937 ----
8989 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8990 plainTarget->target = g_strdup(kTextMime);
8991 plainTarget->flags = 0;
8992 ! plainTarget->info = GPOINTER_TO_UINT(plainAtom);
8993 PR_LOG(sDragLm, PR_LOG_DEBUG,
8994 ("automatically adding target %s with \
8995 id %ld\n", plainTarget->target, plainAtom));
8996 ***************
8997 *** 948,954 ****
8998 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8999 urlTarget->target = g_strdup(gMozUrlType);
9000 urlTarget->flags = 0;
9001 ! urlTarget->info = (guint)urlAtom;
9002 PR_LOG(sDragLm, PR_LOG_DEBUG,
9003 ("automatically adding target %s with \
9004 id %ld\n", urlTarget->target, urlAtom));
9005 --- 948,954 ----
9006 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
9007 urlTarget->target = g_strdup(gMozUrlType);
9008 urlTarget->flags = 0;
9009 ! urlTarget->info = GPOINTER_TO_UINT(urlAtom);
9010 PR_LOG(sDragLm, PR_LOG_DEBUG,
9011 ("automatically adding target %s with \
9012 id %ld\n", urlTarget->target, urlAtom));
9013 *** misc/mozilla/widget/src/windows/nsDataObj.cpp Wed Oct 27 07:50:31 2004
9014 --- misc/build/mozilla/widget/src/windows/nsDataObj.cpp Tue Jan 15 13:34:36 2008
9015 ***************
9016 *** 504,515 ****
9017 --- 504,523 ----
9018 return E_OUTOFMEMORY;
9020 char titleStr[MAX_PATH+1];
9021 + #ifdef __MINGW32__
9022 + int lenTitleStr = WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, title.get()), title.Length(), titleStr, MAX_PATH, NULL, NULL);
9023 + #else
9024 int lenTitleStr = WideCharToMultiByte(CP_ACP, 0, title.get(), title.Length(), titleStr, MAX_PATH, NULL, NULL);
9025 + #endif
9026 if (!lenTitleStr && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
9027 // this is a very rare situation
9028 int len = title.Length() - 1;
9029 while ((len > 0) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
9030 + #ifdef __MINGW32__
9031 + lenTitleStr = WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, title.get()), len--, titleStr, MAX_PATH, NULL, NULL);
9032 + #else
9033 lenTitleStr = WideCharToMultiByte(CP_ACP, 0, title.get(), len--, titleStr, MAX_PATH, NULL, NULL);
9034 + #endif
9037 titleStr[lenTitleStr] = '\0';
9038 *** misc/mozilla/widget/src/windows/nsFilePicker.cpp Wed Dec 8 22:58:30 2004
9039 --- misc/build/mozilla/widget/src/windows/nsFilePicker.cpp Tue Jan 15 13:34:36 2008
9040 ***************
9041 *** 117,123 ****
9042 --- 117,127 ----
9044 PRBool result = PR_FALSE;
9045 PRUnichar fileBuffer[FILE_BUFFER_SIZE+1];
9046 + #ifdef __MINGW32__
9047 + wcsncpy(NS_REINTERPRET_CAST(LPWSTR, fileBuffer), NS_REINTERPRET_CAST(LPCWSTR, mDefault.get()), FILE_BUFFER_SIZE);
9048 + #else
9049 wcsncpy(fileBuffer, mDefault.get(), FILE_BUFFER_SIZE);
9050 + #endif
9052 NS_NAMED_LITERAL_STRING(htmExt, "html");
9053 nsAutoString initialDir;
9054 ***************
9055 *** 133,146 ****
9056 --- 137,158 ----
9058 if (mMode == modeGetFolder) {
9059 PRUnichar dirBuffer[MAX_PATH+1];
9060 + #ifdef __MINGW32__
9061 + wcsncpy(NS_REINTERPRET_CAST(LPWSTR, dirBuffer), NS_REINTERPRET_CAST(LPCWSTR, initialDir.get()), MAX_PATH);
9062 + #else
9063 wcsncpy(dirBuffer, initialDir.get(), MAX_PATH);
9064 + #endif
9066 BROWSEINFOW browserInfo;
9067 browserInfo.hwndOwner = (HWND)
9068 (mParentWidget.get() ? mParentWidget->GetNativeData(NS_NATIVE_WINDOW) : 0);
9069 browserInfo.pidlRoot = nsnull;
9070 browserInfo.pszDisplayName = (LPWSTR)dirBuffer;
9071 + #ifdef __MINGW32__
9072 + browserInfo.lpszTitle = NS_REINTERPRET_CAST(LPCWSTR, mTitle.get());
9073 + #else
9074 browserInfo.lpszTitle = mTitle.get();
9075 + #endif
9076 browserInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
9077 if (initialDir.Length()) // convert folder path to native, the strdup copy will be released in BrowseCallbackProc
9079 ***************
9080 *** 183,189 ****
9081 --- 195,205 ----
9082 nsString filterBuffer = mFilterList;
9084 if (!initialDir.IsEmpty()) {
9085 + #ifdef __MINGW32__
9086 + ofn.lpstrInitialDir = NS_REINTERPRET_CAST(LPCWSTR, initialDir.get());
9087 + #else
9088 ofn.lpstrInitialDir = initialDir.get();
9089 + #endif
9092 ofn.lpstrTitle = (LPCWSTR)mTitle.get();
9093 ***************
9094 *** 191,203 ****
9095 --- 207,227 ----
9096 ofn.nFilterIndex = mSelectedType;
9097 ofn.hwndOwner = (HWND)
9098 (mParentWidget.get() ? mParentWidget->GetNativeData(NS_NATIVE_WINDOW) : 0);
9099 + #ifdef __MINGW32__
9100 + ofn.lpstrFile = NS_REINTERPRET_CAST(LPWSTR, fileBuffer);
9101 + #else
9102 ofn.lpstrFile = fileBuffer;
9103 + #endif
9104 ofn.nMaxFile = FILE_BUFFER_SIZE;
9106 ofn.Flags = OFN_NOCHANGEDIR | OFN_SHAREAWARE | OFN_LONGNAMES | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
9108 if (!mDefaultExtension.IsEmpty()) {
9109 + #ifdef __MINGW32__
9110 + ofn.lpstrDefExt = NS_REINTERPRET_CAST(LPCWSTR, mDefaultExtension.get());
9111 + #else
9112 ofn.lpstrDefExt = mDefaultExtension.get();
9113 + #endif
9115 else {
9116 // Get file extension from suggested filename
9117 ***************
9118 *** 217,223 ****
9119 --- 241,251 ----
9120 //XXX Actually, behavior is sort of weird:
9121 // often appends ".html" even if you have an extension
9122 // It obeys your extension if you put quotes around name
9123 + #ifdef __MINGW32__
9124 + ofn.lpstrDefExt = NS_REINTERPRET_CAST(LPCWSTR, htmExt.get());
9125 + #else
9126 ofn.lpstrDefExt = htmExt.get();
9127 + #endif
9131 *** misc/mozilla/widget/src/windows/nsWindow.cpp Sat May 29 22:27:51 2004
9132 --- misc/build/mozilla/widget/src/windows/nsWindow.cpp Tue Jan 15 13:34:36 2008
9133 ***************
9134 *** 444,449 ****
9135 --- 444,452 ----
9137 // VC++5.0 header doesn't have reconvertion structure and message.
9138 #ifndef WM_IME_REQUEST
9139 + #define WM_IME_REQUEST 0x0288
9140 + #endif
9141 + #ifndef IMR_RECONVERTSTRING
9142 typedef struct tagRECONVERTSTRING {
9143 DWORD dwSize;
9144 DWORD dwVersion;
9145 ***************
9146 *** 456,462 ****
9147 } RECONVERTSTRING, FAR * LPRECONVERTSTRING;
9149 #define IMR_RECONVERTSTRING 0x0004
9150 - #define WM_IME_REQUEST 0x0288
9151 #endif
9153 // from http://msdn.microsoft.com/library/specs/msime.h
9154 --- 459,464 ----
9155 ***************
9156 *** 480,486 ****
9157 --- 482,490 ----
9159 #ifndef WM_APPCOMMAND
9160 #define WM_APPCOMMAND 0x0319
9161 + #endif
9163 + #ifndef APPCOMMAND_BROWSER_BACKWARD
9164 #define APPCOMMAND_BROWSER_BACKWARD 1
9165 #define APPCOMMAND_BROWSER_FORWARD 2
9166 #define APPCOMMAND_BROWSER_REFRESH 3
9167 ***************
9168 *** 517,523 ****
9169 //#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
9170 //#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
9172 ! #endif // #ifndef WM_APPCOMMAND
9174 static PRBool LangIDToCP(WORD aLangID, UINT& oCP)
9176 --- 521,527 ----
9177 //#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
9178 //#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
9180 ! #endif // #ifndef APPCOMMAND_BROWSER_BACKWARD
9182 static PRBool LangIDToCP(WORD aLangID, UINT& oCP)
9184 ***************
9185 *** 5529,5535 ****
9186 --- 5533,5543 ----
9187 if(acp)
9189 int outlen = ::WideCharToMultiByte( CP_ACP, 0,
9190 + #ifdef __MINGW32__
9191 + NS_REINTERPRET_CAST(LPCWSTR, aStr.get()), aStr.Length(),
9192 + #else
9193 aStr.get(), aStr.Length(),
9194 + #endif
9195 acp, acplen, NULL, NULL);
9196 if ( outlen >= 0)
9197 acp[outlen] = '\0'; // null terminate
9198 ***************
9199 *** 5696,5702 ****
9200 --- 5704,5714 ----
9201 unicharSize = ::MultiByteToWideChar(gCurrentKeyboardCP,MB_PRECOMPOSED,
9202 mIMECompString->get(),
9203 mIMECompString->Length(),
9204 + #ifdef __MINGW32__
9205 + NS_REINTERPRET_CAST(LPWSTR, mIMECompUnicode->BeginWriting()),
9206 + #else
9207 mIMECompUnicode->BeginWriting(),
9208 + #endif
9209 unicharSize+1);
9210 mIMECompUnicode->SetLength(unicharSize);
9212 ***************
9213 *** 6472,6478 ****
9214 --- 6484,6494 ----
9215 *oResult = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR);
9216 } else {
9217 len = ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9218 + #ifdef __MINGW32__
9219 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9220 + #else
9221 mIMEReconvertUnicode,
9222 + #endif
9223 nsCRT::strlen(mIMEReconvertUnicode),
9224 NULL, 0, NULL, NULL);
9225 *oResult = sizeof(RECONVERTSTRING) + len;
9226 ***************
9227 *** 6491,6497 ****
9228 --- 6507,6517 ----
9229 *oResult = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR);
9230 } else {
9231 len = ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9232 + #ifdef __MINGW32__
9233 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9234 + #else
9235 mIMEReconvertUnicode,
9236 + #endif
9237 nsCRT::strlen(mIMEReconvertUnicode),
9238 NULL, 0, NULL, NULL);
9239 *oResult = sizeof(RECONVERTSTRING) + len;
9240 ***************
9241 *** 6512,6518 ****
9242 --- 6532,6542 ----
9243 mIMEReconvertUnicode, len * sizeof(WCHAR));
9244 } else {
9245 ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9246 + #ifdef __MINGW32__
9247 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9248 + #else
9249 mIMEReconvertUnicode,
9250 + #endif
9251 nsCRT::strlen(mIMEReconvertUnicode),
9252 (LPSTR) (aData + sizeof(RECONVERTSTRING)),
9253 len,
9254 *** misc/mozilla/xpcom/base/nsStackFrameUnix.cpp Mon Mar 8 08:47:44 2004
9255 --- misc/build/mozilla/xpcom/base/nsStackFrameUnix.cpp Tue Jan 15 13:34:36 2008
9256 ***************
9257 *** 78,102 ****
9261 ! #if defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code
9263 - #include <setjmp.h>
9264 - //
9266 void DumpStackToFile(FILE* aStream)
9268 - jmp_buf jb;
9269 - setjmp(jb);
9271 // Stack walking code courtesy Kipp's "leaky".
9273 ! // Get the frame pointer out of the jmp_buf
9274 ! void **bp = (void**)
9275 ! #if defined(__i386)
9276 ! (jb[0].__jmpbuf[JB_BP]);
9277 ! #elif defined(PPC)
9278 ! (jb[0].__jmpbuf[JB_GPR1]);
9279 ! #endif
9281 int skip = 2;
9282 for ( ; (void**)*bp > bp; bp = (void**)*bp) {
9283 --- 78,92 ----
9287 ! #if defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code
9290 void DumpStackToFile(FILE* aStream)
9292 // Stack walking code courtesy Kipp's "leaky".
9294 ! // Get the frame pointer
9295 ! void **bp = (void**) __builtin_frame_address(0);
9297 int skip = 2;
9298 for ( ; (void**)*bp > bp; bp = (void**)*bp) {
9299 *** misc/mozilla/xpcom/base/nsTraceRefcntImpl.cpp Wed Feb 11 08:16:10 2004
9300 --- misc/build/mozilla/xpcom/base/nsTraceRefcntImpl.cpp Tue Jan 15 13:34:36 2008
9301 ***************
9302 *** 50,68 ****
9304 #if defined(_WIN32)
9305 #include <windows.h>
9306 - #elif defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))
9307 - #include <setjmp.h>
9309 - //
9310 - // On glibc 2.1, the Dl_info api defined in <dlfcn.h> is only exposed
9311 - // if __USE_GNU is defined. I suppose its some kind of standards
9312 - // adherence thing.
9313 - //
9314 - #if (__GLIBC_MINOR__ >= 1) && !defined(__USE_GNU)
9315 - #define __USE_GNU
9316 - #endif
9318 - #include <dlfcn.h>
9319 #endif
9321 #ifdef HAVE_LIBDL
9322 --- 50,55 ----
9323 ***************
9324 *** 484,490 ****
9326 #endif /* NS_BUILD_REFCNT_LOGGING */
9328 ! nsresult
9329 nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
9331 nsresult rv = NS_OK;
9332 --- 471,477 ----
9334 #endif /* NS_BUILD_REFCNT_LOGGING */
9336 ! NS_COM nsresult
9337 nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
9339 nsresult rv = NS_OK;
9340 ***************
9341 *** 561,567 ****
9342 return rv;
9345 ! void
9346 nsTraceRefcntImpl::ResetStatistics()
9348 #ifdef NS_BUILD_REFCNT_LOGGING
9349 --- 548,554 ----
9350 return rv;
9353 ! NS_COM void
9354 nsTraceRefcntImpl::ResetStatistics()
9356 #ifdef NS_BUILD_REFCNT_LOGGING
9357 ***************
9358 *** 850,856 ****
9360 #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
9361 #include "nsStackFrameWin.h"
9362 ! void
9363 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9365 DumpStackToFile(aStream);
9366 --- 837,843 ----
9368 #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
9369 #include "nsStackFrameWin.h"
9370 ! NS_COM void
9371 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9373 DumpStackToFile(aStream);
9374 ***************
9375 *** 858,866 ****
9377 // WIN32 x86 stack walking code
9378 // i386 or PPC Linux stackwalking code or Solaris
9379 ! #elif (defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386)))
9380 #include "nsStackFrameUnix.h"
9381 ! void
9382 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9384 DumpStackToFile(aStream);
9385 --- 845,853 ----
9387 // WIN32 x86 stack walking code
9388 // i386 or PPC Linux stackwalking code or Solaris
9389 ! #elif (defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386)))
9390 #include "nsStackFrameUnix.h"
9391 ! NS_COM void
9392 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9394 DumpStackToFile(aStream);
9395 ***************
9396 *** 960,966 ****
9398 #else // unsupported platform.
9400 ! void
9401 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9403 fprintf(aStream, "write me, dammit!\n");
9404 --- 947,953 ----
9406 #else // unsupported platform.
9408 ! NS_COM void
9409 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9411 fprintf(aStream, "write me, dammit!\n");
9412 *** misc/mozilla/xpcom/base/nscore.h Thu Mar 25 20:55:16 2004
9413 --- misc/build/mozilla/xpcom/base/nscore.h Tue Jan 15 13:34:37 2008
9414 ***************
9415 *** 282,288 ****
9416 * commercial build. When this is fixed there will be no need for the
9417 * |NS_REINTERPRET_CAST| in nsLiteralString.h either.
9419 ! #if defined(HAVE_CPP_2BYTE_WCHAR_T) && (defined(NS_WIN32) || defined(XP_MAC))
9420 typedef wchar_t PRUnichar;
9421 #else
9422 typedef PRUint16 PRUnichar;
9423 --- 282,288 ----
9424 * commercial build. When this is fixed there will be no need for the
9425 * |NS_REINTERPRET_CAST| in nsLiteralString.h either.
9427 ! #if defined(HAVE_CPP_2BYTE_WCHAR_T) && !defined(__MINGW32__) && (defined(NS_WIN32) || defined(XP_MAC))
9428 typedef wchar_t PRUnichar;
9429 #else
9430 typedef PRUint16 PRUnichar;
9431 *** misc/mozilla/xpcom/io/nsLocalFileWin.cpp Thu May 13 22:59:45 2004
9432 --- misc/build/mozilla/xpcom/io/nsLocalFileWin.cpp Tue Jan 15 13:34:37 2008
9433 ***************
9434 *** 552,558 ****
9435 --- 552,562 ----
9438 if (gResolver)
9439 + #ifdef __MINGW32__
9440 + rv = gResolver->Resolve(NS_REINTERPRET_CAST(LPCWSTR, ucsBuf.get()), temp);
9441 + #else
9442 rv = gResolver->Resolve(ucsBuf.get(), temp);
9443 + #endif
9444 else
9445 rv = NS_ERROR_FAILURE;
9447 *** misc/mozilla/xpcom/io/nsNativeCharsetUtils.cpp Mon Nov 8 15:44:27 2004
9448 --- misc/build/mozilla/xpcom/io/nsNativeCharsetUtils.cpp Tue Jan 15 13:34:37 2008
9449 ***************
9450 *** 890,896 ****
9451 --- 890,900 ----
9453 PRUnichar *result = out_iter.get();
9455 + #ifdef __MINGW32__
9456 + ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, NS_REINTERPRET_CAST(LPWSTR, result), resultLen);
9457 + #else
9458 ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, result, resultLen);
9459 + #endif
9461 return NS_OK;
9463 ***************
9464 *** 908,914 ****
9465 --- 912,922 ----
9466 // determine length of result
9467 PRUint32 resultLen = 0;
9469 + #ifdef __MINGW32__
9470 + int n = ::WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, buf), inputLen, NULL, 0, NULL, NULL);
9471 + #else
9472 int n = ::WideCharToMultiByte(CP_ACP, 0, buf, inputLen, NULL, 0, NULL, NULL);
9473 + #endif
9474 if (n > 0)
9475 resultLen += n;
9477 ***************
9478 *** 924,930 ****
9479 --- 932,942 ----
9481 char *result = out_iter.get();
9483 + #ifdef __MINGW32__
9484 + ::WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, buf), inputLen, result, resultLen,
9485 + #else
9486 ::WideCharToMultiByte(CP_ACP, 0, buf, inputLen, result, resultLen,
9487 + #endif
9488 &defaultChar, NULL);
9490 return NS_OK;
9491 *** misc/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h Wed Jun 25 00:12:34 2003
9492 --- misc/build/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h Tue Jan 15 13:34:37 2008
9493 ***************
9494 *** 132,138 ****
9497 PRBool IsArray() const
9498 ! {return (PRBool) TagPart() == T_ARRAY;}
9500 // 'Dependent' means that params of this type are dependent upon other
9501 // params. e.g. an T_INTERFACE_IS is dependent upon some other param at
9502 --- 132,138 ----
9505 PRBool IsArray() const
9506 ! {return (PRBool) (TagPart() == T_ARRAY);}
9508 // 'Dependent' means that params of this type are dependent upon other
9509 // params. e.g. an T_INTERFACE_IS is dependent upon some other param at
9510 ***************
9511 *** 152,158 ****
9512 uint8 TagPart() const
9513 {return (uint8) (flags & XPT_TDP_TAGMASK);}
9515 ! enum
9517 T_I8 = TD_INT8 ,
9518 T_I16 = TD_INT16 ,
9519 --- 152,158 ----
9520 uint8 TagPart() const
9521 {return (uint8) (flags & XPT_TDP_TAGMASK);}
9523 ! enum _xpttype
9525 T_I8 = TD_INT8 ,
9526 T_I16 = TD_INT16 ,
9527 *** misc/mozilla/xpfe/appshell/src/nsXULWindow.cpp Sat Aug 21 19:17:14 2004
9528 --- misc/build/mozilla/xpfe/appshell/src/nsXULWindow.cpp Tue Jan 15 13:34:37 2008
9529 ***************
9530 *** 73,79 ****
9531 --- 73,81 ----
9532 #include "nsStyleConsts.h"
9534 // XXX Get rid of this
9535 + #ifdef _MSC_VER
9536 #pragma message("WARNING: XXX bad include, remove it.")
9537 + #endif
9538 #include "nsIWebShellWindow.h"
9539 #include "nsWebShellWindow.h" // get rid of this one, too...
9541 *** misc/mozilla/xpfe/bootstrap/Makefile.in Thu Jun 24 20:58:48 2004
9542 --- misc/build/mozilla/xpfe/bootstrap/Makefile.in Tue Jan 15 13:34:37 2008
9543 ***************
9544 *** 84,93 ****
9545 --- 84,96 ----
9547 include $(topsrcdir)/config/config.mk
9549 + # reduce prerequisites by disabling mozilla binary
9550 + ifndef DISABLE_MOZ_EXECUTABLE
9551 ifeq ($(USE_SHORT_LIBNAME),1)
9552 PROGRAM = mozilla$(BIN_SUFFIX)
9553 else
9554 PROGRAM = mozilla-bin$(BIN_SUFFIX)
9555 + endif
9556 endif
9558 # Force applications to be built non-statically
9559 *** misc/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp Tue Dec 14 17:26:56 2004
9560 --- misc/build/mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp Tue Jan 15 13:34:37 2008
9561 ***************
9562 *** 113,119 ****
9563 --- 113,123 ----
9564 int acplen = aStr.Length() * 2 + 1;
9565 char * acp = new char[ acplen ];
9566 if( acp ) {
9567 + #ifdef __MINGW32__
9568 + int outlen = ::WideCharToMultiByte( CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aStr.get()), aStr.Length(),
9569 + #else
9570 int outlen = ::WideCharToMultiByte( CP_ACP, 0, aStr.get(), aStr.Length(),
9571 + #endif
9572 acp, acplen, NULL, NULL );
9573 if ( outlen >= 0)
9574 acp[ outlen ] = '\0'; // null terminate
9575 ***************
9576 *** 2423,2429 ****
9577 --- 2427,2437 ----
9579 // Create menu and add item.
9580 mTrayIconMenu = ::CreatePopupMenu();
9581 + #ifdef __MINGW32__
9582 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_NAVIGATOR, NS_REINTERPRET_CAST(LPCWSTR, navigatorText.get()) );
9583 + #else
9584 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_NAVIGATOR, navigatorText.get() );
9585 + #endif
9586 if ( ::GetLastError() == ERROR_CALL_NOT_IMPLEMENTED ) {
9587 AppendMenuItem( mTrayIconMenu, TURBO_NAVIGATOR, navigatorText );
9588 if ( isMail )
9589 ***************
9590 *** 2437,2442 ****
9591 --- 2445,2459 ----
9593 else {
9594 if (isMail)
9595 + #ifdef __MINGW32__
9596 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_MAIL, NS_REINTERPRET_CAST(LPCWSTR, mailText.get()) );
9597 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_EDITOR, NS_REINTERPRET_CAST(LPCWSTR, editorText.get()) );
9598 + if (isMail)
9599 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_ADDRESSBOOK, NS_REINTERPRET_CAST(LPCWSTR, addressbookText.get()) );
9600 + ::AppendMenuW( mTrayIconMenu, MF_SEPARATOR, NULL, NULL );
9601 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_DISABLE, NS_REINTERPRET_CAST(LPCWSTR, disableText.get()) );
9602 + ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_EXIT, NS_REINTERPRET_CAST(LPCWSTR, exitText.get()) );
9603 + #else
9604 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_MAIL, mailText.get() );
9605 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_EDITOR, editorText.get() );
9606 if (isMail)
9607 ***************
9608 *** 2444,2449 ****
9609 --- 2461,2467 ----
9610 ::AppendMenuW( mTrayIconMenu, MF_SEPARATOR, NULL, NULL );
9611 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_DISABLE, disableText.get() );
9612 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_EXIT, exitText.get() );
9613 + #endif
9617 *** misc/mozilla/nsprpub/pr/include/md/_pth.h
9618 --- misc/build/mozilla/nsprpub/pr/include/md/_pth.h
9619 ***************
9620 *** 198,204 ****
9622 * These platforms don't have pthread_kill()
9624 ! #if defined(DARWIN)
9625 #define pthread_kill(thread, sig) ENOSYS
9626 #endif
9628 --- 198,204 ----
9630 * These platforms don't have pthread_kill()
9632 ! #if defined(DARWIN) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
9633 #define pthread_kill(thread, sig) ENOSYS
9634 #endif
9636 *** misc/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ipf64.cpp
9637 --- misc/build/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ipf64.cpp
9638 ***************
9639 *** 25,31 ****
9640 #include "xptcprivate.h"
9642 #include <stdint.h>
9643 - #include <iostream.h>
9645 // "This code is for IA64 only"
9647 --- 25,30 ----