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
5 $topsrcdir/.mozconfig \
7 $topsrcdir/mozconfig.sh \
8 ! $topsrcdir/myconfig.sh \
10 ! $HOME/.mozconfig.sh \
11 ! $HOME/.mozmyconfig.sh
13 if test -f $_config; then
16 $topsrcdir/.mozconfig \
17 $topsrcdir/mozconfig \
18 $topsrcdir/mozconfig.sh \
19 ! $topsrcdir/myconfig.sh
21 if test -f $_config; then
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
29 # Stupid wrapper to avoid win32 dospath/cygdrive issues
34 # Stupid wrapper to avoid win32 dospath/cygdrive issues
38 i=-I${mountpoint}/${driveletter}/${pathname}
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}
51 i=-I${mountpoint}/${driveletter}/${pathname}
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
59 ! eval 'restpath=${i#'${notinpath}${mountpoint}'/[a-zA-Z]/}'
60 ! eval 'withdrive=${i#'${notinpath}${mountpoint}'/}'
61 ! driveletter=${withdrive%%/*}
62 ! i=${notinpath}${driveletter}:/${restpath}
64 ! # check for potential path. Precheck using shell methods
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"
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}
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
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
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
110 sunbird::sunbirddirs sunbirdunix
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/
128 sunbird::sunbirddirs sunbirdunix
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/
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
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
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
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
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
192 ifdef MOZ_ENABLE_GTK2
193 GLIB_CFLAGS = $(MOZ_GTK2_CFLAGS)
194 ! GLIB_LIBS = $(MOZ_GTK2_LIBS)
200 ifdef MOZ_ENABLE_GTK2
201 GLIB_CFLAGS = $(MOZ_GTK2_CFLAGS)
202 ! GLIB_LIBS = $(filter -lglib% -L%,$(MOZ_GTK2_LIBS))
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
214 + # Shared library RUNPATH linker option(s)
216 + ifeq ($(OS_ARCH),Linux)
217 + EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
219 + EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN/..:\$$ORIGIN/../../ure-link/lib
220 + endif # IS_COMPONENT
223 + ifeq ($(OS_ARCH),SunOS)
224 + EXTRA_DSO_LDOPTS += -R '$$ORIGIN'
226 + EXTRA_DSO_LDOPTS += -R '$$ORIGIN/..'
227 + endif # IS_COMPONENT
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
238 ifeq ($(OS_ARCH),WINNT)
241 ! DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
247 ifeq ($(OS_ARCH),WINNT)
250 ! DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
252 + DSO_LDOPTS += -Wl,--enable-runtime-pseudo-reloc -Wl,-Map -Wl,$(LIB_PREFIX)$(LIBRARY_NAME).map
260 $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
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
271 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
273 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
274 + CYGWIN_WRAPPER=`cygpath -u $CYGWIN_WRAPPER`
276 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
280 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
283 ! STRIP="$STRIP -x -S"
284 case "${target_cpu}" in
286 _PLATFORM_DEFAULT_TOOLKIT='mac'
288 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
291 ! STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
292 case "${target_cpu}" in
294 _PLATFORM_DEFAULT_TOOLKIT='mac'
300 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
308 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
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; }
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; }
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`
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`
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'`
353 { echo "configure: error: GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory." 1>&2; exit 1; }
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`
361 { echo "configure: error: GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory." 1>&2; exit 1; }
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'`
370 { echo "configure: error: LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory." 1>&2; exit 1; }
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`
378 { echo "configure: error: LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory." 1>&2; exit 1; }
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 $@'
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 $@'
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
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"
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
427 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
430 ! STRIP="$STRIP -x -S"
431 case "${target_cpu}" in
433 _PLATFORM_DEFAULT_TOOLKIT='mac'
435 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
438 ! STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
439 case "${target_cpu}" in
441 _PLATFORM_DEFAULT_TOOLKIT='mac'
447 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
455 ! if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
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 $@'
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 $@'
485 AC_CHECK_LIB(c_r, gethostbyname_r)
490 dnl ========================================================
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"
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
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)
511 DEBUG_LINK_OPT=/DEBUG
512 ifeq ($(BUILD_OPT), 1)
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)
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
528 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
530 ifeq ($(MOZ_OBJFORMAT),elf)
536 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
538 ifeq ($(MOZ_OBJFORMAT),elf)
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
545 include $(topsrcdir)/config/config.mk
547 ! CSRCS = nsinstall.c now.c
551 ! ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
557 include $(topsrcdir)/config/config.mk
559 ! ifndef MOZILLA_CLIENT
560 ! CSRCS = nsinstall.c
567 ! ifneq (,$(CROSS_COMPILE)$(filter WINNT OS2,$(OS_ARCH)))
573 XLDOPTS += $(LDFLAGS)
577 XCFLAGS = $(OS_EXE_CFLAGS)
578 ! XLDOPTS = -Zlinker /PM:VIO
581 ifeq ($(MOZ_OS2_TOOLS),VACPP)
583 XLDOPTS += $(LDFLAGS)
586 ! ifeq ($(MOZ_OS2_TOOLS),EMX)
587 XCFLAGS = $(OS_EXE_CFLAGS)
588 ! XLDOPTS = -Zomf -Zlinker /PM:VIO
591 ifeq ($(MOZ_OS2_TOOLS),VACPP)
596 OUTOPTION = -o # end of the line
597 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
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
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
622 # Stupid wrapper to avoid win32 dospath/cygdrive issues
627 # Stupid wrapper to avoid win32 dospath/cygdrive issues
632 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
634 ! args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
639 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
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}
653 ! # check for potential path. Precheck using shell methods
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"
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}
674 ! args="${args} ${i}"
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
688 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
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
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
710 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
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"
716 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
720 CXX="$CXX -mno-cygwin"
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"
728 CXX="$CXX -mno-cygwin"
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"
743 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
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
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
785 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
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
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
807 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
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"
813 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
818 CXX="$CXX -mno-cygwin"
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"
833 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
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
851 + AC_SUBST(DLL_PREFIX)
853 AC_SUBST(PROG_SUFFIX)
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
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)
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
880 DLLPRLDAP = $(addprefix $(OBJDIR_NAME)/, \
881 ! $(LIB_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
883 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
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
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)
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)
917 ifeq ($(OS_ARCH), WINNT)
919 + EXTRA_DLL_LIBS = -L$(dist_libdir) -l$(LDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
921 + ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
922 + EXTRA_DLL_LIBS += -l$(SOFTOKN_LIBNAME)
924 + EXTRA_DLL_LIBS += -l$(SSL_LIBNAME) \
925 + -l$(PLC_BASENAME) -l$(PLDS_BASENAME) -l$(NSPR_BASENAME)
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
933 EXTRA_LIBS += $(dist_libdir)/$(SOFTOKN_LIBNAME).lib
935 EXTRA_LIBS += $(dist_libdir)/$(SSL_LIBNAME).lib
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
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)
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
963 gtkmozembed_internal.h
966 ! EXTRA_DSO_LDOPTS = \
967 $(MOZ_COMPONENT_LIBS) \
971 gtkmozembed_internal.h
974 ! EXTRA_DSO_LDOPTS += \
975 $(MOZ_COMPONENT_LIBS) \
982 ifdef MOZ_ENABLE_GTK2
983 ! EXTRA_DSO_LDOPTS = \
984 $(MOZ_COMPONENT_LIBS) \
990 ifdef MOZ_ENABLE_GTK2
991 ! EXTRA_DSO_LDOPTS += \
992 $(MOZ_COMPONENT_LIBS) \
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
999 TestGtkEmbedNotebook.cpp \
1000 TestGtkEmbedSocket.cpp \
1001 TestGtkEmbedChild.cpp
1004 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
1009 TestGtkEmbedNotebook.cpp \
1010 TestGtkEmbedSocket.cpp \
1011 TestGtkEmbedChild.cpp
1013 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
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
1023 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
1024 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
1026 ! -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(LIB_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
1028 ifeq ($(OS_ARCH),WINNT)
1029 ifeq ($(WINAPP),mfcembed)
1031 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
1032 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
1034 ! -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(DLL_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
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
1042 p3p200010.xsl: resources/content/p3p.xsl.in Makefile.in
1044 $(PP) -DNAMESPACE=http://www.w3.org/2000/10/18/P3Pv1 \
1045 ! -DHAS_TMPL_RETENTION\
1048 p3p200012.xsl: resources/content/p3p.xsl.in Makefile.in
1050 $(PP) -DNAMESPACE=http://www.w3.org/2000/12/P3Pv1 \
1054 p3p200109.xsl: resources/content/p3p.xsl.in Makefile.in
1056 $(PP) -DNAMESPACE=http://www.w3.org/2001/09/P3Pv1 \
1060 p3p200201.xsl: resources/content/p3p.xsl.in Makefile.in
1062 $(PP) -DNAMESPACE=http://www.w3.org/2002/01/P3Pv1 \
1063 ! -DHAS_CALL_OURS -DHAS_PURPOSE_SRC\
1066 p3p200010.xsl: resources/content/p3p.xsl.in Makefile.in
1068 $(PP) -DNAMESPACE=http://www.w3.org/2000/10/18/P3Pv1 \
1069 ! -DHAS_TMPL_RETENTION \
1072 p3p200012.xsl: resources/content/p3p.xsl.in Makefile.in
1074 $(PP) -DNAMESPACE=http://www.w3.org/2000/12/P3Pv1 \
1078 p3p200109.xsl: resources/content/p3p.xsl.in Makefile.in
1080 $(PP) -DNAMESPACE=http://www.w3.org/2001/09/P3Pv1 \
1084 p3p200201.xsl: resources/content/p3p.xsl.in Makefile.in
1086 $(PP) -DNAMESPACE=http://www.w3.org/2002/01/P3Pv1 \
1087 ! -DHAS_CALL_OURS -DHAS_PURPOSE_SRC \
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
1096 ! EXTRA_DSO_LDOPTS = \
1099 $(MOZ_COMPONENT_LIBS) \
1104 ! EXTRA_DSO_LDOPTS += \
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
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) \
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) \
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
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);
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);
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);
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);
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);
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
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},
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},
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
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
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;
1254 ! nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID font,
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;
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);
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);
1284 ! nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
1286 *aCache = mImageCache;
1292 ! nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
1294 *aCache = mImageCache;
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
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*);
1311 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
1312 typedef FT_Error (*FT_Get_Kerning_t)
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*);
1325 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
1326 typedef FT_Error (*FT_Get_Kerning_t)
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;
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;
1346 PRLibrary *mSharedLib;
1347 FT_Library mFreeTypeLibrary;
1348 FTC_Manager mFTCacheManager;
1349 ! FTC_Image_Cache mImageCache;
1351 static nsHashtable *sFontFamilies;
1352 static nsHashtable *sRange1CharSetNames;
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
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)
1373 ifeq ($(OS_ARCH), SunOS)
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
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;
1389 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
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;
1400 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
1406 ! FTC_Image_Cache iCache;
1407 nsresult rv = mFt2->GetImageCache(&iCache);
1408 if (NS_FAILED(rv)) {
1409 NS_ERROR("Failed to get Image Cache");
1414 ! FTC_ImageCache iCache;
1415 nsresult rv = mFt2->GetImageCache(&iCache);
1416 if (NS_FAILED(rv)) {
1417 NS_ERROR("Failed to get Image Cache");
1421 FTC_Manager cManager;
1422 mFt2->GetFTCacheManager(&cManager);
1423 ! nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
1425 NS_ASSERTION(rv==0, "failed to get face/size");
1430 FTC_Manager cManager;
1431 mFt2->GetFTCacheManager(&cManager);
1432 ! nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
1434 NS_ASSERTION(rv==0, "failed to get face/size");
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,
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,
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
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,
1484 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
1485 nsCOMPtr<nsIFreeType2> mFt2;
1486 PRUint16 mPixelSize;
1487 ! FTC_ImageType mImageDesc;
1490 static PRBool AddUserPref(nsIAtom *aLang, const nsFont& aFont,
1494 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1495 nsCOMPtr<nsIFreeType2> mFt2;
1496 ! FTC_Image_Desc mImageDesc;
1502 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1503 nsCOMPtr<nsIFreeType2> mFt2;
1504 ! FTC_ImageType mImageDesc;
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
1513 memcpy(name, ptrLogFont->lfFaceName, LF_FACESIZE*2);
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]));
1519 strlen(ptrLogFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
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,
1533 int outlen = WideCharToMultiByte(CP_ACP, 0, aFontName.get(), aFontName.Length() + 1,
1535 logFont.lfFaceName, sizeof(logFont.lfFaceName), nsnull, nsnull);
1537 // somehow the WideCharToMultiByte failed, let's try the old code
1543 int outlen = ::WideCharToMultiByte( CP_ACP, 0,
1544 + #ifdef __MINGW32__
1545 + NS_REINTERPRET_CAST(LPCWSTR, PromiseFlatString(aStr).get()), aStr.Length(),
1547 PromiseFlatString(aStr).get(), aStr.Length(),
1549 acp, acplen, NULL, NULL);
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
1557 PRUnichar fname[LF_FACESIZE];
1559 MultiByteToWideChar(CP_ACP, 0, aFontName,
1560 + #ifdef __MINGW32__
1561 + strlen(aFontName) + 1, NS_REINTERPRET_CAST(LPWSTR, fname), sizeof(fname)/sizeof(fname[0]));
1563 strlen(aFontName) + 1, fname, sizeof(fname)/sizeof(fname[0]));
1565 name.Assign(NS_LITERAL_CSTRING("encoding.") + NS_ConvertUCS2toUTF8(fname) + NS_LITERAL_CSTRING(".ttf"));
1572 // get the final rightBearing and width. Possible kerning is taken into account.
1575 + ::GetTextExtentPointW(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1577 ::GetTextExtentPointW(aDC, aString, aLength, &size);
1579 size.cx -= aOverhangCorrection;
1580 aBoundingMetrics.width = size.cx;
1581 aBoundingMetrics.rightBearing = size.cx - gm.gmCellIncX + gm.gmptGlyphOrigin.x + gm.gmBlackBoxX;
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,
1591 WideCharToMultiByte(CP_ACP, 0, aName.get(), aName.Length() + 1,
1593 aLogFont->lfFaceName, sizeof(aLogFont->lfFaceName), nsnull, nsnull);
1595 if (mFont.sizeAdjust <= 0) {
1599 PRUnichar name[LF_FACESIZE];
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]));
1605 strlen(logFont->lfFaceName) + 1, name, sizeof(name)/sizeof(name[0]));
1608 nsGlobalFont* font = new nsGlobalFont;
1613 // Look for all of the weights for a given font.
1615 logFont.lfCharSet = DEFAULT_CHARSET;
1616 + #ifdef __MINGW32__
1617 + WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aFontName.get()), aFontName.Length() + 1,
1619 WideCharToMultiByte(CP_ACP, 0, aFontName.get(), aFontName.Length() + 1,
1621 logFont.lfFaceName, sizeof(logFont.lfFaceName), nsnull, nsnull);
1622 logFont.lfPitchAndFamily = 0;
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)
1633 LPCRECT lprc, LPCWSTR aString, UINT aLength, INT *lpDx)
1637 if (!lpDx && !lprc && aFont->FillClipRect(aX, aY, aLength, uOptions, clipRect)) {
1639 uOptions |= ETO_CLIPPED;
1641 + #ifdef __MINGW32__
1642 + return ::ExtTextOutW(aDC, aX, aY, uOptions, lprc, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, lpDx);
1644 return ::ExtTextOutW(aDC, aX, aY, uOptions, lprc, aString, aLength, lpDx);
1652 CheckLength(&aLength);
1655 + #ifdef __MINGW32__
1656 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1658 ::GetTextExtentPoint32W(aDC, aString, aLength, &size);
1660 size.cx -= mOverhangCorrection;
1666 // Clip out the extra underline/strikethru caused by the
1669 + #ifdef __MINGW32__
1670 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, aString), aLength, &size);
1672 ::GetTextExtentPoint32W(aDC, aString, aLength, &size);
1674 size.cx -= mOverhangCorrection;
1676 clipRect.top = aY - size.cy;
1681 ::GetTextExtentPoint32A(aDC, buffer.get(), destLength, &size);
1683 + #ifdef __MINGW32__
1684 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, buffer.get()), destLength / 2, &size);
1686 ::GetTextExtentPoint32W(aDC, (const PRUnichar*) buffer.get(), destLength / 2, &size);
1688 size.cx -= mOverhangCorrection;
1694 if (NS_FAILED(rv) || !aLength) return 0;
1697 + #ifdef __MINGW32__
1698 + ::GetTextExtentPoint32W(aDC, NS_REINTERPRET_CAST(LPCWSTR, buffer.get()), aLength, &size);
1700 ::GetTextExtentPoint32W(aDC, buffer.get(), aLength, &size);
1702 size.cx -= mOverhangCorrection;
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,
1714 int nb = WideCharToMultiByte(mCodePage, 0, aString, aLength,
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,
1724 *aResultLength = WideCharToMultiByte(mCodePage, 0, aString, aLength,
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
1735 GCP_RESULTSW gcpResult;
1736 gcpResult.lStructSize = sizeof(GCP_RESULTS);
1737 + #ifdef __MINGW32__
1738 + gcpResult.lpOutString = NS_REINTERPRET_CAST(LPWSTR, outStr); // Output string
1740 gcpResult.lpOutString = outStr; // Output string
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
1749 gcpResult.lpGlyphs = glyphArray; // Character glyphs
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)
1758 if (::GetCharacterPlacementW(mDC, inStr, 2, 0, &gcpResult, GCP_REORDER)
1760 && (inStr[0] == outStr[1]) ) {
1761 gBidiInfo = GCP_REORDER | GCP_GLYPHSHAPE;
1766 const PRUnichar hebAlef = 0x05D0;
1769 + #ifdef __MINGW32__
1770 + if (::GetCharacterPlacementW(mDC, NS_REINTERPRET_CAST(LPCWSTR, inStr), 2, 0, &gcpResult, GCP_REORDER)
1772 if (::GetCharacterPlacementW(mDC, inStr, 2, 0, &gcpResult, GCP_REORDER)
1774 && (inStr[0] == outStr[1]) ) {
1775 gBidiInfo = GCP_REORDER;
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
1783 mFt2->GetFTCacheManager(&mgr);
1784 ! rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
1785 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1791 mFt2->GetFTCacheManager(&mgr);
1792 ! rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
1793 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1798 PRBool embedded_bimap = PR_FALSE;
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,
1821 PRBool embedded_bimap = PR_FALSE;
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,
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;
1849 return NS_ERROR_FAILURE;
1851 ! FTC_Image_Cache icache;
1852 mFt2->GetImageCache(&icache);
1854 return NS_ERROR_FAILURE;
1857 return NS_ERROR_FAILURE;
1859 ! FTC_ImageCache icache;
1860 mFt2->GetImageCache(&icache);
1862 return NS_ERROR_FAILURE;
1868 ! FTC_Image_Cache icache;
1869 mFt2->GetImageCache(&icache);
1876 ! FTC_ImageCache icache;
1877 mFt2->GetImageCache(&icache);
1882 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1885 ! FTC_Image_Cache icache;
1886 mFt2->GetImageCache(&icache);
1890 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1893 ! FTC_ImageCache icache;
1894 mFt2->GetImageCache(&icache);
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
1901 XImage *GetXImage(PRUint32 width, PRUint32 height);
1902 nsITrueTypeFontCatalogEntry *mFaceID;
1903 PRUint16 mPixelSize;
1904 ! FTC_Image_Desc mImageDesc;
1905 nsCOMPtr<nsIFreeType2> mFt2;
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
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
1927 /* Compressed datastreams are represented as arrays of JOCTET.
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
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
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
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;
1964 nsSVGLibartFreetype::ft2->GetFTCacheManager(&mgr);
1965 ! rv = nsSVGLibartFreetype::ft2->ManagerLookupSize(mgr, &imageDesc.font, &mFace, nsnull);
1966 NS_ASSERTION(mFace, "failed to get face/size");
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;
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
1996 nsMsgVCardService.cpp \
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
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 ;
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 ());
2024 ! ldapProperty = p->ldapProperty;
2025 else if (!(flags & ALLOW_NON_CONVERTABLE_CARD_PROPERTY))
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))
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]);
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("(&");
2066 + filter += NS_LITERAL_CSTRING("(|");
2069 + GenerateMultipleFilter(conditionType,filter,vUTF8,&attrs);
2070 + // add the closing brace if using multiple ldap attributes
2071 + filter += NS_LITERAL_CSTRING(")");
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:
2099 + void nsAbBoolExprToLDAPFilter:: GenerateMultipleFilter(
2100 + nsAbBooleanConditionType conditionType,
2101 + nsCString& filter,
2102 + NS_ConvertUCS2toUTF8 &vUTF8,
2103 + CharPtrArrayGuard *pAttrs)
2106 + PRUint16 inner = 0;
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);
2125 + for (i = 0; i < pAttrs->GetSize(); i++)
2128 + GenerateSingleFilter(conditionType,filter,vUTF8,pAttrs->GetArray()[i]);
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
2147 #include "nsIAbBooleanExpression.h"
2148 #include "nsCOMPtr.h"
2149 #include "nsString.h"
2150 + #include "nsAbUtils.h"
2152 class nsAbBoolExprToLDAPFilter
2157 nsIAbBooleanConditionString* condition,
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);
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
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"
2184 ! rv = prefs->CopyCharPref(prefName.get(), getter_Copies(URI));
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"
2196 ! nsCAutoString uriPrefName;
2197 ! uriPrefName = prefName + NS_LITERAL_CSTRING(".uri");
2198 ! rv = prefs->CopyCharPref(uriPrefName.get(), getter_Copies(URI));
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;
2215 + rv = prefs->GetBoolPref(
2216 + PromiseFlatCString(prefName
2217 + + NS_LITERAL_CSTRING(".UseSSL")).get(),
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
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
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));
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
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
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
2292 PRInt32 resultLimit = -1,
2293 PRInt32 timeOut = 0);
2294 virtual ~nsAbQueryLDAPMessageListener ();
2297 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
2298 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
2300 PRInt32 resultLimit = -1,
2301 PRInt32 timeOut = 0);
2302 virtual ~nsAbQueryLDAPMessageListener ();
2303 ! void SetPassword(const nsAString& aPassword){m_sPassword = aPassword;};
2305 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
2306 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
2310 PRBool mInitialized;
2313 + nsAutoString m_sPassword;
2315 nsCOMPtr<nsILDAPOperation> mSearchOperation;
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;
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;
2337 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
2338 NS_ENSURE_SUCCESS(rv, rv);
2341 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
2342 NS_ENSURE_SUCCESS(rv, rv);
2348 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
2349 NS_ENSURE_SUCCESS(rv, rv);
2353 ! if (m_sPassword.Length())
2354 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(m_sPassword));
2356 ! rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
2357 NS_ENSURE_SUCCESS(rv, rv);
2363 rv = getLdapReturnAttributes (arguments, returnAttributes);
2364 NS_ENSURE_SUCCESS(rv, rv);
2368 nsCOMPtr<nsISupports> supportsExpression;
2369 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
2371 rv = getLdapReturnAttributes (arguments, returnAttributes);
2372 NS_ENSURE_SUCCESS(rv, rv);
2376 nsCOMPtr<nsISupports> supportsExpression;
2377 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
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
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
2409 #include "nsAbLDAPProperties.h"
2411 #include "nsAbUtils.h"
2412 + #include "nsCRT.h"
2414 #include "nsCOMPtr.h"
2415 #include "nsString.h"
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.]
2439 1) Generality is maintained when mapping from
2442 {MozillaProperty_String, "FaxNumber", "fax"},
2443 // organizationalPerson
2444 {MozillaProperty_String, "FaxNumber", "facsimiletelephonenumber"},
2446 ! {MozillaProperty_String, "PagerNumber", "pager"},
2448 ! {MozillaProperty_String, "PagerNumber", "pagerphone"},
2450 ! {MozillaProperty_String, "CellularNumber", "mobile"},
2452 ! {MozillaProperty_String, "CellularNumber", "cellphone"},
2454 ! {MozillaProperty_String, "CellularNumber", "carphone"},
2456 // No Home* properties defined yet
2458 ! // organizationalPerson
2459 ! {MozillaProperty_String, "WorkAddress", "postofficebox"},
2461 ! {MozillaProperty_String, "WorkAddress", "streetaddress"},
2463 {MozillaProperty_String, "WorkCity", "l"},
2465 {MozillaProperty_String, "WorkCity", "locality"},
2467 ! {MozillaProperty_String, "WorkState", "st"},
2469 ! {MozillaProperty_String, "WorkState", "region"},
2470 ! // organizationalPerson
2471 ! {MozillaProperty_String, "WorkZipCode", "postalcode"},
2473 ! {MozillaProperty_String, "WorkZipCode", "zip"},
2475 {MozillaProperty_String, "WorkCountry", "countryname"},
2477 // organizationalPerson
2478 {MozillaProperty_String, "JobTitle", "title"},
2480 ! {MozillaProperty_String, "Department", "ou"},
2482 ! {MozillaProperty_String, "Department", "orgunit"},
2484 ! {MozillaProperty_String, "Department", "department"},
2486 ! {MozillaProperty_String, "Department", "departmentnumber"},
2488 ! {MozillaProperty_String, "Company", "o"},
2490 ! {MozillaProperty_String, "Company", "company"},
2492 {MozillaProperty_String, "WorkCountry", "countryname"},
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"},
2508 {MozillaProperty_String, "WorkCity", "l"},
2510 {MozillaProperty_String, "WorkCity", "locality"},
2512 ! {MozillaProperty_String, "WorkState", "st,region"},
2513 ! // organizationalPerson,?
2514 ! {MozillaProperty_String, "WorkZipCode", "postalcode,zip"},
2516 {MozillaProperty_String, "WorkCountry", "countryname"},
2518 // organizationalPerson
2519 {MozillaProperty_String, "JobTitle", "title"},
2521 ! {MozillaProperty_String, "Department", "ou,orgunit,department,departmentnumber"},
2522 ! // inetOrgPerson,?
2523 ! {MozillaProperty_String, "Company", "o,company"},
2525 {MozillaProperty_String, "WorkCountry", "countryname"},
2530 {MozillaProperty_String, "Custom4", "custom4"},
2533 ! {MozillaProperty_String, "Notes", "notes"},
2535 ! {MozillaProperty_String, "Notes", "description"},
2538 {MozillaProperty_Int, "PreferMailFormat", "xmozillausehtmlmail"},
2541 {MozillaProperty_String, "Custom4", "custom4"},
2544 ! {MozillaProperty_String, "Notes", "notes,description"},
2547 {MozillaProperty_Int, "PreferMailFormat", "xmozillausehtmlmail"},
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;
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)
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;
2585 const MozillaLdapPropertyRelation* MozillaLdapPropertyRelator::findMozillaPropertyFromLdap (const char* ldapProperty)
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)) ;
2596 const MozillaLdapPropertyRelation* MozillaLdapPropertyRelator::findMozillaPropertyFromLdap (const char* ldapProperty)
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)) ;
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;
2628 + // we must have at least one attribute
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;
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)
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;
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);
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
2683 static nsresult createCardPropertyFromLDAPMessage (nsILDAPMessage* message,
2685 PRBool* hasSetCardProperty);
2686 + static nsresult getAllLDAPAttrsFromMozilla (const char* aLDAPProperty, PRUint32 *aAttrCount, char * **aAttributes);
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
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/
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.
2707 ! * The Original Code is the Netscape security libraries.
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.
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
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
2903 ! struct MD5ContextStr {
2904 ! PRUint32 lsbInput;
2905 ! PRUint32 msbInput;
2912 ! typedef struct MD5ContextStr MD5Context;
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);
2931 ! MD5_Hash(unsigned char *dest, const char *src)
2933 ! return MD5_HashBuf(dest, (unsigned char *)src, PL_strlen(src));
2937 ! MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
2940 ! MD5Context *cx = MD5_NewContext();
2942 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
2946 ! MD5_Update(cx, src, src_length);
2947 ! MD5_End(cx, dest, &len, MD5_HASH_LEN);
2948 ! MD5_DestroyContext(cx, PR_TRUE);
2953 ! MD5_NewContext(void)
2955 ! MD5Context *cx = (MD5Context *)malloc(sizeof(MD5Context));
2957 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
2964 ! MD5_DestroyContext(MD5Context *cx, PRBool freeit)
2972 ! MD5_Begin(MD5Context *cx)
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) \
2990 ! #define lendian(i32) \
2991 ! (tmp = i32 >> 16 | i32 << 16, (tmp & MASK) << 8 | tmp >> 8 & MASK)
2994 ! #if defined(SOLARIS) || defined(HPUX)
2995 ! #define addto64(sumhigh, sumlow, addend) \
2996 ! sumlow += addend; sumhigh += (sumlow < addend);
2998 ! #define addto64(sumhigh, sumlow, addend) \
2999 ! sumlow += addend; if (sumlow < addend) ++sumhigh;
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) \
3011 ! #define I(X, Y, 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)
3027 ! md5_compress(MD5Context *cx)
3029 ! PRUint32 a, b, c, d;
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]);
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);
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);
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. */
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);
3147 ! inputLen -= MD5_BUFFER_SIZE;
3148 ! input += MD5_BUFFER_SIZE;
3151 ! /* Tail of message (message bytes mod 64). */
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
3172 ! MD5_End(MD5Context *cx, unsigned char *digest,
3173 ! unsigned int *digestLen, unsigned int maxDigestLen)
3175 ! #ifndef IS_LITTLE_ENDIAN
3178 ! PRUint32 lowInput, highInput;
3179 ! PRUint32 inBufIndex = cx->lsbInput & 63;
3181 ! if (maxDigestLen < MD5_HASH_LEN) {
3182 ! // PORT_SetError(SEC_ERROR_INVALID_ARGS);
3186 ! /* Copy out the length of bits input before padding. */
3187 ! lowInput = cx->lsbInput;
3188 ! highInput = (cx->msbInput << 3) | (lowInput >> 29);
3191 ! if (inBufIndex < MD5_END_BUFFER) {
3192 ! MD5_Update(cx, padbytes, MD5_END_BUFFER - inBufIndex);
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. */
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]);
3213 ! memcpy(digest, cx->cv, MD5_HASH_LEN);
3217 ! MD5_FlattenSize(MD5Context *cx)
3219 ! return sizeof(*cx);
3223 ! MD5_Flatten(MD5Context *cx, unsigned char *space)
3225 ! memcpy(space, cx, sizeof(*cx));
3230 ! MD5_Resurrect(unsigned char *space, void *arg)
3232 ! MD5Context *cx = MD5_NewContext();
3234 ! memcpy(cx, space, sizeof(*cx));
3239 ! MD5_TraceState(MD5Context *cx)
3241 ! // PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
3245 ! md5_stream (FILE *stream, unsigned char *dest)
3247 ! /* Important: BLOCKSIZE must be a multiple of 64. */
3248 ! #define BLOCKSIZE 4096
3250 ! MD5Context *cx = MD5_NewContext();
3252 ! // PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
3256 ! unsigned char buffer[BLOCKSIZE + 72];
3259 ! /* Initialize the computation context. */
3262 ! /* Iterate over full file contents. */
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. */
3271 ! /* Read block. Take care for partial reads. */
3274 ! n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
3278 ! while (sum < BLOCKSIZE && n != 0);
3279 ! if (n == 0 && ferror (stream))
3282 ! /* If end of file is reached, end the loop. */
3286 ! /* Process buffer with BLOCKSIZE bytes. Note that
3287 ! BLOCKSIZE % 64 == 0
3289 ! MD5_Update(cx, buffer, BLOCKSIZE);
3292 ! /* Add the last bytes if necessary. */
3294 ! MD5_Update(cx, buffer, sum);
3296 ! MD5_End(cx, dest, &len, MD5_HASH_LEN);
3297 ! MD5_DestroyContext(cx, PR_TRUE);
3302 ! int getMD5sum(const char * fileName,char * sum)
3304 ! unsigned char bin_sum[16];
3308 ! FILE *fp=fopen(fileName,"rb");
3311 ! len=md5_stream(fp,bin_sum);
3313 ! for (int i = 0; i < len; ++i)
3314 ! sprintf (sum,"%s%02x",sum, bin_sum[i]);
3322 ! int testMD5sum(const char * fileName,char * sum)
3324 ! char newSum[33]="";
3325 ! if (getMD5sum(fileName,newSum))
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
3335 mCardDatabase->EditCard(this, PR_TRUE);
3336 ! mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3340 return NS_ERROR_FAILURE;
3344 mCardDatabase->EditCard(this, PR_TRUE);
3345 ! return mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
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
3356 ! mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3364 ! rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3371 return NS_ERROR_NOT_IMPLEMENTED;
3373 nsresult rv = NS_OK;
3376 rv = GetAbDatabase();
3380 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE);
3382 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
3383 ! mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3385 NS_IF_ADDREF(*addedCard = newCard);
3389 NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard)
3391 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE);
3393 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
3394 ! rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
3396 + NS_ENSURE_SUCCESS(rv, rv);
3397 NS_IF_ADDREF(*addedCard = newCard);
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
3408 index_DisplayName = 0,
3410 + index_SecondEmailAddress,
3417 static const ULONG OutlookCardMAPIProps [] =
3419 ! PR_DISPLAY_NAME_W,
3420 ! PR_EMAIL_ADDRESS_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,
3438 ! PR_DEPARTMENT_NAME_W,
3439 ! PR_COMPANY_NAME_W,
3440 ! PR_BUSINESS_HOME_PAGE_W,
3441 ! PR_PERSONAL_HOME_PAGE_W,
3445 nsresult nsAbOutlookCard::Init(const char *aUri)
3447 nsresult retCode = nsRDFResource::Init(aUri) ;
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
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,
3472 ! PR_DEPARTMENT_NAME_A,
3473 ! PR_COMPANY_NAME_A,
3474 ! PR_BUSINESS_HOME_PAGE_A,
3475 ! PR_PERSONAL_HOME_PAGE_A,
3480 nsresult nsAbOutlookCard::Init(const char *aUri)
3482 nsresult retCode = nsRDFResource::Init(aUri) ;
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()) ;
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()) ;
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()) ;
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])) ;
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 ;
3542 GetWebPage1(getter_Copies(properties [index_WorkWebPage])) ;
3543 GetWebPage2(getter_Copies(properties [index_HomeWebPage])) ;
3544 GetNotes(getter_Copies(properties [index_Comments])) ;
3547 ! for (i=0;i<index_LastProp;i++)
3549 ! if (!mapiAddBook->SetPropertyUString(*mMapiData,
3550 ! OutlookCardMAPIProps[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
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) ;
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
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 ;
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 ;
3603 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
3605 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3607 nsCOMPtr<nsISupportsArray> cardList ;
3610 - mCardList.Reset() ;
3612 retCode = StartSearch() ;
3613 - NS_NewISupportsArray(getter_AddRefs(cardList)) ;
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) ;
3643 // We can have mailing lists only in folder,
3644 // we must add the directory to m_AddressList
3649 + nsresult nsAbOutlookDirectory::BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
3650 + PRBool aSearchForOld, PRBool& aIsNewCard)
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 ;
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);
3679 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
3681 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
3683 nsCOMPtr<nsISupportsArray> cardList ;
3684 + nsCStringArray uriList ;
3685 + nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
3689 retCode = StartSearch() ;
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);
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) ;
3729 // We can have mailing lists only in folder,
3730 // we must add the directory to m_AddressList
3733 NotifyItemAddition(card) ;
3737 - NS_ASSERTION(oldElement == element, "Different card stored") ;
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) ;
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() ;
3774 NS_IMETHODIMP nsAbOutlookDirectory::HasCard(nsIAbCard *aCard, PRBool *aHasCard)
3776 if (!aCard || !aHasCard) { return NS_ERROR_NULL_POINTER ; }
3777 ! *aHasCard = PR_FALSE ;
3780 ! ExtractUriFromCard(aCard, uri) ;
3781 ! nsCStringKey key(uri) ;
3783 *aHasCard = mCardList.Exists(&key) ;
3787 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
3790 ! nsVoidKey key (NS_STATIC_CAST(void *, element)) ;
3792 mCardList.Remove(&key) ;
3793 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
3795 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
3800 ! ExtractUriFromCard(card, uri) ;
3801 ! nsCStringKey key(uri) ;
3803 mCardList.Remove(&key) ;
3804 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
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) ; }
3816 retCode = CreateCard(aData, addedCard) ;
3817 NS_ENSURE_SUCCESS(retCode, retCode) ;
3820 ! ExtractUriFromCard(*addedCard, uri) ;
3821 ! nsCStringKey newKey(uri) ;
3823 mCardList.Put(&newKey, *addedCard) ;
3824 if (m_IsMailList) { m_AddressList->AppendElement(*addedCard) ; }
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() ;
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() ;
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},
3855 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
3857 ! nsVoidKey newKey (NS_STATIC_CAST(void *, aCard)) ;
3858 nsresult retCode = NS_OK ;
3860 mCardList.Put(&newKey, aCard) ;
3863 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
3867 ! ExtractUriFromCard(aCard, uri) ;
3868 ! nsCStringKey newKey(uri) ;
3869 nsresult retCode = NS_OK ;
3871 mCardList.Put(&newKey, aCard) ;
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 ;
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 ;
3905 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
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,
3921 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
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,
3941 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
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")) ;
3955 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
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();
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);
3982 ! NS_IF_ADDREF(*aCards = cards);
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")) ;
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) ;
4018 - NS_ADDREF(*aCards) ;
4023 nsCAutoString entryId ;
4024 nsCAutoString uriName ;
4025 nsCOMPtr<nsIRDFResource> resource ;
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);
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)) ;
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)) ;
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 ;
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
4078 #include "nsHashtable.h"
4080 #include "nsISupportsArray.h"
4081 + #include "nsVoidArray.h"
4083 struct nsMapiEntry ;
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
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
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"
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 ; }
4141 static void assignEntryID(LPENTRYID& aTarget, LPENTRYID aSource, ULONG aByteCount)
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 ;
4169 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
4171 MOZ_DECL_CTOR_COUNTER(nsMapiEntryArray)
4173 nsMapiEntryArray::nsMapiEntryArray(void)
4175 MOZ_COUNT_CTOR(nsMapiEntryArray) ;
4178 nsMapiEntryArray::~nsMapiEntryArray(void)
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);
4198 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
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,
4227 ! if (HR_FAILED(mLastError)) {
4228 ! PRINTF(("Cannot open root %08x.\n", mLastError)) ;
4231 - mLastError = rootFolder->GetHierarchyTable(0, folders) ;
4232 - if (HR_FAILED(mLastError)) {
4233 - PRINTF(("Cannot get hierarchy %08x.\n", mLastError)) ;
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)) ;
4253 ! mLastError = folders->GetRowCount(0, &rowCount) ;
4254 ! if (HR_SUCCEEDED(mLastError)) {
4255 ! aFolders.mEntries = new nsMapiEntry [rowCount] ;
4256 ! aFolders.mNbEntries = 0 ;
4258 ! LPSRowSet rowSet = NULL ;
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) ;
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)
4285 ! return GetContents(aParent, aRestriction, &aCards.mEntries, aCards.mNbEntries, 0) ;
4288 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
4291 ! return GetContents(aParent, NULL, &aNodes.mEntries, aNodes.mNbEntries, MAPI_DISTLIST) ;
4294 BOOL nsAbWinHelper::GetCardsCount(const nsMapiEntry& aParent, ULONG& aNbCards)
4297 ! return GetContents(aParent, NULL, NULL, aNbCards, 0) ;
4300 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
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)
4315 MOZ_COUNT_CTOR(nsAbWinHelper) ;
4319 nsAbWinHelper::~nsAbWinHelper(void)
4321 MOZ_COUNT_DTOR(nsAbWinHelper) ;
4325 ! delete [] m_pUniBuff;
4326 ! m_pUniBuff = NULL;
4328 ! delete [] m_pCStrBuff;
4329 ! m_pCStrBuff = NULL;
4330 ! m_cstrBuffLen = 0;
4335 BOOL nsAbWinHelper::GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4336 nsMapiEntryArray& aCards)
4339 ! return GetContents(aParent, aRestriction, &aCards, 0) ;
4342 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
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();
4356 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
4359 aName = values->Value.lpszA ;
4361 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
4362 ! aName.AssignWithConversion(values->Value.lpszW) ;
4365 FreeBuffer(values) ;
4367 aName = values->Value.lpszA ;
4369 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
4370 ! UnicodeToCStr(values->Value.lpszW,aName) ;
4373 FreeBuffer(values) ;
4376 aName = values->Value.lpszW ;
4378 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
4379 ! aName.AssignWithConversion(values->Value.lpszA) ;
4382 FreeBuffer(values) ;
4384 aName = values->Value.lpszW ;
4386 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
4387 ! CStrToUnicode(values->Value.lpszA,aName) ;
4390 FreeBuffer(values) ;
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) {
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)) ;
4407 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
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) {
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) ;
4430 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
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 ;
4444 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
4447 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4448 &IID_IMAPIContainer, 0, &objType,
4450 if (HR_FAILED(mLastError)) {
4452 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
4455 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4456 &IID_IMAPIContainer, 0, &objType,
4458 if (HR_FAILED(mLastError)) {
4462 SBinaryArray entryArray ;
4464 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4465 &IID_IABContainer, MAPI_MODIFY, &objType,
4467 if (HR_FAILED(mLastError)) {
4470 SBinaryArray entryArray ;
4472 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4473 &IID_IABContainer, MAPI_MODIFY, &objType,
4475 if (HR_FAILED(mLastError)) {
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()) ;
4485 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
4488 ! return SetMAPIProperties(aObject, 1, &value) ;
4491 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
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()) ;
4500 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
4503 ! LPSPropValue values=&value;
4504 ! return SetMAPIProperties(aObject, 1, values) ;
4507 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
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()) ;
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()) ;
4527 readableTime.wSecond = 0 ;
4528 readableTime.wMilliseconds = 0 ;
4529 if (SystemTimeToFileTime(&readableTime, &value.Value.ft)) {
4530 ! return SetMAPIProperties(aObject, 1, &value) ;
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) ;
4545 nsMapiInterfaceWrapper<LPABCONT> container ;
4548 ! mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4549 &IID_IABContainer, MAPI_MODIFY, &objType,
4551 if (HR_FAILED(mLastError)) {
4553 nsMapiInterfaceWrapper<LPABCONT> container ;
4556 ! mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4557 &IID_IABContainer, MAPI_MODIFY, &objType,
4559 if (HR_FAILED(mLastError)) {
4562 nsMapiInterfaceWrapper<LPABCONT> container ;
4565 ! mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4566 &IID_IABContainer, MAPI_MODIFY, &objType,
4568 if (HR_FAILED(mLastError)) {
4570 nsMapiInterfaceWrapper<LPABCONT> container ;
4573 ! mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4574 &IID_IABContainer, MAPI_MODIFY, &objType,
4576 if (HR_FAILED(mLastError)) {
4579 nsMapiInterfaceWrapper<LPABCONT> container ;
4582 ! mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4583 &IID_IABContainer, MAPI_MODIFY, &objType,
4585 if (HR_FAILED(mLastError)) {
4587 nsMapiInterfaceWrapper<LPABCONT> container ;
4590 ! mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
4591 &IID_IABContainer, MAPI_MODIFY, &objType,
4593 if (HR_FAILED(mLastError)) {
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)) ;
4609 - aContainer.Assign(byteCount, entryId) ;
4610 - FreeBuffer(entryId) ;
4616 - ContentsColumnEntryId = 0,
4617 - ContentsColumnObjectType,
4618 - ContentsColumnsSize
4621 - static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
4623 - ContentsColumnsSize,
4630 ! BOOL nsAbWinHelper::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4631 ! nsMapiEntry **aList, ULONG& aNbElements, ULONG aMapiType)
4633 ! if (aList != NULL) { *aList = NULL ; }
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,
4643 ! if (HR_FAILED(mLastError)) {
4644 ! PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
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)) ;
4654 ! if (aRestriction != NULL) {
4655 ! mLastError = contents->Restrict(aRestriction, 0) ;
4656 ! if (HR_FAILED(mLastError)) {
4657 ! PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
4661 ! mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
4662 ! if (HR_FAILED(mLastError)) {
4663 ! PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
4666 ! mLastError = contents->GetRowCount(0, &rowCount) ;
4667 ! if (HR_FAILED(mLastError)) {
4668 ! PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
4671 ! if (aList != NULL) { *aList = new nsMapiEntry [rowCount] ; }
4674 ! LPSRowSet rowSet = NULL ;
4677 ! mLastError = contents->QueryRows(1, 0, &rowSet) ;
4678 ! if (HR_FAILED(mLastError)) {
4679 ! PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
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)) ;
4695 - MyFreeProws(rowSet) ;
4696 - } while (rowCount > 0) ;
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 ;
4709 ! mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
4710 ! &IID_IMAPIProp, 0, &objType,
4712 ! if (HR_FAILED(mLastError)) {
4713 ! PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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,
4740 ! if (HR_FAILED(mLastError)) {
4741 ! PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4744 ! mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
4745 ! if (HR_FAILED(mLastError)) {
4746 ! PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
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 ; }
4768 ! for (i = 0 ; i < aRowset->cRows ; ++ i) {
4769 ! FreeBuffer(aRowset->aRow [i].lpProps) ;
4771 ! FreeBuffer(aRowset) ;
4774 nsAbWinHelperGuard::nsAbWinHelperGuard(PRUint32 aType)
4778 ! case nsAbWinType_Outlook: mHelper = new nsMapiAddressBook ; break ;
4779 ! case nsAbWinType_OutlookExp: mHelper = new nsWabAddressBook ; break ;
4784 nsAbWinHelperGuard::~nsAbWinHelperGuard(void)
4789 const char *kOutlookDirectoryScheme = "moz-aboutlookdirectory://" ;
4797 ! void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
4799 ! if (aRowset == NULL) { return ; }
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;
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) {
4829 ! delete [] m_pCStrBuff;
4830 ! m_pCStrBuff = new char[cLen + 64];
4831 ! m_cstrBuffLen = cLen + 64;
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)
4857 ! case nsAbWinType_Outlook: mHelper = getOutlookAddressBook() ; break ;
4858 ! case nsAbWinType_OutlookExp: mHelper = getOutlookExpAddressBook() ; 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
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 ; }
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) ;
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);};
4937 + nsVoidArray m_array;
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) ;
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) ;
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,
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,
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 ; }
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
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) ;
5048 HRESULT mLastError ;
5049 static PRUint32 mEntryCounter ;
5050 static PRLock *mMutex ;
5052 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5053 + LPENTRYID lpEntryID,
5054 + LPCIID lpInterface,
5056 + ULONG FAR * lpulObjType,
5057 + LPUNKNOWN FAR * lppUnk
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
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);
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;
5096 nsAbWinHelper *operator ->(void) { return mHelper ; }
5098 + static void FreeWinAbLibrarys();
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
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()
5120 m_dbDirectory(nsnull)
5122 + memset(m_dbMd5Sum,0,33);
5125 nsAddrDatabase::~nsAddrDatabase()
5128 NS_RELEASE(oldFile); // always release our file ref, store has own
5132 nsCRT::free(nativeFileName);
5134 if (NS_SUCCEEDED(ret) && thumb)
5136 NS_RELEASE(oldFile); // always release our file ref, store has own
5140 ! ret = getMD5sum(nativeFileName,m_dbMd5Sum);
5142 ! ret = NS_ERROR_FAILURE;
5144 nsCRT::free(nativeFileName);
5146 if (NS_SUCCEEDED(ret) && thumb)
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);
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;
5170 // ### do something with error, but clear it now because mork errors out on commits.
5172 GetEnv()->ClearErrors();
5173 + if (NS_SUCCEEDED(err) && getMD5sum(nativeFileName,m_dbMd5Sum))
5174 + err = NS_ERROR_FAILURE;
5175 + nsCRT::free(nativeFileName);
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
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
5200 + static char * stristr(const char *big, const char *little)
5204 + if (!big || !little || !*big || !*little)
5206 + len = strlen(little);
5208 + for( ; *big; big++ )
5209 + if(!_strnicmp (big, little, 1) && ! _strnicmp (big, little, len) )
5210 + return (char *)big;
5217 static PRLogModuleInfo* gMapiAddressBookLog
5218 = PR_NewLogModule("nsMapiAddressBookLog");
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}};
5240 + ieidPR_ENTRYID = 0,
5241 + ieidPR_OBJECT_TYPE,
5242 + ieidPR_DISPLAY_NAME,
5243 + ieidPR_MESSAGE_CLASS,
5244 + ieidPR_STORE_ENTRYID,
5245 + ieidPR_MESSAGE_RECIPIENTS,
5249 + static const SizedSPropTagArray(ieidMax, ptaEid)=
5258 + PR_MESSAGE_RECIPIENTS
5264 + ContentsColumnEntryId = 0,
5265 + ContentsColumnObjectType,
5266 + ContentsColumnMessageClass,
5267 + ContentsColumnsSize
5270 + static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
5272 + ContentsColumnsSize,
5280 HMODULE nsMapiAddressBook::mLibrary = NULL ;
5281 PRInt32 nsMapiAddressBook::mLibUsage = 0 ;
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)
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)
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)) {
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)) {
5320 if (HR_FAILED(retCode)) {
5321 ! PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ; return FALSE ;
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)
5334 ! if (-- mLibUsage == 0) {
5336 - if (mRootBook) { mRootBook->Release() ; }
5339 mRootSession->Logoff(NULL, 0, 0) ;
5343 if (HR_FAILED(retCode)) {
5344 ! PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ;
5349 return HR_SUCCEEDED(retCode) ;
5352 void nsMapiAddressBook::FreeMapiLibrary(void)
5355 ! if (--mLibUsage < 0) {
5359 mRootSession->Logoff(NULL, 0, 0) ;
5365 FreeLibrary(mLibrary) ;
5366 + mRootSession = NULL;
5374 BOOL result = Initialize() ;
5376 NS_ASSERTION(result == TRUE, "Couldn't initialize Mapi Helper") ;
5377 MOZ_COUNT_CTOR(nsMapiAddressBook) ;
5382 nsMapiAddressBook::~nsMapiAddressBook(void)
5384 nsAutoLock guard(mMutex) ;
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")) ;
5399 ! mAddressBook = mRootBook ;
5403 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
5405 nsMapiAddressBook::~nsMapiAddressBook(void)
5407 nsAutoLock guard(mMutex) ;
5410 MOZ_COUNT_DTOR(nsMapiAddressBook) ;
5413 + LPSPropValue nsMapiAddressBook::GetMapiProperty( LPMAPIPROP pProp, ULONG tag)
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);
5426 + if (HR_FAILED( hr) || (cValues != 1)) {
5428 + mMAPIFreeBuffer( lpProp);
5432 + if (PROP_TYPE( lpProp->ulPropTag) == PT_ERROR) {
5433 + if (lpProp->Value.l == MAPI_E_NOT_FOUND) {
5434 + mMAPIFreeBuffer( lpProp);
5442 + BOOL nsMapiAddressBook::GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal)
5447 + BOOL bResult = TRUE;
5448 + switch (PROP_TYPE(pVal->ulPropTag))
5451 + cbEntryId = pVal->Value.bin.cb;
5452 + mMAPIAllocateBuffer( cbEntryId, (LPVOID *) &lpEntryId);
5453 + memcpy( lpEntryId, pVal->Value.bin.lpb, cbEntryId);
5457 + PRINTF(( "EntryId not in BINARY prop value\n"));
5462 + if (pVal && delVal)
5463 + mMAPIFreeBuffer( pVal);
5468 + BOOL nsMapiAddressBook::HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
5474 + if (oType == MAPI_MESSAGE)
5476 + if (oType == MAPI_STORE)
5478 + hr=mRootSession->OpenEntry(
5484 + (IUnknown**)&lpMsgStore);
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);
5498 + nsMapiInterfaceWrapper<LPMAPICONTAINER> lpSubTree;
5500 + if (GetEntryIdFromProp( pVal, cbEntry, pEntry)) {
5501 + // Open up the folder!
5502 + BOOL bResult = TRUE;
5503 + bResult = lpMsgStore->OpenEntry(
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);
5516 + PRINTF(( "GetStoreFolders: Error opening sub tree.\n"));
5520 + PRINTF(( "GetStoreFolders: Error getting entryID from sub tree property val.\n"));
5524 + PRINTF(( "GetStoreFolders: Error getting sub tree property.\n"));
5529 + PRINTF(("Type:%d\n",oType));
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
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));
5549 + hr = lpTable->GetRowCount( 0, &rowCount);
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));
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));
5568 + BOOL keepGoing = TRUE;
5569 + BOOL bResult = TRUE;
5573 + hr = lpTable->QueryRows( 1, 0, &lpRow);
5575 + if (HR_FAILED(hr))
5577 + PRINTF(( "QueryRows failed: 0x%lx, %d\n", (long)hr, (int)hr));
5583 + cNumRows = lpRow->cRows;
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)
5604 + BOOL nsMapiAddressBook::HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
5607 + if (oType == MAPI_FOLDER)
5609 + nsMapiInterfaceWrapper<LPMAPICONTAINER> pFolder ;
5610 + if (!mRootSession->OpenEntry(
5618 + LPSPropValue pVal;
5621 + pVal = GetMapiProperty(*(LPMAPICONTAINER*)&pFolder, PR_CONTAINER_CLASS);
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)) ;
5637 + PRINTF(( "GetStoreFolders - HandleHierarchyItem: Unhandled ObjectType: %ld\n", oType));
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;
5671 + BOOL keepGoing = TRUE;
5672 + BOOL bResult = TRUE;
5676 + mLastError = lpTable->QueryRows( 1, 0, &lpRow);
5678 + if (HR_FAILED(mLastError)){
5684 + cNumRows = lpRow->cRows;
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 ;
5706 + if (!aRestriction)
5708 + for (ulResIndex=0;ulResIndex < aRestrictionNum;ulResIndex++)
5710 + conditionType = aRestriction[ulResIndex].rt;
5711 + switch (conditionType)
5714 + aRestriction[ulResIndex].res.resExist.ulPropTag =
5715 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resExist.ulPropTag);
5717 + case RES_BITMASK :
5718 + aRestriction[ulResIndex].res.resBitMask.ulPropTag =
5719 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resBitMask.ulPropTag);
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);
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);
5734 + aRestriction[ulResIndex].res.resSize.ulPropTag =
5735 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resSize.ulPropTag);
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);
5744 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resNot.lpRes);
5747 + CorrectRestriction(aMapiProp,
5748 + aRestriction[ulResIndex].res.resAnd.cRes,
5749 + aRestriction[ulResIndex].res.resAnd.lpRes);
5752 + CorrectRestriction(aMapiProp,
5753 + aRestriction[ulResIndex].res.resOr.cRes,
5754 + aRestriction[ulResIndex].res.resOr.lpRes);
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);
5762 + case RES_SUBRESTRICTION :
5763 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resSub.lpRes);
5771 + BOOL nsMapiAddressBook::Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList)
5773 + if (!aRestriction)
5776 + ULONG conditionType = 0 ;
5778 + nsMapiEntryArray listOut;
5779 + ULONG listindex=0;
5781 + nsMapiEntryArray listDel;
5785 + ULONG resCount = 0;
5786 + ULONG resIndex = 0;
5788 + listsize = aList->GetSize();
5789 + conditionType = aRestriction->rt;
5790 + switch (conditionType)
5793 + case RES_BITMASK :
5794 + case RES_CONTENT :
5795 + case RES_PROPERTY :
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);
5811 + aRestriction->res.resNot.ulReserved = 1;
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)
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);
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)) ;
5910 + ULONG conditionType = 0 ;
5911 + conditionType = aRestriction->rt;
5913 + switch (conditionType)
5916 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resExist.ulPropTag,1,realValue,valueCount))
5920 + case RES_CONTENT :
5921 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resContent.ulPropTag,1,realValue,valueCount))
5923 + resValue = aRestriction->res.resContent.lpProp;
5925 + case RES_PROPERTY :
5926 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resProperty.ulPropTag,1,realValue,valueCount))
5928 + resValue = aRestriction->res.resProperty.lpProp;
5930 + case RES_BITMASK :
5931 + return FALSE; //not support
5934 + return FALSE;//not been used now
5936 + case RES_COMPAREPROPS :
5937 + return FALSE;//not been used now
5940 + return FALSE;//not need care here
5943 + return FALSE;//not need care here
5946 + return FALSE;//not need care here
5948 + case RES_COMMENT :
5949 + return TRUE;//comment
5951 + case RES_SUBRESTRICTION :
5952 + return FALSE;//not been used now
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) &&
5967 + // PROP_TYPE( aRealValue->ulPropTag ) == PROP_TYPE( aFilterValue->ulPropTag ));
5968 + switch (conditionType)
5971 + return (aRealValue && PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) ;
5973 + case RES_CONTENT :
5976 + switch(aRestriction->res.resContent.ulFuzzyLevel)
5978 + case FL_FULLSTRING :
5979 + return !stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA);
5982 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == aRealValue->Value.lpszA;
5984 + case FL_SUBSTRING :
5986 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
5992 + case RES_PROPERTY :
5995 + switch(aRestriction->res.resProperty.relop)
5998 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) >= 0;
6001 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) > 0;
6004 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) <= 0;
6007 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) < 0;
6010 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == 0;
6013 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != 0;
6017 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
6024 + case RES_BITMASK :
6025 + return FALSE; //not support
6028 + return FALSE;//not been used now
6030 + case RES_COMPAREPROPS :
6031 + return FALSE;//not been used now
6034 + return FALSE;//not need care here
6037 + return FALSE;//not need care here
6040 + return FALSE;//not need care here
6042 + case RES_COMMENT :
6043 + return TRUE;//comment
6045 + case RES_SUBRESTRICTION :
6046 + return FALSE;//not been used now
6052 + BOOL nsMapiAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
6053 + nsMapiEntryArray *aList, ULONG aMapiType)
6058 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
6059 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
6060 + ULONG objType = 0 ;
6061 + ULONG rowCount = 0 ;
6064 + nsMapiInterfaceWrapper<LPMAPIPROP> pFolder;
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)) ;
6077 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&pFolder,PR_MESSAGE_CLASS);
6078 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
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;
6097 + nsMapiEntry testEntry;
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);
6114 + if (aRestriction && !CorrectRestriction(*(LPMAPICONTAINER*)&pFolder,1,aRestriction))
6116 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
6117 + &IID_IMAPIContainer, MAPI_BEST_ACCESS, &objType,
6119 + if (HR_FAILED(mLastError)) {
6120 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
6124 + mLastError = parent->GetContentsTable(0, contents) ;
6125 + if (HR_FAILED(mLastError)) {
6126 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
6129 + if (aRestriction) {
6130 + mLastError = contents->Restrict(aRestriction, TBL_BATCH) ;
6131 + if (HR_FAILED(mLastError)) {
6132 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
6136 + mLastError = contents->SetColumns((LPSPropTagArray)&ContentsColumns, 0);
6137 + if (HR_FAILED(mLastError)) {
6138 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
6141 + mLastError = contents->GetRowCount(0, &rowCount) ;
6142 + if (HR_FAILED(mLastError)) {
6143 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
6147 + LPSRowSet rowSet = NULL ;
6150 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
6151 + if (HR_FAILED(mLastError)) {
6152 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
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) ;
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 ;
6193 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
6194 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6197 + if (HR_FAILED(mLastError)) {
6198 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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 ;
6225 + LPMDB lpMsgStore=GetMsgStore(aObject);
6231 + mLastError = lpMsgStore->OpenEntry(aObject.mByteCount, aObject.mEntryId,
6232 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
6234 + lpMsgStore->Release();
6236 + if (HR_FAILED(mLastError)) {
6237 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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)) ;
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)
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")) ;
6286 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
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
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);
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);
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;
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;
6360 + if (kPriEmailColumn)
6361 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
6364 + break; //we find it,exit
6371 + BOOL nsMapiAddressBook::GetPropertyLong(const nsMapiEntry& aObject,
6372 + ULONG aPropertyTag,
6376 + LPSPropValue values = NULL ;
6377 + ULONG valueCount = 0 ;
6379 + if (PR_OBJECT_TYPE == aPropertyTag)
6381 + nsMapiInterfaceWrapper<LPMAPIFOLDER> pFolder ;
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)) ;
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;
6399 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
6402 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_LONG) {
6403 + aValue = values->Value.ul ;
6405 + FreeBuffer(values) ;
6409 + BOOL nsMapiAddressBook::GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
6410 + WORD& aYear, WORD& aMonth, WORD& aDay)
6415 + LPSPropValue values = NULL ;
6416 + ULONG valueCount = 0 ;
6418 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
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) ;
6435 + HRESULT nsMapiAddressBook::OpenEntry(ULONG cbEntryID,
6436 + LPENTRYID lpEntryID,
6437 + LPCIID lpInterface,
6439 + ULONG FAR * lpulObjType,
6440 + LPUNKNOWN FAR * lppUnk
6448 + rv=mRootSession->OpenEntry(cbEntryID,
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))
6468 + rv=mRootSession->OpenEntry(cbEntryID,
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))
6494 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
6498 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
6499 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6501 + lpMsgStore->Release();
6503 + if (HR_FAILED(mLastError))
6508 + When add mail address to distlist,Mapi need update 2 tag.
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)) ;
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;
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,
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)) ;
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)) ;
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;
6586 + newChilds.cValues = 1;
6587 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
6588 + newChilds.lpbin = bins;
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.
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)) ;
6612 + mMAPIFreeBuffer(bins);
6614 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
6615 + if (HR_FAILED(mLastError)) {
6616 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
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))
6631 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
6635 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
6636 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
6638 + lpMsgStore->Release();
6640 + if (HR_FAILED(mLastError))
6643 + When delete mail address from distlist,Mapi need update 2 tag.
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;
6659 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
6661 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
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;
6682 + newChilds.lpbin[newIndex].lpb = oldChilds.lpbin[oldIndex].lpb;
6683 + newChilds.lpbin[newIndex].cb = oldChilds.lpbin[oldIndex].cb;
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) ;
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)) ;
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)) ;
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;
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) ;
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)) ;
6768 + mMAPIFreeBuffer(bins);
6770 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
6771 + if (HR_FAILED(mLastError)) {
6772 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
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)) ;
6791 + SPropValue *parentID=GetMapiProperty(*(LPMAPIPROP*)&object, PR_PARENT_ENTRYID);
6793 + if (parentID->Value.l == MAPI_E_NOT_FOUND)
6795 + aParentEntry.Assign(parentID->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, parentID->Value.bin.lpb));
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))
6808 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6809 + if (!CreateEntry(parentEntry,aNewEntry)) //Create a entry in parent folder
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,
6825 + if (HR_FAILED(mLastError)) {
6826 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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);
6839 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
6840 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6842 + lpMsgStore->Release();
6844 + if (HR_FAILED(mLastError))
6847 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6849 + mLastError = container->CreateMessage(&IID_IMessage,
6852 + if (HR_FAILED(mLastError)) {
6853 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
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)) ;
6868 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
6869 + if (HR_FAILED(mLastError)) {
6870 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
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)) ;
6885 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
6886 + FreeBuffer(value) ;
6890 + BOOL nsMapiAddressBook::CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
6892 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
6893 + ULONG objType = 0 ;
6895 + LPMDB lpMsgStore=GetMsgStore(aParent);
6898 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
6899 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6901 + lpMsgStore->Release();
6903 + if (HR_FAILED(mLastError)) {
6904 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
6908 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
6909 + mLastError = container->CreateMessage(&IID_IMAPIProp,
6912 + if (HR_FAILED(mLastError)) {
6913 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
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)) ;
6928 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
6929 + if (HR_FAILED(mLastError)) {
6930 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
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)) ;
6945 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
6947 + FreeBuffer(value) ;
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,
6963 + if (HR_FAILED(mLastError)) {
6964 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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))
6974 + aTarget.Assign(aSource.mByteCount,aSource.mEntryId);
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,
6989 + if (HR_FAILED(mLastError)) {
6990 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
6994 + mLastError = OpenEntry(aTarget.mByteCount, aTarget.mEntryId,
6995 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
6997 + if (HR_FAILED(mLastError)) {
6998 + PRINTF(("Cannot open Target folder %08x.\n", mLastError)) ;
7002 + nsMapiInterfaceWrapper<LPMAPIPROP> newEntry ;
7004 + mLastError = container->CopyMessages(&entryArray,
7006 + (void*)&targetFolder,
7010 + if (HR_FAILED(mLastError)) {
7011 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
7017 + BOOL nsMapiAddressBook::DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry)
7019 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
7020 + ULONG objType = 0 ;
7022 + SBinaryArray entryArray ;
7025 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
7026 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
7027 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
7030 + if (HR_FAILED(mLastError)) {
7031 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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);
7043 + mLastError = lpMsgStore->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
7044 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
7046 + lpMsgStore->Release();
7047 + if (HR_FAILED(mLastError)) {
7048 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
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)) ;
7063 + //Use to open message store in write mode
7064 + LPMDB nsMapiAddressBook::GetMsgStore(const nsMapiEntry& aEntry)
7066 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
7069 + mLastError = OpenEntry(aEntry.mByteCount, aEntry.mEntryId,
7070 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
7072 + if (HR_FAILED(mLastError)) {
7073 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
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,
7083 + MAPI_BEST_ACCESS ,
7086 + if (HR_FAILED(mLastError)) {
7087 + PRINTF(("Cannot open MsgStore %08x.\n", mLastError)) ;
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
7099 #include "nsAbWinHelper.h"
7107 class nsMapiAddressBook : public nsAbWinHelper
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,
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) ;
7138 // Class members to handle the library/entry points
7139 static HMODULE mLibrary ;
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) ;
7160 #endif // nsMapiAddressBook_h___
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,
7174 + ULONG FAR * lpulObjType,
7175 + LPUNKNOWN FAR * lppUnk
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);
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);
7224 ! for (int i = 0; i < m_MDBArray.Count(); i++)
7226 ! mdb = (LPMDB)m_MDBArray.ElementAt(i);
7229 ! m_MDBArray.Clear();
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
7245 #define PRINTF(args) PR_LOG(gWabAddressBookLog, PR_LOG_DEBUG, args)
7249 + ContentsColumnEntryId = 0,
7250 + ContentsColumnObjectType,
7251 + ContentsColumnsSize
7254 + static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
7256 + ContentsColumnsSize,
7263 HMODULE nsWabAddressBook::mLibrary = NULL ;
7264 PRInt32 nsWabAddressBook::mLibUsage = 0 ;
7265 LPWABOPEN nsWabAddressBook::mWABOpen = NULL ;
7268 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
7270 nsWabAddressBook::nsWabAddressBook(void)
7273 BOOL result = Initialize() ;
7276 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
7278 nsWabAddressBook::nsWabAddressBook(void)
7279 ! : nsAbWinHelper(),mAddressBook(NULL)
7281 BOOL result = Initialize() ;
7285 MOZ_COUNT_DTOR(nsWabAddressBook) ;
7288 BOOL nsWabAddressBook::Initialize(void)
7290 - if (mAddressBook) { return TRUE ; }
7291 nsAutoLock guard(mMutex) ;
7293 if (!LoadWabLibrary()) {
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,
7310 + if (HR_FAILED(mLastError)){
7311 + PRINTF(("Cannot open root %08x.\n", mLastError));
7314 + mLastError = rootFolder->GetHierarchyTable(0, folders);
7315 + if (HR_FAILED(mLastError)){
7316 + PRINTF(("Cannot get hierarchy %08x.\n", mLastError));
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)) ;
7336 + mLastError = folders->GetRowCount(0, &rowCount) ;
7337 + if (HR_SUCCEEDED(mLastError)) {
7339 + LPSRowSet rowSet = NULL ;
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) ;
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,
7372 + if (HR_FAILED(mLastError)) {
7373 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
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)) ;
7383 + if (aRestriction) {
7384 + mLastError = contents->Restrict(aRestriction, 0) ;
7385 + if (HR_FAILED(mLastError)) {
7386 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
7390 + int entryId = ContentsColumnEntryId ;
7391 + int objectType = ContentsColumnObjectType ;
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)) ;
7403 + for (unsigned int j = 0 ; j < allColumns->cValues ; ++ j) {
7404 + if (allColumns->aulPropTag [j] == PR_ENTRYID) {
7407 + else if (allColumns->aulPropTag [j] == PR_OBJECT_TYPE) {
7411 + mLastError = contents->SetColumns(allColumns, 0) ;
7412 + if (HR_FAILED(mLastError)) {
7413 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
7416 + FreeBuffer(allColumns) ;
7421 + mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
7422 + if (HR_FAILED(mLastError)) {
7423 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
7428 + mLastError = contents->GetRowCount(0, &rowCount) ;
7429 + if (HR_FAILED(mLastError)) {
7430 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
7434 + LPSRowSet rowSet = NULL ;
7437 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
7438 + if (HR_FAILED(mLastError)) {
7439 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
7442 + rowCount = rowSet->cRows ;
7443 + if (rowCount > 0 &&
7444 + (aMapiType == 0 ||
7445 + rowSet->aRow->lpProps[objectType].Value.ul == aMapiType)) {
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) ;
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 ;
7469 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
7470 + &IID_IMAPIProp, 0, &objType,
7473 + if (HR_FAILED(mLastError)){
7474 + PRINTF(("Cannot open entry %08x.\n", mLastError));
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,
7501 + if (HR_FAILED(mLastError)) {
7502 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
7505 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
7506 + if (HR_FAILED(mLastError)) {
7507 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
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));
7534 + aContainer.Assign(byteCount, entryId);
7535 + FreeBuffer(entryId) ;
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
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) ;
7567 // Session and address book that will be shared by all instances
7568 // (see nsMapiAddressBook.h for details)
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) ;
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,
7599 + ULONG FAR * lpulObjType,
7600 + LPUNKNOWN FAR * lppUnk
7603 + return mAddressBook->OpenEntry(cbEntryID,
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) ;
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
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)
7645 ::wcsncpy( mWideBiffIconData.szTip, aToolTipString, toolTipBufSize);
7646 if (wcslen(aToolTipString) >= toolTipBufSize)
7648 mWideBiffIconData.szTip[toolTipBufSize - 1] = 0;
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);
7660 const PRUnichar * oldTooltipString = mWideBiffIconData.szTip;
7662 SetToolTipStringOnIconData(oldTooltipString);
7668 registryUnreadMailCountKey,
7669 sizeof(registryUnreadMailCountKey))))
7671 + #ifdef __MINGW32__
7672 + if (wcscmp(registryUnreadMailCountKey, NS_REINTERPRET_CAST(LPCWSTR, currentUnreadMailCountKey.get()))==0) {
7674 if (wcscmp(registryUnreadMailCountKey, currentUnreadMailCountKey.get())==0) {
7676 nsAutoString deleteKey;
7677 deleteKey.Assign(NS_LITERAL_STRING(UNREADMAILNODEKEY).get());
7678 deleteKey.Append(currentUnreadMailCountKey.get());
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()));
7690 HRESULT hr = mSHSetUnreadMailCount(pBuffer.get(),
7691 mCurrentUnreadCount,
7692 commandLinerForAppLaunch.get());
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
7704 ! extern MimeExternalObjectClass mimeExternalObjectClass;
7706 struct MimeExternalObject {
7712 ! extern "C" MimeExternalObjectClass mimeExternalObjectClass;
7714 struct MimeExternalObject {
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
7720 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
7723 ! EXTRA_DSO_LDOPTS = \
7726 $(MOZ_COMPONENT_LIBS) \
7728 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
7731 ! EXTRA_DSO_LDOPTS += \
7734 $(MOZ_COMPONENT_LIBS) \
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
7747 nsHttpConnectionMgr::OnMsgUpdateParam(nsresult status, void *param)
7749 ! PRUint16 name = (PRUint32(param) & 0xFFFF0000) >> 16;
7750 ! PRUint16 value = PRUint32(param) & 0x0000FFFF;
7753 case MAX_CONNECTIONS:
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;
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
7769 # Stupid wrapper to avoid win32 dospath/cygdrive issues
7774 # Stupid wrapper to avoid win32 dospath/cygdrive issues
7779 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
7781 ! args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
7786 args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
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}
7800 ! # check for potential path. Precheck using shell methods
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"
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}
7821 ! args="${args} ${i}"
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
7830 RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
7831 OBJDIR_NAME = @OBJDIR_NAME@
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
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)
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)
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)
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
7879 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
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
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
7901 CC="$CC -mno-cygwin"
7902 CXX="$CXX -mno-cygwin"
7904 ! MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
7906 # Use temp file for windres (bug 213281)
7907 RCFLAGS='-O coff --use-temp-file'
7909 CC="$CC -mno-cygwin"
7910 CXX="$CXX -mno-cygwin"
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))'
7914 # Use temp file for windres (bug 213281)
7915 RCFLAGS='-O coff --use-temp-file'
7924 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
7929 CC="\$(CYGWIN_WRAPPER) $CC"
7930 CXX="\$(CYGWIN_WRAPPER) $CXX"
7931 RC="\$(CYGWIN_WRAPPER) $RC"
7932 + LD="\$(CYGWIN_WRAPPER) $LD"
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
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
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
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
7972 ifeq ($(OS_ARCH),SunOS)
7974 MAPFILE = $(OBJDIR)/pldsmap.sun
7975 GARBAGE += $(MAPFILE)
7977 ifdef GCC_USE_GNU_LD
7978 ! MKSHLIB += -Wl,--version-script,$(MAPFILE)
7980 ! MKSHLIB += -Wl,-M,$(MAPFILE)
7983 ! MKSHLIB += -M $(MAPFILE)
7991 + ifeq ($(OS_ARCH),Linux)
7992 + MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
7995 ifeq ($(OS_ARCH),SunOS)
7997 MAPFILE = $(OBJDIR)/pldsmap.sun
7998 GARBAGE += $(MAPFILE)
8000 ifdef GCC_USE_GNU_LD
8001 ! MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8003 ! MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
8006 ! MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
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
8017 ifeq ($(OS_ARCH),SunOS)
8019 MAPFILE = $(OBJDIR)/plcmap.sun
8020 GARBAGE += $(MAPFILE)
8022 ifdef GCC_USE_GNU_LD
8023 ! MKSHLIB += -Wl,--version-script,$(MAPFILE)
8025 ! MKSHLIB += -Wl,-M,$(MAPFILE)
8028 ! MKSHLIB += -M $(MAPFILE)
8036 + ifeq ($(OS_ARCH),Linux)
8037 + MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8040 ifeq ($(OS_ARCH),SunOS)
8042 MAPFILE = $(OBJDIR)/plcmap.sun
8043 GARBAGE += $(MAPFILE)
8045 ifdef GCC_USE_GNU_LD
8046 ! MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8048 ! MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
8051 ! MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
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
8060 #ifndef __PRUNICHAR__
8061 #define __PRUNICHAR__
8062 ! #if defined(WIN32) || defined(XP_MAC)
8063 typedef wchar_t PRUnichar;
8065 typedef PRUint16 PRUnichar;
8068 #ifndef __PRUNICHAR__
8069 #define __PRUNICHAR__
8070 ! #if !defined(__MINGW32__) && (defined(WIN32) || defined(XP_MAC))
8071 typedef wchar_t PRUnichar;
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
8078 #define _PR_HAVE_GETPROTO_R_INT
8081 ! #if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
8082 #define _PR_HAVE_GETPROTO_R
8083 #define _PR_HAVE_5_ARG_GETPROTO_R
8086 #define _PR_HAVE_GETPROTO_R_INT
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
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
8101 #include "nsProfile.h"
8102 + #ifdef MOZ_PROFILELOCKING
8103 #include "nsProfileLock.h"
8105 #include "nsIPrefService.h"
8106 #include "nsIPrefBranch.h"
8111 profileURLStr = PROFILE_MANAGER_URL;
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);
8120 profileURLStr = PROFILE_MANAGER_URL;
8129 isSwitch = PR_FALSE;
8131 nsProfileLock localLock;
8132 nsCOMPtr<nsILocalFile> localProfileDir(do_QueryInterface(profileDir, &rv));
8133 if (NS_FAILED(rv)) return rv;
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;
8144 NS_ERROR("Could not get profile directory lock.");
8148 nsCOMPtr<nsIObserverService> observerService =
8149 do_GetService("@mozilla.org/observer-service;1", &rv);
8150 NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
8152 NS_ERROR("Could not get profile directory lock.");
8156 nsCOMPtr<nsIObserverService> observerService =
8157 do_GetService("@mozilla.org/observer-service;1", &rv);
8158 NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
8162 UpdateCurrentProfileModTime(PR_FALSE);
8165 + #ifdef MOZ_PROFILELOCKING
8166 // Do the profile switch
8167 localLock.Unlock(); // gDirServiceProvider will get and hold its own lock
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
8179 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
8181 ifeq ($(MOZ_OBJFORMAT),elf)
8187 ! MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
8189 ifeq ($(MOZ_OBJFORMAT),elf)
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
8196 OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8199 + ifeq ($(OS_TEST),ppc64)
8200 + OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8202 + ifeq ($(USE_64),1)
8206 ifeq ($(OS_TEST),ppc)
8207 OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
8218 ifeq ($(OS_RELEASE),2.0)
8219 OS_REL_CFLAGS += -DLINUX2_0
8220 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8233 ifeq ($(OS_RELEASE),2.0)
8234 OS_REL_CFLAGS += -DLINUX2_0
8235 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8241 OS_PTHREAD = -lpthread
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
8249 OS_PTHREAD = -lpthread
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
8261 ! DSO_LDOPTS = -shared
8264 # INCLUDES += -I/usr/include -Y/usr/include/linux
8269 ! DSO_LDOPTS = -shared $(ARCHFLAG)
8270 ! DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
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
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)
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)
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
8297 include $(CORE_DEPTH)/coreconf/Linux.mk
8299 OS_REL_CFLAGS += -DLINUX2_1
8300 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8305 include $(CORE_DEPTH)/coreconf/Linux.mk
8307 OS_REL_CFLAGS += -DLINUX2_1
8308 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
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
8316 include $(CORE_DEPTH)/coreconf/Linux.mk
8318 OS_REL_CFLAGS += -DLINUX2_1
8319 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8324 include $(CORE_DEPTH)/coreconf/Linux.mk
8326 OS_REL_CFLAGS += -DLINUX2_1
8327 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
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
8335 include $(CORE_DEPTH)/coreconf/Linux.mk
8337 OS_REL_CFLAGS += -DLINUX2_1
8338 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8343 include $(CORE_DEPTH)/coreconf/Linux.mk
8345 OS_REL_CFLAGS += -DLINUX2_1
8346 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
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
8354 include $(CORE_DEPTH)/coreconf/Linux.mk
8356 OS_REL_CFLAGS += -DLINUX2_1
8357 ! MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
8362 include $(CORE_DEPTH)/coreconf/Linux.mk
8364 OS_REL_CFLAGS += -DLINUX2_1
8365 ! MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
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
8376 # -G: produce a shared object
8377 + # -R '$ORIGIN': search for dependencies in same directory
8378 # -z defs: no unresolved symbols allowed
8383 DSO_LDOPTS += -shared -h $(notdir $@)
8384 + DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
8387 ifeq ($(OS_TEST),i86pc)
8393 DSO_LDOPTS += -G -h $(notdir $@)
8394 + DSO_LDOPTS += -R '$$ORIGIN'
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
8402 DEFAULT_COMPILER = cl
8412 ! RC = windres.exe -O coff --use-temp-file
8413 ! LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
8419 AR += -NOLOGO -OUT:"$@"
8427 DEFAULT_COMPILER = cl
8430 ! CC = $(CYGWIN_WRAPPER) gcc
8431 ! CCC = $(CYGWIN_WRAPPER) g++
8432 ! LINK = $(CYGWIN_WRAPPER) ld
8433 ! AR = $(CYGWIN_WRAPPER) ar
8435 ! RANLIB = $(CYGWIN_WRAPPER) ranlib
8437 ! RC = $(CYGWIN_WRAPPER) windres.exe -O coff --use-temp-file
8438 ! LINK_DLL =$(CYGWIN_WRAPPER) $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
8440 ! CC = $(CYGWIN_WRAPPER) cl
8441 ! CCC = $(CYGWIN_WRAPPER) cl
8442 ! LINK = $(CYGWIN_WRAPPER) link
8443 ! AR = $(CYGWIN_WRAPPER) lib
8444 AR += -NOLOGO -OUT:"$@"
8447 ! RC = $(CYGWIN_WRAPPER) rc.exe
8454 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
8456 ! NSINSTALL = nsinstall
8458 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
8459 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
8462 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
8464 ! NSINSTALL = $(CYGWIN_WRAPPER) nsinstall
8466 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
8467 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
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))
8476 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
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))
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
8495 + NSPR31_LIB_PREFIX = lib
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
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) \
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) \
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
8520 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
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))
8526 $(MKPROG) -Fe$@ $(CFLAGS) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8528 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
8530 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
8531 ! $(MKPROG) $(OBJS) -Fe$@ -link $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8534 $(MKPROG) -Fe$@ $(CFLAGS) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
8540 - ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
8541 - $(AR) $(subst /,\\,$(OBJS))
8552 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8554 ! $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES))
8560 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8562 ! $(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
8570 ifdef NEED_ABSOLUTE_PATH
8571 ! abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
8576 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8578 ifdef USE_NT_C_SYNTAX
8579 ! $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8581 ifdef NEED_ABSOLUTE_PATH
8582 ! $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8584 $(CC) -o $@ -c $(CFLAGS) $<
8589 ifdef NEED_ABSOLUTE_PATH
8590 ! mozabspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
8595 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8597 ifdef USE_NT_C_SYNTAX
8598 ! $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8600 ifdef NEED_ABSOLUTE_PATH
8601 ! $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8603 $(CC) -o $@ -c $(CFLAGS) $<
8608 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8609 ifdef USE_NT_C_SYNTAX
8610 ! $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8612 ifdef NEED_ABSOLUTE_PATH
8613 ! $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8615 $(CC) -o $@ -c $(CFLAGS) $<
8619 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
8620 ifdef USE_NT_C_SYNTAX
8621 ! $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8623 ifdef NEED_ABSOLUTE_PATH
8624 ! $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8626 $(CC) -o $@ -c $(CFLAGS) $<
8630 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
8632 ifdef USE_NT_C_SYNTAX
8633 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8635 ifdef NEED_ABSOLUTE_PATH
8636 ! $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8638 $(CCC) -o $@ -c $(CFLAGS) $<
8641 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
8643 ifdef USE_NT_C_SYNTAX
8644 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8646 ifdef NEED_ABSOLUTE_PATH
8647 ! $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8649 $(CCC) -o $@ -c $(CFLAGS) $<
8653 rm -f $(OBJDIR)/t_$*.cc
8655 ifdef USE_NT_C_SYNTAX
8656 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
8658 ifdef NEED_ABSOLUTE_PATH
8659 ! $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
8661 $(CCC) -o $@ -c $(CFLAGS) $<
8664 rm -f $(OBJDIR)/t_$*.cc
8666 ifdef USE_NT_C_SYNTAX
8667 ! $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
8669 ifdef NEED_ABSOLUTE_PATH
8670 ! $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
8672 $(CCC) -o $@ -c $(CFLAGS) $<
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
8680 ifeq ($(OS_ARCH),WINNT)
8681 DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
8682 + DEFAULT_GMAKE_FLAGS += CYGWIN_WRAPPER=@CYGWIN_WRAPPER@
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
8691 ifeq ($(OS_TARGET), OS2)
8692 @cmd.exe /c sign.cmd $(DIST) $(OBJDIR) $(OS_TARGET) $<
8694 + ifeq ($(OS_TARGET), WIN95)
8695 + @sh $(CYGWIN_WRAPPER) ./sign.sh $(DIST) $(OBJDIR) $(OS_TARGET) $<
8697 @sh ./sign.sh $(DIST) $(OBJDIR) $(OS_TARGET) $<
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
8706 DSO_LDOPTS = -bundle
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'
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
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)
8734 MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
8735 endif # GCC_USE_GNU_LD
8737 ! MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
8740 # this builds for Sparc v8 pure 32-bit architecture
8742 MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text,-M,mapfile.Solaris
8743 endif # GCC_USE_GNU_LD
8745 ! MKSHLIB += -z defs -z now -z text -M mapfile.Solaris
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
8753 # The -R '$ORIGIN' linker option instructs this library to search for its
8754 # dependencies in the same directory where it resides.
8756 ! MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1/sparcv9:/usr/lib/mps/sparcv9'
8758 ! MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
8761 ! MKSHLIB += -R '$$ORIGIN'
8766 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
8768 # The -R '$ORIGIN' linker option instructs this library to search for its
8769 # dependencies in the same directory where it resides.
8771 ! DSO_LDOPTS += -R /usr/lib/mps/secv1/sparcv9:/usr/lib/mps/sparcv9
8773 ! DSO_LDOPTS += -R /usr/lib/mps/secv1:/usr/lib/mps
8775 ! endif # BUILD_SUN_PKG
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
8785 CERT_CheckCertValidTimes;
8786 CERT_CreateCertificateRequest;
8787 CERT_ChangeCertTrust;
8788 + CERT_DecodeDERCertificate;
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
8796 static const char OIDDATA_CVS_ID[] = "@(#) $RCSfile$ $Revision$ $Date$ $Name$ ; @(#) $RCSfile$ $Revision$ $Date$ $Name$";
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[];*/
8808 static const char OIDDATA_CVS_ID[] = "@(#) $RCSfile$ $Revision$ $Date$ $Name$ ; @(#) $RCSfile$ $Revision$ $Date$ $Name$";
8811 + #include "pki1t.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
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'
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
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'
8848 ifeq ($(OS_TARGET),WINCE)
8849 DEFINES += -DDBM_USING_NSPR
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
8856 EXTRA_SHARED_LIBS += -dylib_file @executable_path/libsoftokn3.dylib:$(DIST)/lib/libsoftokn3.dylib
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'
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
8875 + #ifdef __MINGW32__
8876 + LONG err = ::RegQueryValueExW( hKey, NS_REINTERPRET_CAST(LPCWSTR, pValueName), NULL, NULL, NULL, &bufSz);
8878 LONG err = ::RegQueryValueExW( hKey, pValueName, NULL, NULL, NULL, &bufSz);
8880 if (err == ERROR_SUCCESS) {
8881 PRUnichar* pBytes = new PRUnichar[bufSz];
8885 + #ifdef __MINGW32__
8886 + err = ::RegQueryValueExW( hKey, NS_REINTERPRET_CAST(LPCWSTR, pValueName), NULL, NULL, (BYTE*)pBytes, &bufSz);
8888 err = ::RegQueryValueExW( hKey, pValueName, NULL, NULL, (BYTE*)pBytes, &bufSz);
8890 if (err != ERROR_SUCCESS) {
8896 HKEY fileTypeKey = 0;
8899 + #ifdef __MINGW32__
8900 + rc = ::RegOpenKeyExW( HKEY_CLASSES_ROOT, NS_REINTERPRET_CAST(LPCWSTR, fileType.get()), 0, KEY_QUERY_VALUE, &fileTypeKey );
8902 rc = ::RegOpenKeyExW( HKEY_CLASSES_ROOT, fileType.get(), 0, KEY_QUERY_VALUE, &fileTypeKey );
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
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)))*)
8917 $(XP_DIST_DEP_LIBS) \
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)))*)
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
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));
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));
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));
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));
8964 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8965 target->target = g_strdup(flavorStr);
8967 ! target->info = (guint)atom;
8968 PR_LOG(sDragLm, PR_LOG_DEBUG,
8969 ("adding target %s with id %ld\n",
8970 target->target, atom));
8972 (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
8973 target->target = g_strdup(flavorStr);
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));
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));
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));
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));
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
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);
9024 int lenTitleStr = WideCharToMultiByte(CP_ACP, 0, title.get(), title.Length(), titleStr, MAX_PATH, NULL, NULL);
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);
9033 lenTitleStr = WideCharToMultiByte(CP_ACP, 0, title.get(), len--, titleStr, MAX_PATH, NULL, NULL);
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
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);
9049 wcsncpy(fileBuffer, mDefault.get(), FILE_BUFFER_SIZE);
9052 NS_NAMED_LITERAL_STRING(htmExt, "html");
9053 nsAutoString initialDir;
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);
9063 wcsncpy(dirBuffer, initialDir.get(), MAX_PATH);
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());
9074 browserInfo.lpszTitle = mTitle.get();
9076 browserInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
9077 if (initialDir.Length()) // convert folder path to native, the strdup copy will be released in BrowseCallbackProc
9082 nsString filterBuffer = mFilterList;
9084 if (!initialDir.IsEmpty()) {
9085 + #ifdef __MINGW32__
9086 + ofn.lpstrInitialDir = NS_REINTERPRET_CAST(LPCWSTR, initialDir.get());
9088 ofn.lpstrInitialDir = initialDir.get();
9092 ofn.lpstrTitle = (LPCWSTR)mTitle.get();
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);
9102 ofn.lpstrFile = fileBuffer;
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());
9112 ofn.lpstrDefExt = mDefaultExtension.get();
9116 // Get file extension from suggested filename
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());
9126 ofn.lpstrDefExt = htmExt.get();
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
9137 // VC++5.0 header doesn't have reconvertion structure and message.
9138 #ifndef WM_IME_REQUEST
9139 + #define WM_IME_REQUEST 0x0288
9141 + #ifndef IMR_RECONVERTSTRING
9142 typedef struct tagRECONVERTSTRING {
9147 } RECONVERTSTRING, FAR * LPRECONVERTSTRING;
9149 #define IMR_RECONVERTSTRING 0x0004
9150 - #define WM_IME_REQUEST 0x0288
9153 // from http://msdn.microsoft.com/library/specs/msime.h
9159 #ifndef WM_APPCOMMAND
9160 #define WM_APPCOMMAND 0x0319
9163 + #ifndef APPCOMMAND_BROWSER_BACKWARD
9164 #define APPCOMMAND_BROWSER_BACKWARD 1
9165 #define APPCOMMAND_BROWSER_FORWARD 2
9166 #define APPCOMMAND_BROWSER_REFRESH 3
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)
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)
9189 int outlen = ::WideCharToMultiByte( CP_ACP, 0,
9190 + #ifdef __MINGW32__
9191 + NS_REINTERPRET_CAST(LPCWSTR, aStr.get()), aStr.Length(),
9193 aStr.get(), aStr.Length(),
9195 acp, acplen, NULL, NULL);
9197 acp[outlen] = '\0'; // null terminate
9201 unicharSize = ::MultiByteToWideChar(gCurrentKeyboardCP,MB_PRECOMPOSED,
9202 mIMECompString->get(),
9203 mIMECompString->Length(),
9204 + #ifdef __MINGW32__
9205 + NS_REINTERPRET_CAST(LPWSTR, mIMECompUnicode->BeginWriting()),
9207 mIMECompUnicode->BeginWriting(),
9210 mIMECompUnicode->SetLength(unicharSize);
9215 *oResult = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR);
9217 len = ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9218 + #ifdef __MINGW32__
9219 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9221 mIMEReconvertUnicode,
9223 nsCRT::strlen(mIMEReconvertUnicode),
9224 NULL, 0, NULL, NULL);
9225 *oResult = sizeof(RECONVERTSTRING) + len;
9229 *oResult = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR);
9231 len = ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9232 + #ifdef __MINGW32__
9233 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9235 mIMEReconvertUnicode,
9237 nsCRT::strlen(mIMEReconvertUnicode),
9238 NULL, 0, NULL, NULL);
9239 *oResult = sizeof(RECONVERTSTRING) + len;
9243 mIMEReconvertUnicode, len * sizeof(WCHAR));
9245 ::WideCharToMultiByte(gCurrentKeyboardCP, 0,
9246 + #ifdef __MINGW32__
9247 + NS_REINTERPRET_CAST(LPCWSTR, mIMEReconvertUnicode),
9249 mIMEReconvertUnicode,
9251 nsCRT::strlen(mIMEReconvertUnicode),
9252 (LPSTR) (aData + sizeof(RECONVERTSTRING)),
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
9261 ! #if defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code
9263 - #include <setjmp.h>
9266 void DumpStackToFile(FILE* aStream)
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]);
9282 for ( ; (void**)*bp > bp; bp = (void**)*bp) {
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);
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
9305 #include <windows.h>
9306 - #elif defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))
9307 - #include <setjmp.h>
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.
9314 - #if (__GLIBC_MINOR__ >= 1) && !defined(__USE_GNU)
9318 - #include <dlfcn.h>
9326 #endif /* NS_BUILD_REFCNT_LOGGING */
9329 nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
9331 nsresult rv = NS_OK;
9334 #endif /* NS_BUILD_REFCNT_LOGGING */
9337 nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
9339 nsresult rv = NS_OK;
9346 nsTraceRefcntImpl::ResetStatistics()
9348 #ifdef NS_BUILD_REFCNT_LOGGING
9354 nsTraceRefcntImpl::ResetStatistics()
9356 #ifdef NS_BUILD_REFCNT_LOGGING
9360 #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
9361 #include "nsStackFrameWin.h"
9363 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9365 DumpStackToFile(aStream);
9368 #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
9369 #include "nsStackFrameWin.h"
9371 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9373 DumpStackToFile(aStream);
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"
9382 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9384 DumpStackToFile(aStream);
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"
9392 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9394 DumpStackToFile(aStream);
9398 #else // unsupported platform.
9401 nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
9403 fprintf(aStream, "write me, dammit!\n");
9406 #else // unsupported platform.
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
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;
9422 typedef PRUint16 PRUnichar;
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;
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
9439 + #ifdef __MINGW32__
9440 + rv = gResolver->Resolve(NS_REINTERPRET_CAST(LPCWSTR, ucsBuf.get()), temp);
9442 rv = gResolver->Resolve(ucsBuf.get(), temp);
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
9453 PRUnichar *result = out_iter.get();
9455 + #ifdef __MINGW32__
9456 + ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, NS_REINTERPRET_CAST(LPWSTR, result), resultLen);
9458 ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, result, resultLen);
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);
9472 int n = ::WideCharToMultiByte(CP_ACP, 0, buf, inputLen, NULL, 0, NULL, NULL);
9481 char *result = out_iter.get();
9483 + #ifdef __MINGW32__
9484 + ::WideCharToMultiByte(CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, buf), inputLen, result, resultLen,
9486 ::WideCharToMultiByte(CP_ACP, 0, buf, inputLen, result, resultLen,
9488 &defaultChar, NULL);
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
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
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
9512 uint8 TagPart() const
9513 {return (uint8) (flags & XPT_TDP_TAGMASK);}
9520 uint8 TagPart() const
9521 {return (uint8) (flags & XPT_TDP_TAGMASK);}
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
9532 #include "nsStyleConsts.h"
9534 // XXX Get rid of this
9536 #pragma message("WARNING: XXX bad include, remove it.")
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
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)
9554 PROGRAM = mozilla-bin$(BIN_SUFFIX)
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
9564 int acplen = aStr.Length() * 2 + 1;
9565 char * acp = new char[ acplen ];
9567 + #ifdef __MINGW32__
9568 + int outlen = ::WideCharToMultiByte( CP_ACP, 0, NS_REINTERPRET_CAST(LPCWSTR, aStr.get()), aStr.Length(),
9570 int outlen = ::WideCharToMultiByte( CP_ACP, 0, aStr.get(), aStr.Length(),
9572 acp, acplen, NULL, NULL );
9574 acp[ outlen ] = '\0'; // null terminate
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()) );
9584 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_NAVIGATOR, navigatorText.get() );
9586 if ( ::GetLastError() == ERROR_CALL_NOT_IMPLEMENTED ) {
9587 AppendMenuItem( mTrayIconMenu, TURBO_NAVIGATOR, navigatorText );
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()) );
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()) );
9604 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_MAIL, mailText.get() );
9605 ::AppendMenuW( mTrayIconMenu, MF_STRING, TURBO_EDITOR, editorText.get() );
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() );
9617 *** misc/mozilla/nsprpub/pr/include/md/_pth.h
9618 --- misc/build/mozilla/nsprpub/pr/include/md/_pth.h
9622 * These platforms don't have pthread_kill()
9624 ! #if defined(DARWIN)
9625 #define pthread_kill(thread, sig) ENOSYS
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
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
9640 #include "xptcprivate.h"
9643 - #include <iostream.h>
9645 // "This code is for IA64 only"