OpenJade-1.4devel/0000777000021000000240000000000007070410064007605 5OpenJade-1.4devel/Makefile.in0000644000021000000240000003435007070410032011566 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ AUTOMAKE_OPTIONS = check-news SUBDIRS = jadedoc dsssl grove spgrove style jade intl po pkginclude_HEADERS = config.h docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = README ABOUT-NLS NEWS COPYING AUTHORS ChangeLog BUILT_SOURCES = config.h msggen.pl EXTRA_DIST = instmac.pl msggen.pl jade.dsw jade.mak jade-generate.mak all @PACKAGE@-@VERSION@.spec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = ${PACKAGE}-${VERSION}.spec msggen.pl CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DATA = $(pkgdoc_DATA) HEADERS = $(pkginclude_HEADERS) DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ INSTALL Makefile.am Makefile.in NEWS acconfig.h acinclude.m4 aclocal.m4 \ config.guess config.h.in config.sub configure configure.in install-sh \ ltconfig ltmain.sh missing mkinstalldirs msggen.pl.in spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: $(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: ${PACKAGE}-${VERSION}.spec: $(top_builddir)/config.status spec.in cd $(top_builddir) && CONFIG_FILES=$@:spec.in CONFIG_HEADERS= $(SHELL) ./config.status msggen.pl: $(top_builddir)/config.status msggen.pl.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p; \ fi; fi; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) list='$(pkgdoc_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgdocdir)/$$p; \ done install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) list='$(pkginclude_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1; \ fi -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-pkgdocDATA install-pkgincludeHEADERS install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-pkgdocDATA uninstall-pkgincludeHEADERS uninstall: uninstall-recursive all-am: Makefile $(DATA) $(HEADERS) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) $(DESTDIR)$(pkgincludedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ uninstall-pkgdocDATA install-pkgdocDATA uninstall-pkgincludeHEADERS \ install-pkgincludeHEADERS install-data-recursive \ uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean dist-hook: if test -f $(top_srcdir)/update-changelog; then \ cd $(top_srcdir); \ ./update-changelog; \ cp $(top_srcdir)/ChangeLog $(top_distdir); \ fi dist-zip: dist-dir -chmod -R a+r $(distdir) zip -rql $(distdir).zip $(distdir) -rm -rf $(distdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/README0000644000021000000240000000053507016343227010412 Copyright (c) 1994, 1995, 1996 James Clark, 1999 Matthias Clasen This directory contains a DSSSL engine called OpenJade. See the file COPYING for copying permission. This is a production release. All documentation is in HTML format in the jadedoc directory. Start with jadedoc/index.htm. Please report any bugs you find. The OpenJade Team OpenJade-1.4devel/stamp-h.in0000644000021000000240000000001207070155737011430 timestamp OpenJade-1.4devel/ABOUT-NLS0000644000021000000240000002660307021010127010747 Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do *not* need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. One advise in advance ===================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias or message inheritance) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need not provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system provides usable `catgets' (if using this is selected by the installer) or `gettext' functions. If neither is available, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is *not* required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --with-catgets ./configure --disable-nls will respectively bypass any pre-existing `catgets' or `gettext' to use the internationalizing routines provided within this package, enable the use of the `catgets' functions (if found on the locale system), or else, *totally* disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. By default the configuration process will not test for the `catgets' function and therefore they will not be used. The reasons are already given above: the emulation on top of `catgets' cannot provide all the extensions provided by the GNU `gettext' library. If you nevertheless want to use the `catgets' functions use ./configure --with-catgets to enable the test for `catgets' (this causes no harm if `catgets' is not available on your system). If you really select this option we would like to hear about the reasons because we cannot think of any good one ourself. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate ISO 639 `LL' two-letter code prior to using the programs in the package. For example, let's suppose that you speak German. At the shell prompt, merely execute `setenv LANG de' (in `csh'), `export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. An operating system might already offer message localization for many of its programs, while other programs have been installed locally with the full capabilities of GNU `gettext'. Just using `gettext' extended syntax for `LANG' would break proper localization of already available operating system programs. In this case, users should set both `LANGUAGE' and `LANG' variables in their environment, as programs using GNU `gettext' give preference to `LANGUAGE'. For example, some Swedish users would rather read translations in German than English for when Swedish is not available. This is easily accomplished by setting `LANGUAGE' to `sv:de' while leaving `LANG' to `sv'. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list, courtesy of Linux International. You may reach your translation team at the address `LL@li.org', replacing LL by the two-letter ISO 639 code for your language. Language codes are *not* the same as the country codes given in ISO 3166. The following translation teams exist, as of December 1997: Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', and Turkish `tr'. For example, you may reach the Chinese translation team by writing to `zh@li.org'. If you'd like to volunteer to *work* at translating messages, you should become a member of the translating team for your own language. The subscribing address is *not* the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate *actively* in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of December 1997. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination. Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv .----------------------------------------------------. bash | [] [] [] | 3 bison | [] [] [] | 3 clisp | [] [] [] [] | 4 cpio | [] [] [] [] [] [] | 6 diffutils | [] [] [] [] [] | 5 enscript | [] [] [] [] [] [] | 6 fileutils | [] [] [] [] [] [] [] [] [] [] | 10 findutils | [] [] [] [] [] [] [] [] [] | 9 flex | [] [] [] [] | 4 gcal | [] [] [] [] [] | 5 gettext | [] [] [] [] [] [] [] [] [] [] [] | 12 grep | [] [] [] [] [] [] [] [] [] [] | 10 hello | [] [] [] [] [] [] [] [] [] [] [] | 11 id-utils | [] [] [] | 3 indent | [] [] [] [] [] | 5 libc | [] [] [] [] [] [] [] | 7 m4 | [] [] [] [] [] [] | 6 make | [] [] [] [] [] [] | 6 music | [] [] | 2 ptx | [] [] [] [] [] [] [] [] | 8 recode | [] [] [] [] [] [] [] [] [] | 9 sh-utils | [] [] [] [] [] [] [] [] | 8 sharutils | [] [] [] [] [] [] | 6 tar | [] [] [] [] [] [] [] [] [] [] [] | 11 texinfo | [] [] [] | 3 textutils | [] [] [] [] [] [] [] [] [] | 9 wdiff | [] [] [] [] [] [] [] [] | 8 `----------------------------------------------------' 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If December 1997 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. OpenJade-1.4devel/AUTHORS0000644000021000000240000000121207067706360010602 James Clark: Author of Jade, upon which OpenJade is based. Cees A. de Groot: Autoconf support for Jade. Matthias Clasen: Pthreads support, automake setup, scheme builtins, declaration element type forms parsing, character properties, language-dependent stuff. Avi Kivity: Text backend. Didier PH Martin: OpenJade documentation and PR. Peter Nilsson: FOT validation, character properties, part of query rule, char-map: characteristic, uri-ref-address extension procedure. David Megginson: TeX backend. Sebastian Rahtz: Jadetex macros, TeX backend. Kathleen Marzalek: MIF backend, table support in the TeX backend. Paul Prescod: MIF backend. OpenJade-1.4devel/COPYING0000644000021000000240000000240306713070767010572 Copyright (c) 1994, 1995, 1996, 1997, 1998 James Clark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL JAMES CLARK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of James Clark shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from James Clark. OpenJade-1.4devel/ChangeLog0000644000021000000240000031556307070410325011310 OpenJade ChangeLog Generated automatically by cvs2cl.pl; see for more detail. 2000-03-28 16:10 Matthias Clasen * AUTHORS, Makefile.am, NEWS, acconfig.h, configure.in, spec.in, develdoc/TODO, develdoc/missing, dsssl/builtins.dsl, grove/Node.cxx, grove/Node.h, jade/Makefile.am, po/Makefile.in.in, spgrove/GroveBuilder.cxx, style/Collector.cxx, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/ELObj.cxx, style/ELObj.h, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/Pattern.cxx, style/Pattern.h, style/ProcessContext.cxx, style/ProcessingMode.cxx, style/ProcessingMode.h, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx, style/primitive.cxx, style/primitive.h, testsuite/Makefile, testsuite/contains.dsl, testsuite/contains.expected, testsuite/contains.sgml, testsuite/query-root.dsl, testsuite/query-root.expected, testsuite/query-root.sgml, testsuite/query-root2.sgml, testsuite/specificity.dsl, testsuite/specificity.expected, testsuite/specificity.sgml: Merged the query branch and added a rpm spec file. 2000-03-27 16:00 Matthias Clasen * style/Pattern.cxx, grove/Node.h, spgrove/GroveBuilder.cxx, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/ELObj.cxx, style/Pattern.h, style/ProcessContext.cxx, style/ProcessingMode.cxx, style/ProcessingMode.h, testsuite/specificity.dsl (query_branch): First version of query that passes testsuite/grove-root.dsl and testsuite/specificity.dsl. Changes to build openjade on top of opensp-1.5. 2000-03-22 09:34 Peter Nilsson * style/DssslApp.h: (StyleEngine.h): Don't include. (StyleEngine): Forward declare class. 2000-03-20 10:40 Peter Nilsson * po/sv.po: Some more translations. 2000-03-14 23:45 Matthias Clasen * develdoc/TODO: Updates. 2000-03-06 21:23 Peter Nilsson * jade/RtfFOTBuilder.cxx: (RtfFOTBuilder::~RtfFOTBuilder): Add forgotten \ before " in string constant. 2000-03-03 12:58 Matthias Clasen * develdoc/TODO: Updates. 2000-03-03 12:51 Matthias Clasen * jadedoc/autoconf.htm: Include information about compiling on Digital Unix. 2000-03-03 12:45 Matthias Clasen * jade/RtfFOTBuilder.cxx: Add missing default style specification. 2000-03-03 11:46 Matthias Clasen * msggen.pl.in, style/InterpreterMessages.msg: Add relevant clauses information. 2000-02-21 20:08 Matthias Clasen * style/Interpreter.cxx: Use XcharMap::setRange instead of a setChar loop. 2000-02-18 22:43 Matthias Clasen * style/Interpreter.cxx, style/Interpreter.h, style/ProcessingMode.cxx, style/ProcessingMode.h, style/StyleEngine.cxx (query_branch): Fixes to make testsuite/grove-root pass. 2000-02-18 22:26 Matthias Clasen * style/ELObj.cxx, style/ELObj.h (query_branch): Add a method to ask if a NodeListObj contains a node of a certain class. 2000-02-18 21:51 Matthias Clasen * style/SchemeParser.cxx: Don't accept invalid language-definitions. * spgrove/GroveBuilder.cxx: Fix breakage introduced in the last two commits, add support for multiple dtds in doctypes-and-linktypes. * style/DocumentGenerator.cxx: Suppress excess spaces in the generated document. 2000-02-18 21:15 Matthias Clasen * NEWS: Test new repository. 2000-02-14 14:09 Matthias Clasen * spgrove/GroveBuilder.cxx: Add a generic BaseNode::nextChunkSibling implemented in terms of getOrigin and getOriginToSubnodeRelPropertyName. 2000-02-14 14:05 Matthias Clasen * spgrove/GroveBuilder.cxx: Fix getOrigin for nodes of class attribute-def. 2000-02-11 22:17 Matthias Clasen * style/ELObj.cxx, style/ELObj.h (query_branch): Added PairNodeListObj::contains(). 2000-02-11 19:08 Matthias Clasen * testsuite/query-root.expected: file query-root.expected was initially added on branch query_branch. * testsuite/query-root.dsl: file query-root.dsl was initially added on branch query_branch. * testsuite/query-root.sgml: file query-root.sgml was initially added on branch query_branch. * testsuite/query-root2.sgml: file query-root2.sgml was initially added on branch query_branch. * testsuite/Makefile, testsuite/query-root.dsl, testsuite/query-root.expected, testsuite/query-root.sgml, testsuite/query-root2.sgml, testsuite/specificity.dsl, testsuite/specificity.expected, testsuite/specificity.sgml (query_branch): Adding some tests for query features which don't work yet. * testsuite/specificity.expected: file specificity.expected was initially added on branch query_branch. * testsuite/specificity.dsl: file specificity.dsl was initially added on branch query_branch. * testsuite/specificity.sgml: file specificity.sgml was initially added on branch query_branch. 2000-02-07 17:11 Matthias Clasen * develdoc/TODO (query_branch): Updates. 2000-02-07 17:07 Matthias Clasen * style/Pattern.cxx, develdoc/TODO, style/Pattern.h, style/ProcessingMode.cxx, style/ProcessingMode.h (query_branch): Next round of query cleanup. Move query rule implementation to ProcessingMode.cxx. Pattern.cxx is now in sync with the trunk again. This is completely unoptimized. 2000-02-04 15:57 pn * style/primitive.cxx: (StringToList): Merge fix from jade_1_3_branch. 2000-02-04 15:27 pn * style/primitive.cxx (jade_1_3_branch): (StringToList): Corrected allocation (hopefully this time). * testsuite/contains.actual (query_branch): Removed. 2000-02-03 21:57 Matthias Clasen * style/Pattern.cxx, style/Pattern.h, style/ProcessingMode.cxx, style/ProcessingMode.h, style/SchemeParser.cxx, style/SchemeParser.h (query_branch): First pass at a cleanup of the query implementation: Remove knowledge about implementation details from SchemeParser.cxx to ProcessingMode.cxx, split ProcessingMode::addRule() into addElementRule(), addRootRule() and (new) addQueryRule(). Remove ProcessingMode::setQuery(). Allow style query rules, but only without priority. 2000-02-03 20:47 Matthias Clasen * spgrove/GroveBuilder.cxx: Remove unused (declared, but undefined) ModelGroupNodeList. 2000-02-02 21:50 Matthias Clasen * testsuite/contains.actual: file contains.actual was initially added on branch query_branch. * testsuite/contains.expected: file contains.expected was initially added on branch query_branch. * testsuite/contains.dsl: file contains.dsl was initially added on branch query_branch. * testsuite/contains.sgml: file contains.sgml was initially added on branch query_branch. * testsuite/Makefile, testsuite/contains.actual, testsuite/contains.dsl, testsuite/contains.expected, testsuite/contains.sgml (query_branch): Add a test for SubtreeNodeListObj::contains(). 2000-02-02 20:58 Matthias Clasen * develdoc/TODO (query_branch): Updates. 2000-01-25 09:51 pn * develdoc/TODO: Updated. 2000-01-25 09:23 Matthias Clasen * style/primitive.cxx: Fix typos. 2000-01-24 22:48 Matthias Clasen * style/primitive.cxx: More optimizations in SiblingNodeListObj::contains(), (hopefully) corrected versions of Sub{tree,grove}NodeListObj::contains(). 2000-01-24 17:16 Matthias Clasen * style/ELObj.cxx (query_branch): Add chunk optimization to NodeListObj::contains(). 2000-01-24 15:59 Matthias Clasen * style/ELObj.cxx (query_branch): Further extended debug for node-lists. 2000-01-24 15:28 Matthias Clasen * develdoc/TODO, develdoc/missing: Updates. 2000-01-24 10:48 Matthias Clasen * grove/Node.cxx: Minor cleanups, add intrinsic properties to class sgml-constants. 2000-01-24 09:47 pn * style/primitive.cxx: (SubtreeNodeListObj::contains()): New method. 2000-01-24 09:03 Matthias Clasen * style/primitive.cxx: Optimize SiblingNodeListObj::contains(), make FilterNodeListObj a subclass of MapNodeListObj and use context_. 2000-01-22 21:47 Matthias Clasen * style/primitive.cxx: Protect obj in TreeNodeListObj::nodeListChunkRest. * grove/Node.cxx (query_branch): Minor cleanups: replace subnodeProps_elementToken and subnodeProps_pcdataToken by noProps. 2000-01-22 20:57 Matthias Clasen * style/primitive.cxx (query_branch): Improve the copy() methods of TreeNodeListObj subclasses (C++ allows to restrict the return type when overwriting). 2000-01-22 19:13 pn * style/ELObj.cxx, style/ELObj.h (query_branch): (OutputPropertyValue): New class. (NodeListObj::print): New method. * style/primitive.cxx (query_branch): (TreeNodeListObj::nodeListRest): Protect object with a dynamic root. 2000-01-20 21:06 Matthias Clasen * dsssl/builtins.dsl, style/primitive.cxx, style/primitive.h (query_branch): New C++ primitives for subtree, subgrove and node-list-filter, together with the corresponding NodeListObj subclasses. 2000-01-20 18:19 Matthias Clasen * Makefile.am: Don't rely on the automake-generated dist-zip target, provide our own which takes care of converting to crlf line ends. * NEWS, dsssl/builtins.dsl, style/primitive.cxx, style/primitive.h (query_branch): Implement subtree in C++. 2000-01-20 17:28 Matthias Clasen * style/primitive.cxx (query_branch): Add efficient contains() for DescendantsNodeListObj and SelectElementsNodeListObj, DescendantsNodeListObj changes to prepare for SubtreeNodeListObj. 2000-01-19 19:55 pn * AUTHORS (query_branch): Modified my entry. 2000-01-19 14:19 pn * style/primitive.cxx, style/primitive.h (query_branch): (IsNodeListContains): Renamed from NodeListContains. 2000-01-19 14:12 pn * style/primitive.cxx (query_branch): (NodeListContains): Fix invocation of NodeListObj::contains(). (SelectByClassNodeListObj::contains()): New member function. 2000-01-19 14:07 pn * style/Pattern.cxx: (Pattern::NodeQualifier::satisfies()): Fix invocation of NodeListObj::contains. 2000-01-19 14:04 pn * style/ELObj.cxx (query_branch): (ReverseNodeListObj::contains()): New member function. (NodeListObj::contains()): Cosmetic changes and a note added on chunks. 2000-01-19 09:32 Matthias Clasen * dsssl/builtins.dsl, style/primitive.cxx, style/primitive.h (query_branch): Implement node-list-contains? in C++ using NodeListObj::contains(). This is untested. 2000-01-19 09:22 Matthias Clasen * style/Pattern.cxx (query_branch): Use NodeListObj::contains() in Pattern::NodeQualifier::satisfies(). 2000-01-19 09:16 Matthias Clasen * style/InterpreterMessages.msg, style/Pattern.cxx, style/Pattern.h (query_branch): Add error messages for query-rules. * style/ELObj.cxx, style/ELObj.h (query_branch): Add a generic bool NodeListObj::contains(NodePtr &). 2000-01-18 09:53 Matthias Clasen * style/Pattern.cxx, style/Pattern.h, style/SchemeParser.cxx, style/InterpreterMessages.msg (query_branch): Restrict priority-expressions to integral values again, add error messages for errors in query rules. 2000-01-17 09:38 Matthias Clasen * style/Pattern.cxx, style/Pattern.h, style/SchemeParser.cxx (query_branch): Allow non-integral numbers as priorities (but with limited precision), evaluate the priority-expression late. 2000-01-17 08:05 Matthias Clasen * style/DssslApp.cxx, style/DssslApp.h: Use plain pointers for fotb_ and se_ and delete them early to avoid problems in the destructor of DssslApp. 2000-01-16 23:31 pn * style/Pattern.cxx (query_branch): Topy (sorry, typo) fix 2000-01-16 23:23 pn * style/Pattern.cxx, style/Pattern.h (query_branch): (Pattern::NodeQualifier): Inherit from Collector::DynamicRoot instead of making nl_ permanent. nl_ "remembers" the node list between calls of satisfies. 2000-01-15 10:15 pn * configure.in: Define all conditional preprocessor symbols to 1. 2000-01-14 20:32 Matthias Clasen * spgrove/GroveBuilder.cxx: Make rankabs support work, replace assert by ASSERT throughout. 2000-01-13 20:36 Matthias Clasen * configure.in: Fix a typo 2000-01-13 20:31 Matthias Clasen * acinclude.m4: Add AC_CXX_MUTABLE. 2000-01-13 19:56 Matthias Clasen * configure.in: Use AC_LANG_CPLUSPLUS throughout, don't switch back and forth; don't check for const and inline; add comments to all AC_DEFINEs 2000-01-12 20:58 Matthias Clasen * grove/Node.cxx, grove/Node.h, spgrove/GroveBuilder.cxx: Support for fpiabs and rankabs. * jade/TeXMessages.msg: Removed unneeded message. 2000-01-09 21:43 pn * style/FOTBuilder.cxx, style/FOTBuilder.h: (structFOTBuilder::CharacterNIC): Remove unused valid flag. 2000-01-08 18:16 pn * style/FOTBuilder.cxx: (FOTBuilder::character): Check if char is specified instead of valid flag. 2000-01-08 15:17 Matthias Clasen * jade/Makefile.am, style/Makefile.am: Fix building with builddir != srcdir. 2000-01-08 14:31 Matthias Clasen * dsssl/builtins.dsl: Fix subgrove for subnode properties with null values. 2000-01-05 22:12 Matthias Clasen * jadedoc/autoconf.htm, jadedoc/contributors.htm, jadedoc/index.htm: Documentation update for 1.4. 2000-01-05 11:43 Matthias Clasen * NEWS, jade/TeXFOTBuilder.cxx: Implement URI addresses in the tex backend (needs jadetex support). 2000-01-05 10:22 Matthias Clasen * po/Makefile.in.in: Remove references to ChangeLog. 2000-01-05 10:06 Matthias Clasen * intl/Makefile.in: Port the fixes done by Peter to the sp version of this file to make make dist work again. 2000-01-05 09:58 Matthias Clasen * Makefile.am, NEWS, configure.in: make dist updates the ChangeLog now. 2000-01-03 21:31 Matthias Clasen * Makefile.am, acconfig.h, configure.in, msggen.pl, jade/Makefile.am, jade/jade.cxx, spgrove/GroveBuilder.cxx, spgrove/Makefile.am, spgrove/grove_inst.m4, style/Collector.cxx, style/DssslApp.cxx, style/FOTBuilder.cxx, style/Makefile.am, style/Pattern.cxx, style/ProcessContext.cxx, style/ProcessingMode.cxx, style/primitive.cxx, style/style_inst.m4 (query_branch): First working version of query. 2000-01-03 08:00 Matthias Clasen * jade/TextFOTBuilder.cxx, jade/jade.cxx: Put the text backend in #ifdef JADE_TEXT. 2000-01-01 13:02 Matthias Clasen * Makefile.am, jadedoc/index.htm: Fix the NEWS link. 1999-12-31 23:42 Matthias Clasen * NEWS, develdoc/TODO: Updates. 1999-12-30 17:44 Matthias Clasen * style/style_inst.m4: Add many instantiations to make manual template instantiation work again. 1999-12-30 16:40 Matthias Clasen * style/style_inst.m4: Fix includes. 1999-12-30 16:23 Matthias Clasen * jade/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Don't try to compile _inst.cxx files which are supposed to be included. 1999-12-30 16:00 Matthias Clasen * style/DssslApp.cxx: Implement persistant/preferred/alternate semantics for stylesheet PIs. 1999-12-30 15:37 Matthias Clasen * spgrove/grove_inst.m4: Fix includes of OpenSP headers. 1999-12-30 13:50 Matthias Clasen * grove/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Use -version-info instead of --version-info. 1999-12-29 21:53 Matthias Clasen * develdoc/TODO: Updates. 1999-12-29 12:10 Matthias Clasen * develdoc/TODO: Updates. 1999-12-29 11:35 Matthias Clasen * style/DssslApp.cxx, style/DssslApp.h: Move spec parsing before grove building. 1999-12-27 16:54 Matthias Clasen * style/DssslApp.cxx, style/DssslApp.h, style/DssslAppMessages.msg: Add an error message listing available PI titles if -T is used and no PI matches. 1999-12-27 16:46 Matthias Clasen * develdoc/TODO: Updates. 1999-12-27 14:15 Matthias Clasen * configure.in, po/Makefile.in.in, style/DssslApp.cxx: New config variable OPENJADE_MESSAGE_DOMAIN. 1999-12-27 14:07 Matthias Clasen * msggen.pl.in: Port Win32 build fix from opensp. * spgrove/threads.h: Use mutable where appropriate, if available. 1999-12-27 13:58 Matthias Clasen * style/FOTBuilder.h: Add some comments to FOTBuilder::Description declaration. 1999-12-26 22:40 Matthias Clasen * NEWS, jade/HtmlFOTBuilder.cxx, jade/MifFOTBuilder.cxx, jade/RtfFOTBuilder.cxx, jade/SgmlFOTBuilder.cxx, jade/TeXFOTBuilder.cxx, jadedoc/index.htm, style/DssslApp.cxx, style/DssslApp.h, style/DssslAppMessages.msg, style/FOTBuilder.h: Implement media and title attributes in stylesheet PIs. The media attribute parsing needs more testing, but simple cases seem to work. 1999-12-24 22:17 Matthias Clasen * jade/jade.cxx, style/DssslApp.cxx, style/DssslApp.h: Remove support for media attribute again, since the semantics seem to be wrong. 1999-12-23 23:24 Matthias Clasen * jade/jade.cxx, style/DssslApp.cxx, style/DssslApp.h: Handle the media attribute in pis. Don't extract the pi's from the grove, but do a special parse. 1999-12-22 08:15 debian * debian/README.Debian (opensp_1_4_branch): re-add Debian README file 1999-12-22 08:10 debian * debian/changelog, debian/control (opensp_1_4_branch): re-add debian control files 1999-12-22 08:05 debian * debian/opensp.postinst: file opensp.postinst was initially added on branch opensp_1_4_branch. * debian/changelog, debian/control, debian/rules, debian/opensp.doc-base, debian/opensp.postinst, debian/opensp.prerm (opensp_1_4_branch): first cut on 1.4 branch * debian/opensp.prerm: file opensp.prerm was initially added on branch opensp_1_4_branch. 1999-12-21 20:21 Matthias Clasen * style/DssslApp.cxx: Revert to use a hardcoded message domain of "jade". 1999-12-16 23:06 pn * msggen.pl.in: Correct .po file header. * Makefile.am: EXTRA_DIST: Add msggen.pl. 1999-12-16 11:26 pn * develdoc/TODO: Entry added. 1999-12-15 06:27 Matthias Clasen * msggen.pl: Remove msggen.pl, since it is now a generated file. 1999-12-14 18:17 Matthias Clasen * jadedoc/index.htm: Document the long options and mention some more options (-C, -2, -h, -v). 1999-12-11 14:13 pn * develdoc/TODO: Remove some items that are done. Other small mods. 1999-12-11 14:08 pn * jade/HtmlFOTBuilder.cxx: Support html links (uri-refs). * NEWS: Mention uri-ref support in HTML/CSS backend. 1999-12-11 00:38 pn * NEWS, develdoc/TODO: Updated. 1999-12-11 00:32 pn * style/primitive.cxx, style/primitive.h: UriRefAddress: New primitive. * Makefile.am, configure.in: Generate msggen.pl from msggen.pl.in. * msggen.pl.in: Generate msggen.pl from this file. 1999-12-10 08:28 Matthias Clasen * develdoc/TODO: Updates. 1999-12-09 18:42 Matthias Clasen * NEWS: Mention cmdline option changes. * develdoc/TODO, style/DssslAppMessages.msg: Adjust to the latest interface change in OpenSP. 1999-12-09 15:59 Matthias Clasen * intl/VERSION: Add the VERSION file, so we know which version of GNU gettext we use. 1999-12-09 08:50 pn * develdoc/NOTES: New file. Moved the TeX indirect sosofo notes here. * jade/MifMessages.msg: Remove MIF: prefix from messages. * develdoc/TODO: Updated. 1999-12-07 09:32 Matthias Clasen * po/de.po: Add German translations. 1999-12-06 16:10 Matthias Clasen * acinclude.m4, configure.in, jade/JadeMessages.msg, jade/jade.cxx, style/DssslApp.cxx, style/DssslApp.h, style/DssslAppMessages.msg, style/InterpreterMessages.msg: Long option improvements. 1999-12-04 13:04 pn * Makefile.am, grove/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Install include files needed by programs using the ostyle library. 1999-12-04 00:42 pn * po/sv.po: New file. * configure.in: ALL_LINGUAS: Swedish translation added. 1999-12-03 17:25 Matthias Clasen * msggen.pl, jade/Makefile.am, po/Makefile.in.in, po/POTFILES.in, style/Makefile.am: Improve the build process for i18n. 1999-12-02 22:08 Matthias Clasen * jade/jade.cxx, style/DssslApp.cxx: Long options for openjade. 1999-12-01 19:18 Matthias Clasen * develdoc/TODO: Long options stuff 1999-11-30 18:53 Matthias Clasen * msggen.pl, jade/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Generate .po files via msggen, add rules for .po and .rc files. 1999-11-30 18:21 Matthias Clasen * ABOUT-NLS, Makefile.am, acconfig.h, configure.in, intl/Makefile.in, intl/bindtextdom.c, intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c, intl/finddomain.c, intl/gettext.c, intl/gettext.h, intl/gettextP.h, intl/hash-string.h, intl/intl-compat.c, intl/libgettext.h, intl/linux-msg.sed, intl/loadmsgcat.c, intl/localealias.c, intl/po2tbl.sed.in, intl/textdomain.c, intl/xopen-msg.sed, po/Makefile.in.in, po/POTFILES.in: First cut at I18N for OpenJade * style/DssslApp.cxx: Adjust to changed interface of MessageTable. 1999-11-29 15:06 Matthias Clasen * style/Pattern.cxx, style/ProcessContext.cxx, style/ProcessingMode.cxx (query_branch): Fix a buglet wrt to the interaction of root and query rules. 1999-11-28 22:50 Matthias Clasen * develdoc/TODO (query_branch): Updates. 1999-11-27 01:08 Matthias Clasen * develdoc/TODO (query_branch): I18N tasks. 1999-11-26 22:31 Matthias Clasen * develdoc/TODO (query_branch): Updates. 1999-11-24 17:46 Matthias Clasen * style/Pattern.cxx, style/Pattern.h, style/ProcessContext.cxx, style/ProcessingMode.cxx, style/ProcessingMode.h, style/SchemeParser.cxx, style/SchemeParser.h (query_branch): query rules (not working yet). 1999-11-24 16:41 Matthias Clasen * contrib/jadetex/unicode.sty, dsssl/Makefile.am, dsssl/unicode.sty: Move one forgotten jadetex file, fix make install bug (forgot dsssl.dtd). 1999-11-23 23:04 Matthias Clasen * develdoc/TODO: Add general-indirect stuff. 1999-11-23 08:50 pn * develdoc/TODO: Updated. 1999-11-22 22:57 Matthias Clasen * jade/TeXFOTBuilder.cxx: Fix stupid bugs. 1999-11-22 22:41 Matthias Clasen * AUTHORS, NEWS, README, develdoc/jadedoc.sgml: Cleanups. 1999-11-22 17:21 Matthias Clasen * develdoc/TODO: Updates. 1999-11-22 17:10 Matthias Clasen * contrib/README, contrib/jadetex/ChangeLog, contrib/jadetex/Makefile.jadetex, contrib/jadetex/jadetex.dtx, contrib/jadetex/jadetex.ini, contrib/jadetex/jadetex.ins, contrib/jadetex/pdfjadetex.ini, dsssl/ChangeLog, dsssl/Makefile.jadetex, dsssl/jadetex.dtx, dsssl/jadetex.ini, dsssl/jadetex.ins, dsssl/pdfjadetex.ini: Move jadetex from dsssl/ to contrib/jadetex. * dsssl/Makefile.am: Forgotten Makefile adjustment. 1999-11-22 16:57 Matthias Clasen * msggen.pl: Emit proper include statements. * style/DssslApp.cxx: Forgotten include. 1999-11-22 16:45 Matthias Clasen * develdoc/TODO: Update. 1999-11-22 16:38 Matthias Clasen * jade-generate.mak: Try to adapt win build. (in a desparate voice) Win users, test this !!! 1999-11-22 16:32 Matthias Clasen * msggen.pl: Remove test stuff. * configure.in, msggen.pl, jade/Makefile.am, spgrove/Makefile.am, style/DssslApp.cxx, style/Makefile.am: I18n preparations: use separate module for messages, use message domain OpenJade. 1999-11-22 16:28 Matthias Clasen * jade/TeXFOTBuilder.cxx: Break ligatures with -<>. 1999-11-21 01:05 Matthias Clasen * develdoc/TODO: One more addition * develdoc/TODO: tiny additions. 1999-11-20 13:16 pn * jade/TeXFOTBuilder.cxx: makeTeXFOTBuilder: Declare partial support of the online feature. 1999-11-20 00:51 Matthias Clasen * develdoc/TODO, develdoc/jadedoc.sgml, develdoc/missing: First round of internal doc updates. 1999-11-19 22:44 Matthias Clasen * develdoc/TODO: Remove things that have been done. 1999-11-19 12:50 pn * spgrove/Makefile.am, jade/Makefile.am, style/Makefile.am: Remove unnecessary dependencies. 1999-11-19 12:46 pn * jade/RtfFOTBuilder.cxx: (makeRtfFOTBuilder): Declare partial support for the online feature. 1999-11-16 15:44 pn * jade/Makefile.am: openjade_SOURCES: List TmpOutputByteStream.h * dsssl/Makefile.am: EXTRA_DIST: List all files that should be distributed. 1999-11-16 11:29 pn * configure.in, style/DssslApp.cxx: Changed PACKAGE and VERSION to OPENJADE_PACKAGE and OPENJADE_VERSION, respectively, to avoid possible future conflicts. * acconfig.h: Include OpenSP config.h. Moved @TOP@ to adequate place and removed funny #error lines. 1999-11-15 19:29 pn * msggen.pl, grove/LocNode.h, grove/Node.cxx, grove/Node.h, jade/HtmlFOTBuilder.cxx, jade/HtmlFOTBuilder.h, jade/HtmlFOTBuilder_inst.m4, jade/MifFOTBuilder.cxx, jade/MifFOTBuilder.h, jade/MifFOTBuilder_inst.m4, jade/RtfFOTBuilder.cxx, jade/RtfFOTBuilder.h, jade/RtfFOTBuilder_inst.m4, jade/SgmlFOTBuilder.cxx, jade/SgmlFOTBuilder.h, jade/TeXFOTBuilder.cxx, jade/TeXFOTBuilder.h, jade/TeXFOTBuilder_inst.m4, jade/TextFOTBuilder.cxx, jade/TextFOTBuilder.h, jade/TmpOutputByteStream.h, jade/TransformFOTBuilder.cxx, jade/TransformFOTBuilder.h, jade/TransformFOTBuilder_inst.m4, jade/jade.cxx, spgrove/GroveApp.h, spgrove/GroveBuilder.cxx, spgrove/GroveBuilder.h, spgrove/Makefile.am, spgrove/SdNode.h, style/Collector.cxx, style/Collector.h, style/DocumentGenerator.cxx, style/DocumentGenerator.h, style/DssslApp.cxx, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/ELObj.cxx, style/ELObj.h, style/ELObjMessageArg.cxx, style/ELObjMessageArg.h, style/EvalContext.h, style/Expression.cxx, style/Expression.h, style/FOTBuilder.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/FlowObj_inst.m4, style/GroveManager.h, style/InheritedC.cxx, style/Insn.cxx, style/Insn.h, style/Interpreter.cxx, style/Interpreter.h, style/LangObj.cxx, style/MacroFlowObj.cxx, style/MacroFlowObj.h, style/Makefile.am, style/NumberCache.cxx, style/NumberCache.h, style/Pattern.cxx, style/Pattern.h, style/ProcessContext.cxx, style/ProcessContext.h, style/ProcessingMode.cxx, style/ProcessingMode.h, style/SchemeParser.cxx, style/SchemeParser.h, style/SosofoObj.h, style/Style.cxx, style/Style.h, style/StyleEngine.cxx, style/StyleEngine.h, style/TransformationMode.h, style/VM.h, style/common_inst.m4, style/primitive.cxx, style/primitive_inst.m4, style/style_inst.m4: Replace #include "foo.h" with #include where appropriate. 1999-11-14 15:14 Matthias Clasen * grove/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Reenable inter-library dependencies. I must have been asleep. 1999-11-14 15:02 Matthias Clasen * Makefile.am, grove/Makefile.am, jade/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Disable inter-library dependencies, since they cause trouble. 1999-11-14 14:04 Matthias Clasen * acconfig.h, configure.in, spgrove/Makefile.am, style/Makefile.am, style/StyleEngine.h: automake fixes. 1999-11-14 12:30 Matthias Clasen * Makefile.am: Remove groveoa from SUBDIRS. 1999-11-14 00:41 Matthias Clasen * Makefile.am: Remove unneeded EXTRA_DIST. * develdoc/TODO: Updates. 1999-11-14 00:03 Matthias Clasen * configure.in: Add checks for headers new and cassert. 1999-11-13 23:54 Matthias Clasen * grove/Node.h: Previous commit was based on a misunderstanding, revert it. 1999-11-13 23:33 Matthias Clasen * grove/Node.h: Make sure we include config.h in Node.h. 1999-11-13 23:02 Matthias Clasen * develdoc/TODO: Updated. 1999-11-13 22:52 Matthias Clasen * Makefile.am, acconfig.h, acinclude.m4, configure.in, develdoc/TODO, dsssl/Makefile.am, grove/Makefile.am, jade/Makefile.am, jadedoc/Makefile.am, jadedoc/images/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Add more C++ autoconf tests, try to make make dist work. * Makefile.am, groveoa/Makefile.am: Have to include groveao stuff for a windows distribution. 1999-11-12 21:52 Matthias Clasen * acconfig.h, acinclude.m4, configure.in: Add check for placement operator delete. 1999-11-12 21:40 Matthias Clasen * develdoc/TODO: Add more work items. 1999-11-12 21:08 Matthias Clasen * configure.in: Add test for `fancy' new_handler. 1999-11-12 20:54 Matthias Clasen * jade/Makefile.am: Add TextFOTBuilder. 1999-11-12 18:57 Matthias Clasen * develdoc/TODO: Add one more item. 1999-11-12 18:51 Matthias Clasen * jade/HtmlFOTBuilder.cxx, jade/MifFOTBuilder.cxx, jade/RtfFOTBuilder.cxx, jade/SgmlFOTBuilder.cxx, jade/TeXFOTBuilder.cxx, jade/TextFOTBuilder.cxx, jade/TransformFOTBuilder.cxx, jade/jade.cxx: include dsssl_ns.h in all files which live in DSSSL_NAMESPACE, otherwise we are missing the needed `using' directives. 1999-11-12 18:47 Matthias Clasen * configure.in: Add forgotten size checks - otherwise we end up with Char = wchar_t. 1999-11-12 18:33 Matthias Clasen * develdoc/DEVELOPERS, develdoc/TODO: Add some useful developer information (shamelessly stolen from a similar file in fvwm2) and a list of ideas for what to do. 1999-11-12 17:02 Matthias Clasen * acconfig.h, configure.in, dsssl/Makefile.am, jade/Makefile.am, spgrove/Makefile.am, style/Makefile.am: Typo fixes. 1999-11-11 21:48 Matthias Clasen * configure, config/config.guess, config/config.sub, config/install-sh, config/ltconfig, config/ltmain.sh, grove/Makefile.sub, jade/Makefile.sub, spgrove/Makefile.sub, style/Makefile.sub, style/mkversion.pl: Remove generated and unneeded files. 1999-11-11 19:09 Matthias Clasen * README, VERSION: Remove version number redundancy. 1999-11-11 18:59 Matthias Clasen * AUTHORS, Makefile, Makefile.am, Makefile.comm, Makefile.comm.in, Makefile.in, Makefile.lib, Makefile.lib.CC, Makefile.lib.in, Makefile.lib.sun, Makefile.prog, Makefile.prog.in, Makefile.wat, acconfig.h, acinclude.m4, configure, configure.in, dsssl/Makefile.am, grove/Makefile.am, jade/Makefile.am, jadedoc/Makefile.am, jadedoc/images/Makefile.am, spgrove/Makefile.am, spgrove/threads.h, style/DssslApp.cxx, style/DssslAppMessages.msg, style/Makefile.am: First cut at automakifying OpenJade. Don't expect it to work. 1999-11-11 18:36 Matthias Clasen * instmac.pl: Need the perl scripts here too. 1999-11-06 15:06 Matthias Clasen * Makefile, Makefile.comm, Makefile.comm.in, Makefile.lib, Makefile.prog, SP.dsw, SP.mak, build-win32.bat, configure, japan.sgmldecl, sp-generate.mak, sunfix.sh, all/README, all/all.dsp, doc/Makefile, doc/archform.htm, doc/build.htm, doc/catalog, doc/catalog.htm, doc/charset.htm, doc/features.htm, doc/generic.htm, doc/ideas.htm, doc/index.htm, doc/new.htm, doc/nsgmls.htm, doc/sgmldecl.htm, doc/sgmlnorm.htm, doc/sgmlsout.htm, doc/spam.htm, doc/spcat.htm, doc/spent.htm, doc/sx.htm, doc/sysdecl.htm, doc/sysid.htm, doc/xml.htm, generic/EventGenerator.h, generic/ParserEventGeneratorKit.h, generic/SGMLApplication.h, include/Allocator.h, include/ArcEngine.h, include/Attribute.h, include/Attributed.h, include/Big5CodingSystem.h, include/Boolean.h, include/CharMap.cxx, include/CharMap.h, include/CharsetDecl.h, include/CharsetInfo.h, include/CharsetRegistry.h, include/CmdLineApp.h, include/CodingSystem.h, include/CodingSystemKit.h, include/ConsoleOutput.h, include/ContentState.h, include/ContentToken.h, include/CopyOwner.cxx, include/CopyOwner.h, include/DescriptorManager.h, include/Dtd.h, include/EUCJPCodingSystem.h, include/ElementType.h, include/Entity.h, include/EntityApp.h, include/EntityCatalog.h, include/EntityDecl.h, include/EntityManager.h, include/ErrnoMessageArg.h, include/ErrorCountEventHandler.h, include/Event.h, include/EventsWanted.h, include/ExtendEntityManager.h, include/ExternalId.h, include/Fixed2CodingSystem.h, include/GenericEventHandler.h, include/Hash.h, include/HashTable.cxx, include/HashTable.h, include/HashTableItemBase.cxx, include/HashTableItemBase.h, include/IList.h, include/IListBase.h, include/IListIter.h, include/IListIterBase.h, include/IQueue.cxx, include/IQueue.h, include/ISet.cxx, include/ISet.h, include/ISetIter.h, include/IdentityCodingSystem.h, include/InputSource.h, include/InternalInputSource.h, include/Link.h, include/LinkProcess.h, include/List.cxx, include/List.h, include/ListIter.h, include/LiteralStorage.h, include/Location.h, include/Lpd.h, include/Markup.h, include/Message.h, include/MessageArg.h, include/MessageBuilder.h, include/MessageEventHandler.h, include/MessageFormatter.h, include/MessageReporter.h, include/MessageTable.h, include/Mode.h, include/NCVector.h, include/NCVector.sed, include/Named.h, include/NamedResource.h, include/NamedResourceTable.h, include/NamedTable.h, include/Notation.h, include/NotationStorage.h, include/OpenElement.h, include/Options.cxx, include/Options.h, include/OutputByteStream.h, include/OutputCharStream.h, include/Owner.cxx, include/Owner.h, include/OwnerTable.cxx, include/OwnerTable.h, include/ParserApp.h, include/ParserOptions.h, include/PointerTable.cxx, include/PointerTable.h, include/PosixStorage.h, include/Ptr.cxx, include/Ptr.h, include/RangeMap.cxx, include/RangeMap.h, include/Resource.h, include/RewindStorageObject.h, include/SJISCodingSystem.h, include/SOEntityCatalog.h, include/Sd.h, include/SdText.h, include/SearchResultMessageArg.h, include/SgmlParser.h, include/ShortReferenceMap.h, include/StdioStorage.h, include/StorageManager.h, include/StringC.h, include/StringOf.cxx, include/StringOf.h, include/StringResource.h, include/SubstTable.cxx, include/SubstTable.h, include/Syntax.h, include/Text.h, include/TranslateCodingSystem.h, include/TypeId.h, include/URLStorage.h, include/UTF8CodingSystem.h, include/UnicodeCodingSystem.h, include/UnivCharsetDesc.h, include/Vector.cxx, include/Vector.h, include/Win32CodingSystem.h, include/WinApp.h, include/WinInetStorage.h, include/XMLCodingSystem.h, include/XcharMap.cxx, include/XcharMap.h, include/config.h, include/constant.h, include/macros.h, include/rtti.h, include/sptchar.h, include/types.h, include/xnew.h, lib/Allocator.cxx, lib/ArcEngine.cxx, lib/ArcEngineMessages.msg, lib/ArcProcessor.h, lib/Attribute.cxx, lib/Big5CodingSystem.cxx, lib/CatalogEntry.h, lib/CatalogMessages.msg, lib/CharsetDecl.cxx, lib/CharsetInfo.cxx, lib/CharsetRegistry.cxx, lib/CmdLineApp.cxx, lib/CmdLineAppMessages.msg, lib/CodingSystem.cxx, lib/CodingSystemKit.cxx, lib/ConsoleOutput.cxx, lib/ContentState.cxx, lib/ContentToken.cxx, lib/DescriptorManager.cxx, lib/Dtd.cxx, lib/DtdDeclEventHandler.cxx, lib/DtdDeclEventHandler.h, lib/EUCJPCodingSystem.cxx, lib/ElementType.cxx, lib/Entity.cxx, lib/EntityApp.cxx, lib/EntityCatalog.cxx, lib/EntityDecl.cxx, lib/EntityManager.cxx, lib/EntityManagerMessages.msg, lib/EquivClass.h, lib/ErrnoMessageArg.cxx, lib/ErrorCountEventHandler.cxx, lib/Event.cxx, lib/EventGenerator.cxx, lib/EventQueue.h, lib/ExtendEntityManager.cxx, lib/ExternalId.cxx, lib/Fixed2CodingSystem.cxx, lib/GenericEventHandler.cxx, lib/Group.cxx, lib/Group.h, lib/Hash.cxx, lib/IListBase.cxx, lib/Id.cxx, lib/Id.h, lib/IdentityCodingSystem.cxx, lib/InputSource.cxx, lib/InternalInputSource.cxx, lib/Link.cxx, lib/LinkProcess.cxx, lib/LiteralStorage.cxx, lib/Location.cxx, lib/Lpd.cxx, lib/LpdEntityRef.h, lib/Makefile.sub, lib/Markup.cxx, lib/MarkupScan.h, lib/Message.cxx, lib/MessageArg.cxx, lib/MessageEventHandler.cxx, lib/MessageFormatter.cxx, lib/MessageFormatterMessages.msg, lib/MessageReporter.cxx, lib/MessageReporterMessages.msg, lib/MessageTable.cxx, lib/ModeInfo.cxx, lib/ModeInfo.h, lib/Mutex.h, lib/NameToken.h, lib/Notation.cxx, lib/NotationStorage.cxx, lib/NumericCharRefOrigin.cxx, lib/NumericCharRefOrigin.h, lib/OffsetOrderedList.cxx, lib/OffsetOrderedList.h, lib/OpenElement.cxx, lib/OutputByteStream.cxx, lib/OutputCharStream.cxx, lib/OutputState.cxx, lib/OutputState.h, lib/Param.cxx, lib/Param.h, lib/Parser.cxx, lib/Parser.h, lib/ParserApp.cxx, lib/ParserAppMessages.msg, lib/ParserEventGeneratorKit.cxx, lib/ParserMessages.msg, lib/ParserOptions.cxx, lib/ParserState.cxx, lib/ParserState.h, lib/Partition.cxx, lib/Partition.h, lib/PosixStorage.cxx, lib/PosixStorageMessages.msg, lib/Priority.h, lib/Recognizer.cxx, lib/Recognizer.h, lib/RewindStorageObject.cxx, lib/SGMLApplication.cxx, lib/SJISCodingSystem.cxx, lib/SOEntityCatalog.cxx, lib/Sd.cxx, lib/SdFormalError.h, lib/SdText.cxx, lib/SearchResultMessageArg.cxx, lib/SgmlParser.cxx, lib/ShortReferenceMap.cxx, lib/SrInfo.h, lib/StdioStorage.cxx, lib/StdioStorageMessages.msg, lib/StorageManager.cxx, lib/StorageObjectPosition.h, lib/StringVectorMessageArg.cxx, lib/StringVectorMessageArg.h, lib/Syntax.cxx, lib/Text.cxx, lib/TokenMessageArg.cxx, lib/TokenMessageArg.h, lib/TranslateCodingSystem.cxx, lib/Trie.h, lib/TrieBuilder.cxx, lib/TrieBuilder.h, lib/TypeId.cxx, lib/URLStorage.cxx, lib/URLStorageMessages.msg, lib/UTF8CodingSystem.cxx, lib/Undo.cxx, lib/Undo.h, lib/UnicodeCodingSystem.cxx, lib/UnivCharsetDesc.cxx, lib/Win32CodingSystem.cxx, lib/WinApp.cxx, lib/WinInetStorage.cxx, lib/WinInetStorageMessages.msg, lib/XMLCodingSystem.cxx, lib/app_inst.m4, lib/arc_inst.m4, lib/assert.cxx, lib/big5.h, lib/entmgr_inst.m4, lib/events.h, lib/gb2312.h, lib/instmac.pl, lib/iso646-jis.h, lib/iso8859-2.h, lib/iso8859-3.h, lib/iso8859-4.h, lib/iso8859-5.h, lib/iso8859-6.h, lib/iso8859-7.h, lib/iso8859-8.h, lib/iso8859-9.h, lib/jis0201.h, lib/jis0208.h, lib/jis0212.h, lib/ksc5601.h, lib/lib.dsp, lib/lib.rc, lib/memmove.c, lib/mkversion.pl, lib/parseAttribute.cxx, lib/parseCommon.cxx, lib/parseDecl.cxx, lib/parseInstance.cxx, lib/parseMode.cxx, lib/parseParam.cxx, lib/parseSd.cxx, lib/parser_inst.m4, lib/splib.cxx, lib/splib.h, lib/splibpch.h, lib/strerror.c, lib/token.h, lib/xentmgr_inst.m4, nsgmls/Makefile.sub, nsgmls/NsgmlsMessages.msg, nsgmls/RastEventHandler.cxx, nsgmls/RastEventHandler.h, nsgmls/RastEventHandlerMessages.msg, nsgmls/SgmlsEventHandler.cxx, nsgmls/SgmlsEventHandler.h, nsgmls/StringSet.cxx, nsgmls/StringSet.h, nsgmls/nsgmls.cxx, nsgmls/nsgmls.dsp, nsgmls/nsgmls.rc, nsgmls/nsgmls_inst.m4, pubtext/HTML32.dcl, pubtext/HTML32.dtd, pubtext/HTML32.soc, pubtext/HTML4-f.dtd, pubtext/HTML4-s.dtd, pubtext/HTML4.dcl, pubtext/HTML4.dtd, pubtext/HTML4.soc, pubtext/HTMLlat1.ent, pubtext/HTMLspec.ent, pubtext/HTMLsym.ent, pubtext/ISOlat1.ent, pubtext/ISOlat1.sgm, pubtext/html-1.dtd, pubtext/html-1s.dtd, pubtext/html-s.dtd, pubtext/html.dcl, pubtext/html.dtd, pubtext/html.soc, pubtext/xml.dcl, pubtext/xml.soc, sgmlnorm/Makefile.sub, sgmlnorm/SGMLGenerator.cxx, sgmlnorm/SGMLGenerator.h, sgmlnorm/sgmlnorm.cxx, sgmlnorm/sgmlnorm.dsp, spam/CopyEventHandler.cxx, spam/CopyEventHandler.h, spam/Makefile.sub, spam/MarkupEventHandler.cxx, spam/MarkupEventHandler.h, spam/SpamMessages.msg, spam/spam.cxx, spam/spam.dsp, spam/spam.rc, spam/spam_inst.m4, spcat/Makefile.sub, spcat/spcat.cxx, spcat/spcat.dsp, spcat/spcat_inst.m4, spent/Makefile.sub, spent/spent.cxx, spent/spent.dsp, style/DocumentGenerator.h, sx/Makefile.sub, sx/SxMessages.msg, sx/XmlOutputEventHandler.cxx, sx/XmlOutputEventHandler.h, sx/XmlOutputMessages.msg, sx/sx.cxx, sx/sx.dsp, sx/sx.rc, sx/sx_inst.m4: Remove OpenSP stuff. * FILES: [no log message] 1999-11-06 14:59 Matthias Clasen * Makefile.in, Makefile.prog.in, acinclude.m4, configure.in, config/aclocal.m4, jade/Makefile.sub, sgmlnorm/Makefile.sub, spgrove/Makefile.sub, style/Makefile.sub, config/configure.in: Move configure.in, acinclude.m4 to toplevel, add --with-OpenSP-library and --with-OpenSP-includes options to configure, change Makefiles to use the OpenSP stuff determined by these options instead of building libosp. 1999-11-04 22:33 Matthias Clasen * Makefile.comm.in, config/configure.in: Define top_builddir in Makefile.comm.in, protect AC_REVISION argument in configure.in. 1999-11-04 07:48 Matthias Clasen * include/Dtd.h, include/Entity.h, lib/Entity.cxx, lib/ParserMessages.msg, lib/ParserState.h, lib/parseDecl.cxx, doc/xml.htm, spcat/spcat.cxx: More annex K stuff: DTD data entities and notations in doctype declarations. 1999-11-03 07:00 debian * debian/README.Debian, debian/README.opensp-dev, debian/TODO.Debian, debian/changelog, debian/control, debian/copyright.Debian, debian/openjade.doc-base, debian/opensp.doc-base, debian/postinst.openjade, debian/postinst.opensp, debian/prerm.openjade, debian/prerm.opensp, debian/rules, debian/sp_implied.decl: first cut Debian materials 1999-11-03 06:54 debian * config/config.guess, config/config.sub, config/ltconfig, config/ltmain.sh: update from libtool 1.3.3 * include/config.h: for GNUC, eliminate handling SP_MANUAL_INST, SP_DEFINE_TEMPLATES, SP_ANSI_CLASS_INST, SP_HAVE_BOOL, since that's handled by autoconf now * configure: regenerate from configure.in 1.15 1999-11-03 06:47 debian * jade/Makefile.sub, nsgmls/Makefile.sub, spam/Makefile.sub, style/Makefile.sub, sx/Makefile.sub, lib/Makefile.sub: hygenics -- mostly, just change GENSRCS * config/configure.in: automate the test for automated template instantiation in GNU C++, based on use of a version > 2.8; remove the code to backup the original Makefiles 1999-10-31 21:08 Matthias Clasen * doc/xml.htm, include/Dtd.h, include/ExternalId.h, include/Sd.h, lib/ContentState.cxx, lib/ExternalId.cxx, lib/ParserMessages.msg, lib/parseDecl.cxx, lib/parseSd.cxx: More annex K stuff: URN parsing, fixing #implicit and #all attributes for element types. 1999-10-28 06:20 Matthias Clasen * lib/Parser.cxx: also override IMPLYDEF ENTITY and Also override IMPLYDEF ENTITY and IMPLYDEF NOTATION for -w(no-)valid. * include/ParserOptions.h, lib/ParserApp.cxx, lib/ParserMessages.msg, lib/ParserOptions.cxx, lib/parseInstance.cxx: Implement -wimmediate-recursion, -wfully-declared, -wfully-tagged, -wamply-tagged-recursive, -wamply-tagged, -wtype-valid, -wentity-ref, -wexternal-entity-ref, -wintegral (these are all suggested by Annex K). * lib/parseSd.cxx: Allow `naked' CAPACITY SGMLREF in www mode (this fixes a bug in jade-1.2.1), implement one of the `ideas for improving SP'. * include/Entity.h, lib/Entity.cxx, lib/parseCommon.cxx: Move check for ENTITIES REF constraints to Entity classes. * doc/archform.htm, doc/catalog.htm, doc/charset.htm, doc/features.htm, doc/generic.htm, doc/index.htm, doc/new.htm, doc/nsgmls.htm, doc/sgmldecl.htm, doc/sgmlnorm.htm, doc/sgmlsout.htm, doc/spam.htm, doc/spcat.htm, doc/spent.htm, doc/sx.htm, doc/sysdecl.htm, doc/sysid.htm, doc/xml.htm: Some updates wrt. OpenJade changes. More work needed. * nsgmls/SgmlsEventHandler.cxx, nsgmls/SgmlsEventHandler.h, nsgmls/nsgmls.cxx: Add -odata-attribute option to onsgmls. * include/Attribute.h, lib/Attribute.cxx: Reduce code duplication. 1999-10-24 19:25 Matthias Clasen * Makefile.in, README: Apply patches proposed by Karl Eichwalder. 1999-10-24 19:19 Matthias Clasen * Makefile.in, README (jade_1_3_branch): Apply fixes proposed by Karl Eichwalder. 1999-10-22 21:44 Matthias Clasen * lib/ParserMessages.msg: Add some references to error messages. 1999-10-22 21:39 Matthias Clasen * include/Attribute.h, lib/Attribute.cxx, lib/Param.cxx, lib/Param.h, lib/parseDecl.cxx, lib/parseParam.cxx: More annex K stuff: DATA declared values. 1999-10-21 22:39 Brandon Ibach * spcat/Makefile.sub, spcat/spcat_inst.m4: Added spcat_inst.m4 for manual template instantiations 1999-10-21 21:33 Matthias Clasen * style/Makefile.sub: Fix missing dependency by reordering OBJS. 1999-10-19 20:44 Matthias Clasen * jade/TextFOTBuilder.cxx, jade/TextFOTBuilder.h: Adapt to FOTBuilder::Description and mark simple-page-sequence feature as supported. * jade/jade.cxx: Fix -? output for -t option. * jade/SgmlFOTBuilder.cxx: Mark online feature as supported. 1999-10-18 20:41 Matthias Clasen * lib/Parser.cxx, lib/Parser.h, lib/parseSd.cxx, include/EntityCatalog.h, lib/DtdDeclEventHandler.cxx, lib/DtdDeclEventHandler.h, lib/EntityCatalog.cxx, lib/Makefile.sub, lib/SOEntityCatalog.cxx, spcat/spcat.cxx: DTDDECL support. This needs testing! 1999-10-15 21:22 Matthias Clasen * include/CharMap.cxx, lib/Attribute.cxx, lib/SOEntityCatalog.cxx, lib/WinApp.cxx, lib/XMLCodingSystem.cxx: Include the relevant patches from sp-1.3.4 1999-10-15 21:19 Matthias Clasen * include/CharMap.cxx, lib/Attribute.cxx, lib/SOEntityCatalog.cxx, lib/WinApp.cxx, lib/XMLCodingSystem.cxx (jade_1_3_branch): Include the relevant patches from sp-1.3.4 (ignoring fixes to template instantiation with gcc-2.95 and an sx patch which we already had). 1999-10-15 21:10 Matthias Clasen * NEWS, jade/TransformFOTBuilder.cxx, jade/TransformFOTBuilder.h, jade/jade.cxx, jadedoc/index.htm: Add sgml-raw, xml-raw backends (patch by Brandon Ibach). 1999-10-15 21:01 Matthias Clasen * NEWS, jade/TransformFOTBuilder.cxx, jade/TransformFOTBuilder.h, jade/jade.cxx, jadedoc/index.htm (jade_1_3_branch): Add the sgml-raw, xml-raw backends (patch by Brandon Ibach). 1999-10-15 20:44 Matthias Clasen * spgrove/GroveBuilder.cxx (jade_1_3_branch): Fix a crash with empty CDATA attributes. 1999-10-15 20:40 Matthias Clasen * spgrove/GroveBuilder.cxx: Fix crash with empty CDATA attributes. 1999-10-15 07:56 Matthias Clasen * doc/nsgmls.htm, include/ParserApp.h, include/SgmlParser.h, lib/Parser.h, lib/ParserApp.cxx, lib/ParserState.cxx, lib/ParserState.h, lib/SgmlParser.cxx: Remove -x option again, active doctypes are now handled via the -a option and SgmlParser::activateLinkType(), rendering the function name inaccurate but making the active: key to sgml-parse work in dsssl. 1999-10-13 18:40 Matthias Clasen * lib/Parser.h, lib/ParserMessages.msg, lib/parseInstance.cxx, lib/parseParam.cxx: Catch some more CONCUR-related errors. 1999-10-13 12:17 pn * NEWS: Note about fo validation. 1999-10-12 21:34 Matthias Clasen * lib/ParserState.cxx, lib/parseParam.cxx: Report error for too many concurrent document instances only once. 1999-10-12 11:07 Matthias Clasen * VERSION, include/Dtd.h, include/ParserApp.h, include/SgmlParser.h, lib/Dtd.cxx, lib/Parser.h, lib/ParserApp.cxx, doc/new.htm, doc/nsgmls.htm, doc/sysdecl.htm, lib/ParserMessages.msg, lib/ParserState.cxx, lib/ParserState.h, lib/SgmlParser.cxx, lib/parseInstance.cxx, lib/parseParam.cxx, lib/parseSd.cxx: Implement limited CONCUR support, update SP documentation, move OpenSP news to doc/new.htm, bump OpenSP version number to 1.4devel, fix a small, old bug in Annex K support. 1999-10-11 19:12 Matthias Clasen * include/ContentState.h, include/ElementType.h, include/Entity.h, include/OpenElement.h, include/Sd.h, include/config.h, lib/ContentState.cxx, lib/ElementType.cxx, lib/Parser.cxx, lib/ParserMessages.msg, lib/ParserState.cxx, lib/ParserState.h, lib/Sd.cxx, lib/parseCommon.cxx, lib/parseDecl.cxx, lib/parseInstance.cxx, lib/parseSd.cxx: More of annex K implemented: IMPLYDEF, declarations on subdocs, entity reference constraints, predefined entities. 1999-10-07 07:19 Matthias Clasen * grove/grove.dsp, lib/lib.dsp, spgrove/spgrove.dsp, style/style.dsp (jade_1_3_branch): Correct dll names. Untested. Windows hackers, test this!!! 1999-10-07 07:12 Matthias Clasen * style/primitive.cxx (jade_1_3_branch): Apply the fix for duplicate property rcsname `tokens' already in main branch. 1999-10-06 09:13 pn * style/primitive.cxx: (StrintToList): Merged with chane of 1.3 branch. 1999-10-06 08:59 pn * style/primitive.cxx (jade_1_3_branch): StringToList: Protect the list while it is built with a ELObjDynamicRoot. (important bug fix). 1999-09-30 06:55 pn * jadedoc/index.htm: Changes to "Current OpenJade Limitations": added info on FOT validation etc. 1999-09-30 06:51 pn * include/macros.h, lib/assert.cxx: ASSERT(): Use the assert macro from the C/C++ library on the system if that is available. 1999-09-29 08:05 pn * develdoc/jadedoc.sgml: Merged changes from valid_fo_branch. 1999-09-29 07:34 Matthias Clasen * style/style_inst.m4 (jade_1_3_branch): Make manual inst work with gcc-2.95. 1999-09-29 07:22 pn * style/Expression.cxx, style/FlowObj.cxx, style/Insn.cxx, style/Insn2.h, style/Interpreter.cxx, style/InterpreterMessages.msg, style/MacroFlowObj.cxx, style/MacroFlowObj.h, style/ProcessContext.cxx, style/ProcessContext.h, style/SosofoObj.h, style/primitive.cxx, style/style_inst.m4: Merged valid_fo_branch into main trunk. 1999-09-29 07:12 pn * style/DocumentGenerator.h: DocumentGenerator: Added missing emit method. 1999-09-28 20:27 pn * style/FlowObj.cxx (valid_fo_branch): CompoundExtensionFlowObj::processInner(): push/pop principal port if fo has no named fos. 1999-09-28 18:25 Matthias Clasen * jadedist/files.txt, jadedist/bin-files.txt: One more forgotten file. 1999-09-28 17:37 Matthias Clasen * FILES, jadedist/bin-files.txt, jadedist/files.txt: Bring the file lists up-to-date. 1999-09-27 17:31 Matthias Clasen * style/primitive.cxx: Add a quick fix for the rcsname clash between model-group/content-tokens and attribute-def/tokens. 1999-09-27 17:28 Matthias Clasen * Makefile.in, Makefile.comm.in, lib/Makefile.sub, style/Makefile.sub, style/style_inst.m4: Apply two patches by Adam di Carlo. 1999-09-27 17:14 Matthias Clasen * spgrove/GroveBuilder.cxx: Return the default value for attributes declarations on notations. 1999-09-27 17:10 Matthias Clasen * style/DocumentGenerator.cxx: Emit the complete doctype (minus parameter entities) 1999-09-25 21:23 Matthias Clasen * doc/index.htm, doc/nsgmls.htm, doc/sgmlnorm.htm, doc/spam.htm, doc/sx.htm, doc/sysdecl.htm: Document all -w options, add identification text for AFDR conformance. 1999-09-24 12:00 Matthias Clasen * style/DocumentGenerator.cxx: Emit the dtd (unfinished). 1999-09-23 09:45 Matthias Clasen * style/DocumentGenerator.cxx, style/InterpreterMessages.msg, style/Makefile.sub, style/TransformationMode.cxx: Document generator handles most entity references and pis, TransformationMode issues proper error messages. 1999-09-22 21:45 Matthias Clasen * style/DocumentGenerator.cxx, style/DocumentGenerator.h, style/DssslApp.cxx, style/StyleEngine.cxx, style/StyleEngine.h: More TL framework: The beginnings of an SGML document generator. Some debugging/test code left in the TL path. If you use a TL spec, you will get a file jade-grove.out which is an SGML document created from the grove of your input file. 1999-09-20 12:10 Matthias Clasen * dsssl/catalog, dsssl/spec.dtd, dsssl/style-sheet.dtd: Reverted style-sheet.dtd to James' version in order to be completely compatible. Add a new spec.dtd containing the full DSSSL architecture, available via public identifier -//OpenJade//DTD DSSSL Specification//EN. 1999-09-20 11:58 Matthias Clasen * Makefile, Makefile.comm, Makefile.lib, Makefile.prog, dsssl/demo.dsl, dsssl/style-sheet.dtd, style/DssslApp.cxx, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/ELObj.cxx, style/ELObj.h, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/Makefile.sub, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx, style/StyleEngine.h, style/TransformationMode.cxx, style/TransformationMode.h, style/primitive.cxx, style/primitive.h: Merge the tl_branch. 1999-09-17 10:07 pn * develdoc/jadedoc.sgml (valid_fo_branch): Added info about FlowObj space limits and some info on validation. Fixed some small sypos as well. 1999-09-16 22:02 pn * style/SosofoObj.h (valid_fo_branch): FlowObj: Fix copy constructor to also call SosofoObj copy constructor. * style/FlowObj.cxx (valid_fo_branch): Paragraph::Validator_::isValid(): Allow objects with afAlways flag set. 1999-09-16 20:24 pn * style/Expression.cxx, style/FlowObj.cxx, style/Insn.cxx, style/Insn2.h, style/Interpreter.cxx, style/InterpreterMessages.msg, style/MacroFlowObj.cxx, style/MacroFlowObj.h, style/ProcessContext.cxx, style/ProcessContext.h, style/SosofoObj.h, style/primitive.cxx, style/style_inst.m4 (valid_fo_branch): Most of validation finished. 1999-09-15 17:28 Matthias Clasen * NEWS, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h: Cleanup internal defines and SchemeParser messages. Detect duplicate vars in bindings. 1999-09-13 11:24 Matthias Clasen * style/SchemeParser.cxx, style/SchemeParser.h: Implement interal defines (ie defines at the begin of bodies). 1999-09-13 11:17 pn * style/FlowObj.cxx: FlowObj::fixCharNICs(): Fixed a stupid bug that made OJ crash if char-map was anything but a procedure. 1999-09-13 11:12 pn * style/FlowObj.cxx, style/ProcessContext.cxx, style/ProcessContext.h (valid_fo_branch): First cut at FOT validation. Doesn't work yet. 1999-09-10 11:58 Matthias Clasen * jadedoc/index.htm (jade_1_3_branch): Document internal definitions as missing. 1999-09-10 11:47 Matthias Clasen * style/TransformationMode.cxx: file TransformationMode.cxx was initially added on branch tl_branch. * style/Interpreter.cxx, style/Interpreter.h, style/Makefile.sub, style/SchemeParser.cxx, style/StyleEngine.cxx, style/TransformationMode.cxx, style/TransformationMode.h (tl_branch): Add a new class (somewhat inappropriately) named TransformationMode, which collects the parsed associations, compiles them and sorts them by priority. Now the fun can begin. NOTE: some debugging printfs left in the code for now. * style/TransformationMode.h: file TransformationMode.h was initially added on branch tl_branch. 1999-09-09 16:18 Matthias Clasen * jadedoc/index.htm: One forgotten item. 1999-09-09 16:14 Matthias Clasen * jadedoc/autoconf.htm, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm: Merge doc fixes. 1999-09-09 15:28 Matthias Clasen * jadedoc/autoconf.htm, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm (jade_1_3_branch): More doc improvements. 1999-09-09 13:48 pn * jadedoc/dsssl2.htm: INfo about char-map extra values added. 1999-09-09 12:49 pn * jade/HtmlFOTBuilder.cxx, jade/SgmlFOTBuilder.cxx: Support inline-space-space and char-map ICs. 1999-09-09 12:39 pn * style/FOTBuilder.cxx, style/FOTBuilder.h: Added FOTBuilder::setCharMap(), SaveFOTBuilder::setCharMap() and SaveFOTBuilder::setInlineSpaceSpace(). Changed behaviour of FOTBuilder::characters(const Vector &). * style/InheritedC.cxx: Support symbols uppercase, lowercase and capitalize for the char-map inherited characteristic under the -2 option. 1999-09-09 12:22 pn * dsssl/fot.dtd: inline-space-space and char-map inherited characteristics added. 1999-09-08 20:39 pn * style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg: const fix and completed implementation of PublicIdCharPropValues. 1999-09-08 19:47 Matthias Clasen * NEWS: Replace some occurances of `Jade' by `OpenJade'. Add an entry for char-map. 1999-09-08 19:04 pn * style/Interpreter.cxx, style/Interpreter.h: Private copy constructor and assignment operator added for CharProp and CharPropValues (with derivatives) classes. 1999-09-08 18:40 pn * style/FlowObj.cxx, style/InheritedC.cxx, style/Insn.cxx, style/InterpreterMessages.msg, style/ProcessContext.cxx, style/SosofoObj.h: Implemented char-map. 1999-09-08 17:53 Matthias Clasen * config/install-sh (tl_branch): install-sh was missing on tl_branch * style/Interpreter.cxx (tl_branch): A const fix for gcc. 1999-09-08 06:13 pn * jadedoc/contributors.htm, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm (jade_1_3_branch): Merged fixes from main branch. 1999-09-07 22:29 Matthias Clasen * dsssl/style-sheet.dtd, style/DssslApp.cxx, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/ELObj.cxx, style/ELObj.h, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx, style/StyleEngine.h, style/primitive.cxx, style/primitive.h (tl_branch): Initial TL framework. 1999-09-07 22:28 pn * jadedoc/contributors.htm, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm: ALT attributes on some IMG tags fixed and a topy fix. 1999-09-07 22:06 pn * style/InheritedC.cxx, style/Interpreter.h: char-map inherited characteristic support. (Only type checked, not used yet.) 1999-09-07 21:57 Matthias Clasen * jadedoc/TeX.htm, jadedoc/contributors.htm, jadedoc/copying.txt, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/jade.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm, jadedoc/images/background.gif, jadedoc/images/dsssltitle.gif, jadedoc/images/space.gif, jadedoc/images/top-of-page.gif: New docs merged to main line. 1999-09-07 21:51 Matthias Clasen * jadedoc/index.htm (jade_1_3_branch): Lift some sections from the old docs. 1999-09-07 18:16 pn * jade/HtmlFOTBuilder.cxx, jade/HtmlFOTBuilder.h, jade/Makefile.sub, jade/MifFOTBuilder.cxx, jade/MifFOTBuilder.h, jade/RtfFOTBuilder.cxx, jade/RtfFOTBuilder.h, jade/SgmlFOTBuilder.cxx, jade/SgmlFOTBuilder.h, jade/TeXFOTBuilder.cxx, jade/TeXFOTBuilder.h, jade/TransformFOTBuilder.cxx, jade/TransformFOTBuilder.h, jade/jade.cxx: Support character properties as default values for character NICs for strings of characters. Add FOT::Description to backends. 1999-09-07 18:09 pn * testsuite/Makefile: Big Name Change (TM). * testsuite/expr-lang.dsl, testsuite/expr-lang.expected: Character property tests. 1999-09-07 18:03 pn * style/DssslApp.cxx, style/DssslApp.h, style/FOTBuilder.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/InheritedC.cxx, style/Insn.cxx, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/ProcessContext.cxx, style/ProcessContext.h, style/SchemeParser.cxx, style/SosofoObj.h, style/StyleEngine.cxx, style/StyleEngine.h, style/primitive.cxx, style/style_inst.m4: Reworked character property handling. Declarations now have same semantics as other body specifications. Char FO NICs are now correctly defaulted by char properties (possible to turn off). 1999-09-07 09:51 Matthias Clasen * jadedoc/contributors.htm, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm, jadedoc/images/background.gif, jadedoc/images/dsssltitle.gif, jadedoc/images/space.gif, jadedoc/images/top-of-page.gif (jade_1_3_branch): More documentation fixes, images added. * jadedoc/images/dsssltitle.gif: file dsssltitle.gif was initially added on branch jade_1_3_branch. * jadedoc/images/space.gif: file space.gif was initially added on branch jade_1_3_branch. * jadedoc/images/top-of-page.gif: file top-of-page.gif was initially added on branch jade_1_3_branch. * jadedoc/images/background.gif: file background.gif was initially added on branch jade_1_3_branch. 1999-09-06 23:55 Matthias Clasen * jadedoc/index.htm: file index.htm was initially added on branch jade_1_3_branch. * jadedoc/TeX.htm, jadedoc/contributors.htm, jadedoc/copying.txt, jadedoc/dsssl2.htm, jadedoc/index.htm, jadedoc/jade.htm, jadedoc/mif.htm, jadedoc/rtf.htm, jadedoc/tex.htm, jadedoc/transform.htm, jadedoc/xmlfo.htm (jade_1_3_branch): The new documentation, images still missing. * jadedoc/tex.htm: file tex.htm was initially added on branch jade_1_3_branch. * jadedoc/rtf.htm: file rtf.htm was initially added on branch jade_1_3_branch. * jadedoc/xmlfo.htm: file xmlfo.htm was initially added on branch jade_1_3_branch. * jadedoc/contributors.htm: file contributors.htm was initially added on branch jade_1_3_branch. 1999-09-05 20:39 Matthias Clasen * develdoc/missing, dsssl/dsssl.dtd, dsssl/style-sheet.dtd, jade/HtmlFOTBuilder.cxx, jade/HtmlFOTBuilder.h, jade/MifFOTBuilder.cxx, jade/MifFOTBuilder.h, jade/RtfFOTBuilder.cxx, jade/RtfFOTBuilder.h, jade/SgmlFOTBuilder.cxx, jade/SgmlFOTBuilder.h, jade/TeXFOTBuilder.cxx, jade/TeXFOTBuilder.h, jade/jade.cxx, style/DssslApp.cxx, style/DssslApp.h, style/Expression.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/InheritedC.cxx, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx, style/StyleEngine.h, style/primitive.cxx, style/primitive.h: Merge the features branch. 1999-09-05 14:46 Avi Kivity * jade/TextFOTBuilder.cxx: MSVC fix for gcc fix. Sigh. 1999-09-05 10:12 Avi Kivity * jade/TextFOTBuilder.cxx, style/FOTBuilder.h: Gcc fixes. 1999-09-04 20:23 Matthias Clasen * develdoc/missing, dsssl/dsssl.dtd, dsssl/style-sheet.dtd, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx (features): Support sgml-grove-plan (currently only give warnings for grove plan mismatches). Replace dsssl/dsssl.dtd by the version found in the standard. 1999-09-04 17:22 Avi Kivity * jade/TextFOTBuilder.cxx: Paragraph indents implemented. 1999-09-02 21:31 Matthias Clasen * style/DssslApp.cxx, style/Expression.cxx, style/FlowObj.cxx, style/InheritedC.cxx, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, dsssl/builtins.dsl, style/SosofoObj.h, style/StyleEngine.cxx, style/primitive.cxx, style/primitive.h (features): Second cut at feature-checking. 1999-09-02 20:02 Avi Kivity * spcat/Makefile.sub: Binary with an `o', in accordance with convention. * jade.dsw, spcat/spcat.dsp: Spcat for Win32. * style/FOTBuilder.cxx, style/FOTBuilder.h, style/ProcessContext.cxx, style/ProcessContext.h, style/style_inst.m4: Groundwork for allowing partial emit() from SaveFOTBuilder. * jade/TextFOTBuilder.cxx: Removed some unnecessary buffering. 1999-09-01 20:17 Avi Kivity * grove/grove.dsp, groveoa/groveoa.dsp, lib/lib.dsp, spgrove/spgrove.dsp, style/style.dsp: DLL loading speed optimization. * jade/TextFOTBuilder.cxx: Paragraph quadding implemented (partial). 1999-09-01 19:38 Matthias Clasen * style/sdata.h: Fix sdata entity map for cyrillic-capital-letter-de. * style/sdata.h (jade_1_3_branch): fix sdata entity map for cyrillic-capital-letter-de. 1999-09-01 07:42 Matthias Clasen * Makefile.lib.in, configure, config/configure.in, grove/Makefile.sub, lib/Makefile.sub, spgrove/Makefile.sub, style/Makefile.sub: Set library version numbers explicitly. Do not forget to change the current number 0:0:0 to 0:1:0, 1:0:0 or 1:0:1 for the next release depending on the changes (if in doubt, consult the libtool manual). 1999-09-01 07:25 Matthias Clasen * Makefile.lib.in, configure, config/configure.in, grove/Makefile.sub, lib/Makefile.sub, spgrove/Makefile.sub, style/Makefile.sub (jade_1_3_branch): Set library versions explicitly. All renamed libraries start out as 0:0:0. 1999-08-31 21:33 Matthias Clasen * jade/HtmlFOTBuilder.cxx, jade/HtmlFOTBuilder.h, jade/Makefile.sub, jade/MifFOTBuilder.cxx, jade/MifFOTBuilder.h, jade/RtfFOTBuilder.cxx, jade/RtfFOTBuilder.h, jade/SgmlFOTBuilder.cxx, jade/SgmlFOTBuilder.h, jade/TeXFOTBuilder.cxx, dsssl/Makefile.jadetex, dsssl/style-sheet.dtd, jade/TeXFOTBuilder.h, jade/jade.cxx, style/DssslApp.cxx, style/DssslApp.h, style/Expression.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/InheritedC.cxx, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/SosofoObj.h, style/StyleEngine.cxx, style/StyleEngine.h, style/primitive.cxx (features): First cut at feature-checking. 1999-08-31 20:40 Avi Kivity * groveoa/groveoa.def: Removed linker warning caused by the Great Name Change (tm). 1999-08-30 11:28 Avi Kivity * spcat/Makefile.sub: Binaries renamed to avoid conflict with Jade package. 1999-08-30 10:35 Avi Kivity * Makefile, Makefile.comm, Makefile.lib, Makefile.prog: Non-autoconf build support for unix systems removed. 1999-08-30 10:30 Avi Kivity * grove/Makefile.sub, grove/grove.dsp, groveoa/groveoa.dsp, jade/Makefile.sub, jade/jade.dsp, lib/Makefile.sub, lib/lib.dsp, nsgmls/Makefile.sub, nsgmls/nsgmls.dsp, sgmlnorm/Makefile.sub, sgmlnorm/sgmlnorm.dsp, spam/Makefile.sub, spam/spam.dsp, spent/Makefile.sub, spent/spent.dsp, spgrove/Makefile.sub, spgrove/spgrove.dsp, style/Makefile.sub, style/style.dsp, sx/Makefile.sub, sx/sx.dsp: Binaries renamed to avoid conflict with Jade package. 1999-08-30 10:25 Avi Kivity * grove/Makefile.sub, jade/Makefile.sub, lib/Makefile.sub, nsgmls/Makefile.sub, sgmlnorm/Makefile.sub, spam/Makefile.sub, spent/Makefile.sub, spgrove/Makefile.sub, style/Makefile.sub, sx/Makefile.sub, grove/grove.dsp, groveoa/groveoa.dsp, jade/jade.dsp, lib/lib.dsp, nsgmls/nsgmls.dsp, sgmlnorm/sgmlnorm.dsp, spam/spam.dsp, spent/spent.dsp, spgrove/spgrove.dsp, style/style.dsp, sx/sx.dsp (jade_1_3_branch): Binaries renamed to avoid conflict with Jade package. 1999-08-29 22:45 Matthias Clasen * Makefile.in: Another hygienic patch by Adam. 1999-08-29 21:15 Matthias Clasen * configure, config/configure.in, config/install-sh, config/install.sh: Apply a cleanup patch by Adam, rename install.sh to install-sh since the autoconf manual recommends it. 1999-08-28 20:39 Matthias Clasen * Makefile.in, NEWS, configure, config/configure.in: Remove the stupid --enable-xyz stuff again (Makefile targets work just fine). Add spcat to Makefile.in and NEWS. 1999-08-28 20:16 Matthias Clasen * contrib/README: Mention the psgml stuff. 1999-08-28 20:09 Matthias Clasen * doc/index.htm: Link in spcat.htm 1999-08-28 20:04 Matthias Clasen * doc/spcat.htm, spcat/Makefile.sub, spcat/spcat.cxx: A command line interface to the catalog manager. 1999-08-28 20:01 Matthias Clasen * contrib/customize.dtd, contrib/psgml-dsssl.el, contrib/psgml-jade.el: Some contributions to make working with emacs/psgml and jade easier. 1999-08-27 20:26 Matthias Clasen * jadedist/files.txt: Add missing files. 1999-08-26 21:59 Matthias Clasen * configure, config/aclocal.m4, config/configure.in, Makefile.in: Add separate --enable-xyz options for each program. Fix several bugs in configure.in. 1999-08-26 12:40 Avi Kivity * jade-generate.mak: Generate style/jade_version.h. 1999-08-26 11:54 Matthias Clasen * Makefile.lib.in, VERSION, configure, config/configure.in, lib/mkversion.pl, style/Makefile.sub, style/jade_version.h, style/mkversion.pl, style/style.dsp: Separate library version numbers for libsp and the rest. These are derived from the SP and Jade version numbers in VERSION. style/jade_version.h is now a generated file. 1999-08-26 11:09 Avi Kivity * jade/TextFOTBuilder.cxx: Displayed flow objects in paragraphs (really nested paragraphs) implemented. 1999-08-26 08:57 Matthias Clasen * style/SchemeParser.cxx: Fix a bug introduced in the parseCond rewrite. 1999-08-26 08:07 Matthias Clasen * NEWS: Document cond parsing updates. 1999-08-25 21:35 Matthias Clasen * style/SchemeParser.cxx: Disable multiple bodies in cond clauses when -2 extension are not enabled. Implement (test => recipient) cond clauses. 1999-08-25 21:04 Avi Kivity * jade/Makefile.sub, jade/jade.cxx, jade/jade.dsp: Integrated the plaintext backend. * jade/TextFOTBuilder.cxx, jade/TextFOTBuilder.h: Initial revision. Supports simple-page-sequence, character, and non-nested paragraphs. 1999-08-25 20:24 Avi Kivity * style/FOTBuilder.cxx, style/FOTBuilder.h: Bugfix: SaveFOTBuilder's call list is terminated at all times. Also, all class parameters to FOTBuilder's methods are STYLE_APIs. 1999-08-24 15:58 pn * style/InterpreterMessages.msg (jade_1_3_branch): varCharPropertyExprUnsupported: New message. * style/Interpreter.cxx (jade_1_3_branch): (Interpreter::addCharProperty, Interpreter::setCharProperty): Avoid crashing when expression is non-constant. 1999-08-24 10:34 Matthias Clasen * Makefile.prog.in, configure, config/configure.in: Merged --program-prefix support to the main branch. 1999-08-24 10:18 Matthias Clasen * Makefile.prog.in, configure, config/configure.in (jade_1_3_branch): Support --program-prefix and friends in configure. 1999-08-23 21:11 Avi Kivity * style/style_inst.m4: MSVC template fix. 1999-08-23 15:20 Avi Kivity * style/style_inst.m4: Manual template instantiations for SaveFOTBuilder. 1999-08-23 14:47 Avi Kivity * style/FOTBuilder.h: Member templates moved to namespace scope for compatibility with older compilers. 1999-08-23 09:14 Avi Kivity * jadedist/bin-files.txt, jadedist/bin-files.txt (jade_1_3_branch): Added dsssl/extensions.dsl to the binary distribution. 1999-08-22 23:30 Matthias Clasen * testsuite/expr-lang.dsl, testsuite/expr-lang.expected: Examples from the standard added. 1999-08-22 21:44 Matthias Clasen * style/Interpreter.cxx, style/Interpreter.h, style/SchemeParser.cxx, dsssl/builtins.dsl: Add "internal definitions", ie we can use (define internal: var value) in builtins.dsl now; this binds var to value for use in builtins.dsl, but keeps it undefined as far as users are concerned. Defining var in the style sheet will not affect uses of var in builtins.dsl. (define internal: ...) is not allowed in style sheets. 1999-08-22 21:18 Avi Kivity * style/jade_version.h: Version number indicates 1.4 development. * dsssl/fot.dtd, jade/SgmlFOTBuilder.cxx, style/FOTBuilder.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/InheritedC.cxx, testsuite/flow-obj.dsl: Merged the tbe-1 branch. 1999-08-22 14:37 Avi Kivity * Makefile.comm, Makefile.comm.in: .msg implicit rule fix; old rule remains for non-gnu make. 1999-08-22 14:13 Avi Kivity * Makefile, Makefile.in: Inter-directory dependency fixes. 1999-08-22 12:26 Avi Kivity * lib/lib.dsp: Win32 locale fix. 1999-08-22 10:27 Avi Kivity * testsuite/flow-obj.dsl: file flow-obj.dsl was initially added on branch tbe-1. * dsssl/fot.dtd, jade/SgmlFOTBuilder.cxx, style/FOTBuilder.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/InheritedC.cxx, testsuite/flow-obj.dsl (tbe-1): Side-by-side, side-by-side-item implemented. 1999-08-21 18:30 Avi Kivity * style/FOTBuilder.cxx, style/FOTBuilder.h (tbe-1): SaveFOTBuilder can emit() multiple times (emit() made const). As a side-effect, SaveFOTBuilder is copyable and assignable. 1999-08-21 18:25 Avi Kivity * contrib/catalog, contrib/transform.dsl: SGML transformation procedures. 1999-08-21 15:52 Avi Kivity * style/jade_version.h: Version number: 1.3pre1 1999-08-21 12:34 Avi Kivity * jadedist/bin-files.txt: dsssl\builtins.dsl included in binary distribution. 1999-08-21 12:19 Avi Kivity * Makefile, Makefile.in: Directory dependency fix. * Makefile.comm: Removed dependency on m4. 1999-08-21 11:52 Avi Kivity * jadedoc/jade.htm: Installation procedure documented. 1999-08-21 11:39 Avi Kivity * testsuite/expr-lang.dsl: Tests defined a little less painfully. 1999-08-21 11:26 Avi Kivity * testsuite/expr-lang.dsl: Line-terminator fix. * testsuite/expr-lang.expected: Language-dependent char tests. 1999-08-21 11:08 Avi Kivity * testsuite/Makefile: 'make clean' target * testsuite/expr-lang.dsl: Language-dependent char tests. 1999-08-20 20:36 Avi Kivity * testsuite/expr-lang.expected: Expression language expected test results. 1999-08-20 20:31 Avi Kivity * testsuite/Makefile: Testsuite driver. * testsuite/expr-lang.dsl, testsuite/null.sgml: Copyright information. 1999-08-20 20:17 Avi Kivity * testsuite/expr-lang.dsl: Expression language tests. Currently tests only the char=? procedure, but ready for much more. * testsuite/null.sgml: Null SGML instance. 1999-08-20 20:11 Avi Kivity * style/style.dsp: Win32 has locale support. 1999-08-20 19:41 Matthias Clasen * NEWS: Document -V(define. * dsssl/builtins.dsl: Fix some bugs introduced by blindly typing in the definitions from the standard. 1999-08-20 19:10 Matthias Clasen * style/StyleEngine.h, style/Interpreter.cxx, style/Interpreter.h, style/StyleEngine.cxx: Parse cmdline definitions properly and allow -Vvariable1 -Vvariable2=value2 -V\(define\ variable3\ value3\) as equivalent to (define variable1 #t) (define variable2 "value2") (define variable3 value3) 1999-08-20 19:05 Avi Kivity * dsssl/builtins.dsl: Implemented char and string primitives. 1999-08-20 18:42 Avi Kivity * lib/entmgr_inst.m4: Corrected usage of config macros. * dsssl/builtins.dsl: (ancestors) infinite loop fixed. 1999-08-20 10:49 Avi Kivity * contrib/rtf2doc.pl: Handle Word errors gracefully 1999-08-20 07:05 Matthias Clasen * configure, config/configure.in, lib/entmgr_inst.m4, lib/parser_inst.m4: Replace gcc-2.95 specific fixes by more generic ones. 1999-08-19 22:54 Avi Kivity * contrib/README, contrib/rtf2doc.pl: Script to convert .rtf files to .doc, embedding graphics in the process. 1999-08-19 21:55 Avi Kivity * contrib/README: A short description of what this directory is and what's in it. 1999-08-19 17:08 Avi Kivity * jadedoc/jade.htm: Build intructions updated. 1999-08-19 12:58 Avi Kivity * style/style.dsp: Added LangObj.cxx. * style/FlowObj.cxx: Fix for MSVC++. 1999-08-19 12:51 Avi Kivity * groveoa/GroveNode.cxx: Fix typo in ElementTypeNode implementation. 1999-08-18 20:48 pn * style/Interpreter.cxx, style/charProps.h: Interpreter::installCharProperties(): Add values for break-before-priority and break-after-priority character properties. 1999-08-18 13:23 pn * style/Interpreter.cxx: Interpreter::installCharProperties(): Use CharMap<>.setRange() instead of setChar() for ranges of characters. 1999-08-17 18:51 Matthias Clasen * lib/entmgr_inst.m4: One more duplicate removed. * lib/entmgr_inst.m4: OK, I'll stop committing now until I'm sure there are no more dupes. 1999-08-17 18:41 Matthias Clasen * jade/MifFOTBuilder_inst.m4, lib/entmgr_inst.m4: Remove duplicate instantiations. 1999-08-17 17:45 Matthias Clasen * configure, config/configure.in: gcc-2.95 fixes for configure. * NEWS, develdoc/missing: Doc updates. 1999-08-17 10:44 Matthias Clasen * grove/Node.cxx, grove/Node.h, groveoa/CGroveBuilder.cxx, groveoa/CGroveBuilder.h, groveoa/GroveNode.cxx, groveoa/groveoa.idl, spgrove/GroveBuilder.cxx, style/ELObjPropVal.h, style/primitive.cxx: Apply prlabs1 patch contained in JadeMIF-1.0h by Kathleen Marszalek. 1999-08-16 22:12 Matthias Clasen * NEWS: More news. 1999-08-16 21:48 Matthias Clasen * style/Expression.cxx: Implement force!. 1999-08-16 18:38 Matthias Clasen * jade/MifFOTBuilder_inst.m4, lib/entmgr_inst.m4, lib/parser_inst.m4: Temp fixes for template initialization to allow compilation with gcc-2.95. 1999-08-16 18:31 Matthias Clasen * style/primitive.cxx: const corrections for picky gcc-2.95. 1999-08-16 18:16 Matthias Clasen * style/FlowObj.cxx: Remove forgotten printf. 1999-08-16 00:00 Matthias Clasen * style/InheritedC.cxx: Change PublicIdInheritedC to return a string, not a symbol. 1999-08-15 22:45 Matthias Clasen * style/FlowObj.cxx, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/primitive.cxx, style/primitive.h: Implement declare-char-characteristic+property. We do not actually support any nonstandard character NICs, they are just ignored (and are available as char properties). Move the nonstandard functionality of sgml-parse and expt to external procedures of the same name. Apply a patch by Peter Nilsson to fix several bugs in the SchemeParser part of the character properties implementation. 1999-08-15 21:31 Matthias Clasen * dsssl/extensions.dsl: All extensions known to jade. 1999-08-14 11:43 Matthias Clasen * style/primitive.h: Forgot to remove map and c..r from the header. 1999-08-13 20:38 Matthias Clasen * dsssl/builtins.dsl, style/primitive.cxx: Replace the cxx map and c..r primitives by scheme equivalents. 1999-08-13 20:26 Matthias Clasen * style/ProcessContext.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/Insn.cxx, style/SosofoObj.h, style/charProps.h, style/ELObjPropVal.h, style/Expression.cxx, style/FOTBuilder.cxx, style/Insn2.h: {Interpreter,SchemeParser}.{h,cxx},InterpreterMessages.msg,primitiv e.cxx, style_inst.m4: EL side of character properties. ProcessContext.cxx: process-children-trim uses input-whitespace?. charProps.h: New file, some standard character properties extracted from Unicode. SosofoObj.h,ProcessContext.cxx,Insn.cxx: Save current node in SetNonInheritedCsSosofoObj. FOTBuilder.{h,cxx},FlowObj.cxx,Insn2.h,Insn.cxx,Expression.cxx: Special inheritance for character NICs, using a new SetImplicitCharInsn. ELObjPropVal.h: New file, extracted from primitive.cxx. * jade/TeXFOTBuilder.cxx: Emit all character NICs, emit script as string without prefix. Mainly for testing purposes. Since the character NICs are not used at all by the jadetex macros and blow up the size of the tex files, this should probably be changed before 1.3. 1999-08-13 20:09 Matthias Clasen * style/Interpreter.h, style/Interpreter.cxx, style/InterpreterMessages.msg, style/SchemeParser.cxx, style/SchemeParser.h, style/primitive.cxx, style/style_inst.m4: The expression language part of character properties. 1999-08-12 13:52 Matthias Clasen * style/SchemeParser.cxx: Check that a unit-name is not an exponent-marker. * style/InterpreterMessages.msg, style/primitive.cxx: Add some dynamic roots and a new error message to map-constructor. 1999-08-05 22:33 Matthias Clasen * style/primitive.cxx: Small fix for with-language. 1999-08-05 22:29 Matthias Clasen * NEWS, develdoc/missing: Doc updates. * style/Interpreter.cxx, style/Interpreter.h, style/SchemeParser.cxx, style/SchemeParser.h: Implement special-query-expressions. Note: the keywords are treated as syntactic keywords (the standard isn't explicit about this). 1999-08-04 20:01 Matthias Clasen * style/StyleEngine.cxx: Fix parsing of declarations in multiple parts. 1999-08-04 19:55 Matthias Clasen * jadedoc/jade.htm, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/SchemeParser.cxx: Fixes for default-language-declaration (Peter Nilsson ). Check for valid character-names and numbers when parsing standard-chars (test case: xyz$!% #d-5). Check for valid unit-name when parsing unit-declaration (test case: (define-unit xyz$!% 2m) ). Fix parsing of numbers with #d prefix and decimal dot (test case: #d6.0e+2m2). * style/Style.h, style/Style.cxx: Correct subobject handling of color spaces. 1999-08-04 19:51 Matthias Clasen * style/ELObj.cxx, style/ELObj.h: Print methods for UnspecifiedObj and ErrorObj by Peter Nilsson . 1999-08-02 18:33 Matthias Clasen * style/SchemeParser.cxx: Fix keyword and identifier parsing. Previously, some valid keywords were not accepted, eg ::, a: and :a:. * dsssl/builtins.dsl: replace all occurrences of siblings by rsiblings. * NEWS: document the -Dvar=val patch. 1999-07-31 18:53 Matthias Clasen * jadedoc/jade.htm, style/DssslApp.cxx, style/Interpreter.cxx: Applied patch to allow -Dvar=val for string values. 1999-07-25 08:13 Avi Kivity * jade/jade.dsp, lib/instmac.m4, lib/lib.dsp, nsgmls/nsgmls.dsp, spam/spam.dsp, spgrove/spgrove.dsp, style/style.dsp, sx/sx.dsp: lib/instmac.m4 > lib/instmac.pl 1999-07-23 20:57 Avi Kivity * style/jade_version.h: Version number indicates 1.3 development. * include/Entity.h: Classes declared SP_API in order to survive MSVC (caused by builtins.dsl entity dereference) 1999-07-23 20:28 Avi Kivity * style/common_inst.m4: More uninstantiated templates 1999-07-23 19:49 Avi Kivity * style/common_inst.m4: Add uninstantiated templates 1999-07-23 18:56 Avi Kivity * build-win32.bat: Script to build Jade for Win32 * jade-generate.mak, sp-generate.mak: Removed dependencies on unix tools (m4, chmod, rm) 1999-07-23 18:10 Avi Kivity * jade/MifFOTBuilder.cxx, jade/RtfFOTBuilder.cxx, jade/SgmlFOTBuilder.cxx, jade/TeXFOTBuilder.cxx, style/FOTBuilder.cxx, style/FOTBuilder.h, style/FlowObj.cxx, style/ProcessContext.cxx, style/ProcessContext.h: simple-page-sequence headers and footers unserialized 1999-07-23 18:00 Avi Kivity * Makefile: Mif and HTML enabled by default 1999-07-23 17:55 Avi Kivity * dsssl/catalog: System id resolved for builtins.dsl 1999-07-23 17:47 Avi Kivity * style/Interpreter.cxx: Fix compilation problem 1999-07-23 17:36 Matthias Clasen * Makefile, Makefile.comm, Makefile.lib, Makefile.prog: Restore original Makefiles. 1999-07-23 17:19 Matthias Clasen * style/Interpreter.cxx: Fix compilation with SP_HAVE_LOCALE=0. 1999-07-23 17:19 Avi Kivity * msggen.pl: Fix Perl -w warning 1999-07-23 17:15 Matthias Clasen * Makefile, Makefile.comm, Makefile.lib, Makefile.prog, jade/TeXFOTBuilder.cxx, lib/Makefile.sub, nsgmls/Makefile.sub, spam/Makefile.sub, style/Makefile.sub, sx/Makefile.sub: Cleanup to make it compile. Added enough dependencies for ./configure; make to work without intermediate make gen. 1999-07-23 15:50 Matthias Clasen * Makefile.lib.in, NEWS, VERSION, configure, config/aclocal.m4, config/configure.in, config/ltconfig, config/ltmain.sh, grove/Makefile.sub, include/config.h, jade/TeXFOTBuilder.cxx, jade/jade.dsp, lib/CmdLineAppMessages.msg, lib/Makefile.sub, spgrove/Makefile.sub, spgrove/threads.h, style/DssslAppMessages.msg, style/InterpreterMessages.msg, style/Makefile.sub, style/jade_version.h, style/primitive.cxx: Just merged jade_1_2_2 to the main branch. 1999-07-22 21:56 Matthias Clasen * develdoc/missing: List of missing pieces from DSSSL. * develdoc/jadedoc.sgml: Documentation of jade internals. * style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.msg, style/Style.cxx, style/Style.h, style/primitive.cxx, NEWS: support for all standard color-spaces via conversion to device rgb. 1999-07-20 10:24 Matthias Clasen * spgrove/Makefile.sub, style/Makefile.sub: More .lo dependency fixes. 1999-07-20 09:29 Avi Kivity * style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.rc (jade_1_2_1_branch): Sync with style/InterpreterMessages.msg 1999-07-20 08:57 Avi Kivity * style/jade_version.h (jade_1_2_1_branch): Version number bumped to 1.2.2 1999-07-19 21:45 Matthias Clasen * Makefile.comm.in, configure, config/configure.in: Change rule for m4.cxx to use perl and remove check for m4 from configure. 1999-07-19 09:19 Matthias Clasen * jade/HtmlFOTBuilder_inst.cxx, jade/HtmlMessages.h, jade/HtmlMessages.rc, jade/JadeMessages.h, jade/JadeMessages.rc, jade/MifFOTBuilder_inst.cxx, jade/MifMessages.h, jade/MifMessages.rc, jade/RtfFOTBuilder_inst.cxx, jade/RtfMessages.h, jade/RtfMessages.rc, jade/TeXFOTBuilder_inst.cxx, jade/TeXMessages.h, jade/TeXMessages.rc, jade/TransformFOTBuilder_inst.cxx, lib/ArcEngineMessages.h, lib/ArcEngineMessages.rc, lib/CatalogMessages.h, lib/CatalogMessages.rc, lib/CmdLineAppMessages.h, lib/CmdLineAppMessages.rc, lib/EntityManagerMessages.h, lib/EntityManagerMessages.rc, lib/MessageFormatterMessages.h, lib/MessageFormatterMessages.rc, lib/MessageReporterMessages.h, lib/MessageReporterMessages.rc, lib/ParserAppMessages.h, lib/ParserAppMessages.rc, lib/ParserMessages.cxx, lib/ParserMessages.h, lib/ParserMessages.rc, lib/PosixStorageMessages.h, lib/PosixStorageMessages.rc, lib/StdioStorageMessages.h, lib/StdioStorageMessages.rc, lib/URLStorageMessages.h, lib/URLStorageMessages.rc, lib/WinInetStorageMessages.h, lib/WinInetStorageMessages.rc, lib/app_inst.cxx, lib/arc_inst.cxx, lib/entmgr_inst.cxx, lib/parser_inst.cxx, lib/version.h, lib/xentmgr_inst.cxx, nsgmls/NsgmlsMessages.h, nsgmls/NsgmlsMessages.rc, nsgmls/RastEventHandlerMessages.h, nsgmls/RastEventHandlerMessages.rc, nsgmls/nsgmls_inst.cxx, spam/SpamMessages.h, spam/SpamMessages.rc, spam/spam_inst.cxx, spgrove/grove_inst.cxx, style/DssslAppMessages.h, style/DssslAppMessages.rc, style/FlowObj_inst.cxx, style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.rc, style/common_inst.cxx, style/primitive_inst.cxx, style/style_inst.cxx, sx/SxMessages.h, sx/SxMessages.rc, sx/XmlOutputMessages.h, sx/XmlOutputMessages.rc, sx/sx_inst.cxx: Remove most generated files. 1999-07-16 00:58 Matthias Clasen * NEWS, style/primitive.cxx, style/InterpreterMessages.msg (jade_1_2_1_branch): Add forgotten procedure assoc to NEWS. Improve error reporting for new primitives. 1999-07-15 18:27 Avi Kivity * NEWS (jade_1_2_1_branch): HTML and MIF backends are now enabled by default 1999-07-15 16:16 Avi Kivity * jade/jade.dsp (jade_1_2_1_branch): Mif and html enabled by default 1999-07-15 15:57 Matthias Clasen * Makefile.lib.in, configure, config/configure.in, config/ltconfig, config/ltmain.sh, grove/Makefile.sub, include/config.h, lib/Makefile.sub, spgrove/Makefile.sub, spgrove/threads.h, style/Makefile.sub (jade_1_2_1_branch): add more messages to configure (me), add hurd support (Adam Di Carlo ), add inter-library dependencies (Adam) remove -ansi (Adam) 1999-07-15 12:44 Avi Kivity * style/primitive_inst.cxx, style/primitive_inst.m4 (jade_1_2_1_branch): Previous change (1.1.1.3.2.1) backed out - not requierd. 1999-07-15 11:08 Avi Kivity * style/primitive.cxx (jade_1_2_1_branch): Yet another egcs adaptaion 1999-07-15 09:10 Avi Kivity * style/jade_version.h (jade_1_2_1_branch): version number bumped to -pre3 * style/primitive.cxx, style/primitive_inst.cxx, style/primitive_inst.m4 (jade_1_2_1_branch): ArrayDeleter<> hack replaced with Vector<> for compiler template support compatibility, as well as general cleanness. 1999-07-14 12:43 Avi Kivity * style/primitive.cxx (jade_1_2_1_branch): previous change (1.4.2.2) backed out, as it contains a non-related, breaking change. * style/primitive.cxx (jade_1_2_1_branch): egcs bug workaround 1999-07-13 23:36 Matthias Clasen * VERSION, lib/CmdLineAppMessages.h, lib/CmdLineAppMessages.msg, lib/CmdLineAppMessages.rc, lib/version.h, style/DssslAppMessages.h, style/DssslAppMessages.msg, style/DssslAppMessages.rc, style/jade_version.h (jade_1_2_1_branch): Change the version info messages to use "OpenSP" and "OpenJade" instead of "SP" and "Jade". Bump the OpenSP version number to 1.3.4 and the OpenJade version number to 1.2.2-pre2 (for the next prerelease). 1999-07-13 23:02 Matthias Clasen * configure, config/aclocal.m4, config/configure.in (jade_1_2_1_branch): Use a more versatile macro smr_SWITCH (stolen from fvwm) for the optional backends. These are compiled in now by default. * style/jade_version.h (jade_1_2_1_branch): Bump version number to 1.2.2-pre1. * style/primitive.cxx (jade_1_2_1_branch): add workaround for an egcs bug 1999-07-13 11:47 Avi Kivity * lib/instmac.pl: file instmac.pl was initially added on branch jade_1_2_1_branch. * lib/instmac.pl (jade_1_2_1_branch): Removed from branch. * lib/instmac.pl, lib/instmac.pl (jade_1_2_1_branch): Replacement for instmac.m4 1999-07-13 11:28 Matthias Clasen * config/configure.in: add --enable-html arg to configure 1999-07-13 11:22 Matthias Clasen * configure, config/configure.in (jade_1_2_1_branch): add an --enable-html arg to configure for building the html backend. 1999-07-13 09:43 Avi Kivity * jade/TeXFOTBuilder_inst.cxx (jade_1_2_1_branch): Sync with TexFOTBuilder_inst.m4 (generated file) * style/primitive.cxx (jade_1_2_1_branch): Compilation problem fix: egcs extensions replaced with std C++ constructs. * style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.msg, style/InterpreterMessages.rc (jade_1_2_1_branch): Merged in 1.4 from the development branch * jade/TeXFOTBuilder.cxx (jade_1_2_1_branch): Compilation problem fix (utlilty functions made members of TeXFOTBuilder to allow access) 1999-07-11 19:11 Matthias Clasen * style/FOTBuilder.cxx, style/FOTBuilder.h, jade/TeXFOTBuilder.cxx, style/InheritedC.cxx: inline-space-space is no longer ignored by FOTBuilder and TeXFOTBuilder. I haven't yet added support to jadetex. 1999-07-08 23:48 Matthias Clasen * sx/XmlOutputEventHandler.cxx: merge the fix applied in the stable branch. 1999-07-08 23:38 Matthias Clasen * sx/XmlOutputEventHandler.cxx (jade_1_2_1_branch): applied a fix for `sx -xcdata' from James. 1999-07-08 21:10 Matthias Clasen * style/SchemeParser.cxx (jade_1_2_1_branch): SchemeParser::parseMake(): ignore duplicate keywords in make expressions. 1999-07-08 21:04 Matthias Clasen * dsssl/jadetex.dtx (jade_1_2_1_branch): a *complete* version of jadetex 2.7, the last commit was truncated. 1999-07-08 20:52 Matthias Clasen * NEWS, style/SchemeParser.cxx: SchemeParser::parseMake(): ignore duplicate keywords in make expressions. 1999-07-08 00:00 Matthias Clasen * dsssl/style-sheet.dtd: allow declarations before the first part. 1999-07-07 23:57 Matthias Clasen * dsssl/jadetex.dtx: jadetex 2.7 again. The previous commit had this file truncated. 1999-07-07 23:40 Matthias Clasen * Makefile.comm.in: generate dependency information for libtool objects (.lo) as well. * include/config.h: add a default value for DEFAULT_SCHEME_BUILTINS. * style/Interpreter.cxx, style/Interpreter.h, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx: cleanup the declaration element stuff. The parsing is done by the SchemeParser, the Interpreter simply holds the resulting values. 1999-07-01 23:40 Matthias Clasen * jadedoc/jade.htm, dsssl/catalog, dsssl/style-sheet.dtd (jade_1_2_1_branch): add supported decl archforms to style-sheet.dtd; change the pubid for that file, but leave the old catalog entry. 1999-07-01 22:49 Matthias Clasen * NEWS, jadedoc/jade.htm: add a pointer to NEWS at the top of jade.htm. * style/Interpreter.cxx, style/Interpreter.h, style/LangObj.cxx, style/LangObj.h, style/ELObj.cxx, style/ELObj.h, style/EvalContext.h, style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.msg, style/InterpreterMessages.rc, style/Makefile.sub, style/SchemeParser.cxx, style/SchemeParser.h, style/primitive.cxx, style/primitive.h: language-dependent expression language procedures and external procedure "UNREGISTERED::OpenJade//Procedure::language" to create language objects by reference to a POSIX locale. 1999-07-01 22:44 Matthias Clasen * dsssl/catalog, dsssl/style-sheet.dtd: add supported decl archforms to dtd, change pubid to "-//OpenJade//DTD DSSSL Style Sheet//EN", add catalog entry for new pubid, but leave old entry. 1999-06-30 00:34 Matthias Clasen * NEWS, dsssl/Makefile.jadetex, dsssl/jadetex.dtx, jade/TeXFOTBuilder.cxx, jade/TeXFOTBuilder_inst.m4: merge the TeX backend additions from the stable branch. 1999-06-30 00:19 Matthias Clasen * dsssl/ChangeLog: forgotten file. * dsssl/unicode.sty, jade/TeXFOTBuilder.cxx, dsssl/jadetex.dtx, jade/TeXFOTBuilder_inst.m4, NEWS, dsssl/Makefile.jadetex (jade_1_2_1_branch): PDF bookmarks support for TeX backend/jadetex from Sebastian, who gives credit for the patches to J.-M. Kubek (kubek@insa-tlse.fr). 1999-06-30 00:15 Matthias Clasen * NEWS: document query language additions 1999-06-29 23:54 Matthias Clasen * style/DssslApp.cxx, style/DssslApp.h, style/Interpreter.cxx, style/Interpreter.h, style/SchemeParser.cxx, style/SchemeParser.h, style/StyleEngine.cxx, style/StyleEngine.h: char-repertoire, add-name-chars and add-separator-chars declaration element type forms, -s cmdline switch to make jade forget its builtin character repertoire. 1999-06-29 23:51 Matthias Clasen * Makefile.comm.in, configure, config/configure.in, dsssl/builtins.dsl: fix default location for builtins.dsl (you can change that at runtime via a SYSTEM catalog entry); remove duplicate procedures from builtins.dsl. 1999-06-29 21:20 Matthias Clasen * msggen.pl: prepare msggen.pl to create .po files for gettext. 1999-06-29 21:04 Matthias Clasen * Makefile.in, NEWS, configure, config/configure.in, dsssl/builtins.dsl, style/DssslApp.cxx, style/DssslApp.h, style/GroveManager.h, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.msg, style/InterpreterMessages.rc: support for "scheme builtins" and a little fix for gettext detection. The following things are still to do for the "scheme builtins": the windows build process has to install builtins.dsl somewhere and define DEFAULT_SCHEME_BUILTINS accordingly; we have to decide which of the added expression language procedures should stay in cxx and which should be defined in scheme. 1999-06-26 20:44 Matthias Clasen * NEWS, style/DssslSpecEventHandler.cxx, style/DssslSpecEventHandler.h, style/Interpreter.cxx, style/Interpreter.h, style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.msg, style/InterpreterMessages.rc, style/StyleEngine.cxx, style/style_inst.m4, style/style_inst.cxx: standard-chars and map-sdata-entity declaration element type forms, "line-feed" and "carriage-return" predefined character names. * style/charNames.h: "line-feed" and "carriage-return" predefined character names. 1999-06-25 19:19 Matthias Clasen * NEWS: log of user-visible changes. 1999-06-23 18:53 Matthias Clasen * style/primitive.cxx: replace uses of ELObj::asChar() by ELObj::charValue(). * style/InterpreterMessages.cxx, style/InterpreterMessages.h, style/InterpreterMessages.msg, style/InterpreterMessages.rc: add forgotten error messages for the new expression language primitives. 1999-06-22 23:31 Matthias Clasen * style/primitive.cxx: Fix the recently-discovered bug in +/- wrt. length-specs. 1999-06-22 23:17 Matthias Clasen * style/primitive.cxx, style/primitive.h: Add a lot of expression language primitives, and map-constructor. 1999-06-15 08:07 Avi Kivity * Makefile.jade, README.configure, dsssl/FOT.tex, dsssl/demoMaster.tex, groveoa/WinApp.cxx, groveoa/WinApp.h, jade/DssslApp.cxx, jade/DssslApp.h, jade/DssslAppMessages.h, jade/DssslAppMessages.msg, jade/DssslAppMessages.rc, jade/fot.dtd, jade/jade_version.h, spent/spent_inst.cxx, spent/spent_inst.m4, style/NotationStorage.cxx, style/NotationStorage.h: Leftover file from pre-1.2.1 jade release removed OpenJade-1.4devel/INSTALL0000644000000000000000000001722707046720574010567 Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. OpenJade-1.4devel/Makefile.am0000644000021000000240000000160607070156165011571 ## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = check-news ## FIXME groveoa is missing, since an .am with only EXTRA_DIST doesn't work. SUBDIRS = jadedoc dsssl grove spgrove style jade intl po pkginclude_HEADERS = config.h docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = README ABOUT-NLS NEWS COPYING AUTHORS ChangeLog BUILT_SOURCES = config.h msggen.pl ## Note that we include the windows-only aux files. ## We include msggen.pl, since it won't be generated on Windows. EXTRA_DIST = instmac.pl msggen.pl jade.dsw jade.mak \ jade-generate.mak all @PACKAGE@-@VERSION@.spec dist-hook: if test -f $(top_srcdir)/update-changelog; then \ cd $(top_srcdir); \ ./update-changelog; \ cp $(top_srcdir)/ChangeLog $(top_distdir); \ fi dist-zip: dist-dir -chmod -R a+r $(distdir) zip -rql $(distdir).zip $(distdir) -rm -rf $(distdir) OpenJade-1.4devel/NEWS0000644000021000000240000001124407070147445010234 Changes in OpenJade 1.4devel * Query rules. * The "media", "title" and "alternate" attributes in stylesheet PIs are supported according to the HTML 4.0 specification. * A new external procedure with public identifier "UNREGISTERED::OpenJade//Procedure::uri-ref-address" returns an address object to the supplied URI. This allows hyperlinks to resources of the WWW in documents. Currently URI references are implemented in the HTML/CSS and TeX backends. * The command line option --help gives a summary of the usage and all supported command line options. * Separate cmdline options for the two SGML parsers used for the document and the style-sheet. * GNU-style long command line options are now supported in addition to the short ones. * OpenJade is internationalized. Translations for many messages are available in German and Swedish. * The standard flow objects check that their content is valid. * Internal defines (ie defines at the begin of a body) are supported. * The char-map inherited characteristic is supported. * (test => recipient) cond clauses are supported. Changes in OpenJade 1.3 * The SGML backend will no emit linebreaks when used as -t sgml-raw. * OpenJade can bind variables to arbitrary values on the command line. * The prlabs1 module of the SGML property set is supported. * Style sheet extensions.dsl lists all known external procedures ready for easy inclusion as an external-specification. * External procedure with public identifier "UNREGISTERED::OpenJade//Procedure::expt" allows to form integral powers of quantities. * External procedure with public identifier "UNREGISTERED::OpenJade//Procedure::sgml-parse" allows to parse wrt. an architecture. * OpenJade supports force! for inherited characteristics. * OpenJade supports character properties. * OpenJade supports special-query-expressions. * OpenJade can bind variables to string values on the command line. * All standard color spaces supported. * OpenJade ignores duplicate keywords in make expressions, as mandated by DSSSL. * External procedure with public identifier "UNREGISTERED::OpenJade//Procedure::language" to create a language object by reference to a POSIX locale. * Language-dependent procedures of the expression language: language?, current-language, declare-default-language, with-language, define-language, char?, char<=?, char>=?, char-ci=?, char-ci?, char-ci<=?, char-ci>=?, char-upcase, char-downcase, string-ci=?, string-equiv?, string?, string<=?, string>=?, string-ci?, string-ci<=?, string-ci>=?. * The style-sheet.dtd derived from the dsssl architecture has been extended (in a backwards compatible way) to include the delaration element type forms supported by Jade. The public identifier for the dtd is "-//OpenJade//DTD DSSSL Style Sheet//EN" * char-repertoire, add-name-chars and add-separator-chars declaration element type forms are supported. When given the -s cmdline flag, Jade doesn't use its builtin character repertoire. * Most of the derived procedures in the query language: current-root, node-list-reduce, node-list-contains?, node-list-remove-duplicates, node-list-union, node-list-intersection, node-list-difference, node-list-symmetric-difference, node-list-union-map, node-list-some?, node-list-every?, node-list-filter, node-list->list, node-list-tail, node-list-head, node-list-sublist, node-list-count, node-list-last, node-list-property, origin, origin-to-subnode-rel, tree-root, grove-root, source, subtree, subgrove, ancestors, grove-root-path, rsiblings, ipreced, ifollow, grove-before?, sort-in-tree-order, tree-before?, tree-before, property-lookup, select-by-property, select-by-null-property, select-by-missing-property, attribute, referent, q-element, q-class, q-sdata. Changes in OpenJade 1.2.2 * The HTML and MIF backends are now enabled by default. * The TeX backend has support for PDF bookmarks. This is supported by the new version of jadetex which is included. * Predefined character names line-feed and carriage-return for the character numbers 10 and 13. * standard-chars and map-sdata-entity declaration element type forms are supported. * Style language additions: map-constructor. * + and - return a length-spec if any of there arguments is a length-spec. * Most of the non-core expression language: c...r, assoc, keyword->string, string->keyword, exact?, inexact?, zero?, positive?, negative?, odd?, even?, exp, log, sin, cos, tan, asin, acos, atan, expt, exact->inexact, inexact->exact, quantity->number, string->list, list->string, map, time?, time<=?, time>=?. 1.2.1 The begin. OpenJade-1.4devel/acconfig.h0000644000021000000240000000732107067710204011453 // Copyright (C) 1999 Matthias Clasen, Peter Nilsson // See the file COPYING for copying permissions. #include @TOP@ /* these are needed for GNU gettext */ #undef ENABLE_NLS #undef HAVE_CATGETS #undef HAVE_GETTEXT #undef HAVE_LC_MESSAGES #undef HAVE_STPCPY #undef OPENJADE_PACKAGE #undef OPENJADE_VERSION #undef OPENJADE_LOCALE_DIR /* set this to the location of builtins.dsl */ #define DEFAULT_SCHEME_BUILTINS "builtins.dsl" /* define this to build the html backend */ #undef JADE_HTML /* define this to build the mif backend */ #undef JADE_MIF /* define this to build the grove in a separate thread, if possible */ #undef USE_THREADS /* define this appropriately if the type sig_atomic_t is not available */ #undef sig_atomic_t /* define this if your system misses new.h */ #undef SP_NEW_H_MISSING /* define this if set_new_handler() has to be declared extern "C" */ #undef SP_SET_NEW_HANDLER_EXTERN_C /* define this to build a multi-byte version */ #undef SP_MULTI_BYTE /* define this to include template definitions in the headers */ #undef SP_DEFINE_TEMPLATES /* define this to compile explicit template instantiations */ #undef SP_MANUAL_INST /* define this if new.h doesn't declare void *operator new(size_t, void *p) */ #undef SP_DECLARE_PLACEMENT_OPERATOR_NEW /* define this if the new handler takes size_t and returns int. */ #undef SP_FANCY_NEW_HANDLER @BOTTOM@ #ifdef HAVE_BOOL #define SP_HAVE_BOOL #endif /* HAVE_BOOL */ #if (SIZEOF_BOOL == 1) #define SP_SIZEOF_BOOL_1 #endif #if (SIZEOF_WCHAR_T == SIZEOF_UNSIGNED_SHORT) #define SP_WCHAR_T_USHORT #endif #ifdef SP_HAVE_SETMODE #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\r' #define SP_LINE_TERM2 '\n' #endif #endif /* not SP_HAVE_SETMODE */ #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\n' #endif #ifndef HAVE_NEW_FOR_SCOPING // This simulates the new ANSI "for" scope rules #define for if (0); else for #endif /* HAVE_NEW_FOR_SCOPING */ #ifndef SP_HAVE_TYPENAME #define typename /* as nothing */ #endif #ifndef SP_DLLEXPORT #define SP_DLLEXPORT /* as nothing */ #endif #ifndef SP_DLLIMPORT #define SP_DLLIMPORT /* as nothing */ #endif #ifdef SP_USE_DLL #ifdef BUILD_LIBSP #define SP_API SP_DLLEXPORT #else #define SP_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define SP_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef SP_WIDE_SYSTEM #ifndef SP_MULTI_BYTE #define SP_MULTI_BYTE #endif #endif #ifdef HAVE_NAMESPACES #define SP_NAMESPACE OpenSP #define DSSSL_NAMESPACE OpenJade_DSSSL #define GROVE_NAMESPACE OpenJade_Grove #endif /* HAVE_NAMESPACES */ #ifdef SP_NAMESPACE #define SP_NAMESPACE_SCOPE SP_NAMESPACE:: #else #define SP_NAMESPACE_SCOPE #endif /* SP_NAMESPACE */ #ifdef HAVE_DYNAMIC_CAST #define SP_HAVE_RTTI #endif /* HAVE_DYNAMIC_CAST */ #ifdef HAVE_TYPENAME #define SP_HAVE_TYPENAME #endif /* HAVE_TYPENAME */ #ifdef HAVE_PATHNAME_STYLE_DOS #define SP_MSDOS_FILENAMES #else #define SP_POSIX_FILENAMES #endif /* HAVE_PATHNAME_STYLE_DOS */ #ifdef HAVE_INSTANTIATIONS #define SP_ANSI_CLASS_INST #endif /* HAVE_INSTANTIATIONS */ #ifdef HAVE_SETLOCALE #define SP_HAVE_LOCALE #endif /* HAVE_SETLOCALE */ #ifdef HAVE_GETTEXT #define SP_HAVE_GETTEXT #endif /* HAVE_GETTEXT */ #ifdef WORDS_BIGENDIAN #define SP_BIG_ENDIAN #endif /* WORDS_BIGENDIAN */ #ifdef HAVE_LIBTHREADS #define SP_MUTEX_MACH #endif /* HAVE_LIBTHREADS */ #ifdef HAVE_LIBPTHREAD #define SP_MUTEX_PTHREADS #endif /* HAVE_LIBPTHREAD */ #ifdef HAVE_PLACEMENT_OPERATOR_DELETE #define SP_HAVE_PLACEMENT_OPERATOR_DELETE #endif /* HAVE_PLACEMENT_OPERATOR_DELETE */ #ifndef HAVE_PLACEMENT_OPERATOR_NEW #define SP_DECLARE_PLACEMENT_OPERATOR_NEW #endif /* HAVE_PLACEMENT_OPERATOR_NEW */ #ifndef HAVE_NAMESPACE_STD #define SP_NO_STD_NAMESPACE #endif /* HAVE_NAMESPACE_STD */ OpenJade-1.4devel/acinclude.m40000644000021000000240000001606407037433062011727 dnl OJ_CHECK_SIZEOF(TYPE, HEADER [, CROSS-SIZE]) AC_DEFUN(OJ_CHECK_SIZEOF, [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl dnl The cache variable name. define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $1) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include #include <$2> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3] , , AC_CV_NAME=$3))])dnl AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) dnl @synopsis AC_CXX_PLACEMENT_OPERATOR_DELETE dnl dnl If the compiler supports void delete(size_t,void*), define dnl HAVE_PLACEMENT_OPERATOR_DELETE. dnl dnl @author Matthias Clasen dnl AC_DEFUN(AC_CXX_PLACEMENT_OPERATOR_DELETE, [AC_CACHE_CHECK(whether the compiler supports placement operator delete, ac_cv_cxx_placement_operator_delete, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include ], [class Thing { public: Thing() { }; void *operator new(size_t,bool) { }; void operator delete(size_t,void*) { }; };], ac_cv_cxx_placement_operator_delete=yes, ac_cv_cxx_placement_operator_delete=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_placement_operator_delete" = yes; then AC_DEFINE(HAVE_PLACEMENT_OPERATOR_DELETE,, [define if the compiler supports placement operator delete]) fi ]) dnl @synopsis AC_CXX_TYPENAME dnl dnl If the compiler recognizes the typename keyword, define HAVE_TYPENAME. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_TYPENAME, [AC_CACHE_CHECK(whether the compiler recognizes typename, ac_cv_cxx_typename, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([templateclass X {public:X(){}};], [X z; return 0;], ac_cv_cxx_typename=yes, ac_cv_cxx_typename=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_typename" = yes; then AC_DEFINE(HAVE_TYPENAME,,[define if the compiler recognizes typename]) fi ]) dnl @synopsis AC_CXX_NEW_FOR_SCOPING dnl dnl If the compiler accepts the new for scoping rules (the scope of a dnl variable declared inside the parentheses is restricted to the dnl for-body), define HAVE_NEW_FOR_SCOPING. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_NEW_FOR_SCOPING, [AC_CACHE_CHECK(whether the compiler accepts the new for scoping rules, ac_cv_cxx_new_for_scoping, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,[ int z = 0; for (int i = 0; i < 10; ++i) z = z + i; for (int i = 0; i < 10; ++i) z = z - i; return z;], ac_cv_cxx_new_for_scoping=yes, ac_cv_cxx_new_for_scoping=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_new_for_scoping" = yes; then AC_DEFINE(HAVE_NEW_FOR_SCOPING,,[define if the compiler accepts the new for scoping rules]) fi ]) dnl @synopsis AC_CXX_EXPLICIT_INSTANTIATIONS dnl dnl If the C++ compiler supports explicit instanciations syntax, dnl define HAVE_INSTANTIATIONS. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_EXPLICIT_INSTANTIATIONS, [AC_CACHE_CHECK(whether the compiler supports explicit instantiations, ac_cv_cxx_explinst, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([template class A { T t; }; template class A;], [], ac_cv_cxx_explinst=yes, ac_cv_cxx_explinst=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_explinst" = yes; then AC_DEFINE(HAVE_INSTANTIATIONS,, [define if the compiler supports explicit instantiations]) fi ]) dnl @synopsis AC_CXX_DYNAMIC_CAST dnl dnl If the compiler supports dynamic_cast<>, define HAVE_DYNAMIC_CAST. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_DYNAMIC_CAST, [AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>, ac_cv_cxx_dynamic_cast, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include class Base { public : Base () {} virtual void f () = 0;}; class Derived : public Base { public : Derived () {} virtual void f () {} };],[ Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1;], ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_dynamic_cast" = yes; then AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>]) fi ]) dnl @synopsis AC_CXX_NAMESPACES dnl dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_NAMESPACES, [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) dnl @synopsis AC_CXX_BOOL dnl dnl If the compiler recognizes bool as a separate built-in type, dnl define HAVE_BOOL. Note that a typedef is not a separate dnl type since you cannot overload a function such that it accepts either dnl the basic type or the typedef. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_BOOL, [AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, ac_cv_cxx_bool, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ int f(int x){return 1;} int f(char x){return 1;} int f(bool x){return 1;} ],[bool b = true; return f(b);], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_bool" = yes; then AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type]) fi ]) AC_DEFUN(AC_DEFINE_DIR, [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse($3, , AC_DEFINE_UNQUOTED($1, "$ac_expanded"), AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3)) ]) dnl @synopsis AC_CXX_MUTABLE dnl dnl If the compiler allows modifying class data members flagged with dnl the mutable keyword even in const objects (for example in the dnl body of a const member function), define HAVE_MUTABLE. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_MUTABLE, [AC_CACHE_CHECK(whether the compiler supports the mutable keyword, ac_cv_cxx_mutable, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ class A { mutable int i; public: int f (int n) const { i = n; return i; } }; ],[A a; return a.f (1);], ac_cv_cxx_mutable=yes, ac_cv_cxx_mutable=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_mutable" = yes; then AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword]) fi ]) OpenJade-1.4devel/aclocal.m40000644000021000000240000011202007070155622011363 dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. dnl OJ_CHECK_SIZEOF(TYPE, HEADER [, CROSS-SIZE]) AC_DEFUN(OJ_CHECK_SIZEOF, [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl dnl The cache variable name. define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $1) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include #include <$2> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3] , , AC_CV_NAME=$3))])dnl AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) dnl @synopsis AC_CXX_PLACEMENT_OPERATOR_DELETE dnl dnl If the compiler supports void delete(size_t,void*), define dnl HAVE_PLACEMENT_OPERATOR_DELETE. dnl dnl @author Matthias Clasen dnl AC_DEFUN(AC_CXX_PLACEMENT_OPERATOR_DELETE, [AC_CACHE_CHECK(whether the compiler supports placement operator delete, ac_cv_cxx_placement_operator_delete, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include ], [class Thing { public: Thing() { }; void *operator new(size_t,bool) { }; void operator delete(size_t,void*) { }; };], ac_cv_cxx_placement_operator_delete=yes, ac_cv_cxx_placement_operator_delete=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_placement_operator_delete" = yes; then AC_DEFINE(HAVE_PLACEMENT_OPERATOR_DELETE,, [define if the compiler supports placement operator delete]) fi ]) dnl @synopsis AC_CXX_TYPENAME dnl dnl If the compiler recognizes the typename keyword, define HAVE_TYPENAME. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_TYPENAME, [AC_CACHE_CHECK(whether the compiler recognizes typename, ac_cv_cxx_typename, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([templateclass X {public:X(){}};], [X z; return 0;], ac_cv_cxx_typename=yes, ac_cv_cxx_typename=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_typename" = yes; then AC_DEFINE(HAVE_TYPENAME,,[define if the compiler recognizes typename]) fi ]) dnl @synopsis AC_CXX_NEW_FOR_SCOPING dnl dnl If the compiler accepts the new for scoping rules (the scope of a dnl variable declared inside the parentheses is restricted to the dnl for-body), define HAVE_NEW_FOR_SCOPING. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_NEW_FOR_SCOPING, [AC_CACHE_CHECK(whether the compiler accepts the new for scoping rules, ac_cv_cxx_new_for_scoping, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,[ int z = 0; for (int i = 0; i < 10; ++i) z = z + i; for (int i = 0; i < 10; ++i) z = z - i; return z;], ac_cv_cxx_new_for_scoping=yes, ac_cv_cxx_new_for_scoping=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_new_for_scoping" = yes; then AC_DEFINE(HAVE_NEW_FOR_SCOPING,,[define if the compiler accepts the new for scoping rules]) fi ]) dnl @synopsis AC_CXX_EXPLICIT_INSTANTIATIONS dnl dnl If the C++ compiler supports explicit instanciations syntax, dnl define HAVE_INSTANTIATIONS. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_EXPLICIT_INSTANTIATIONS, [AC_CACHE_CHECK(whether the compiler supports explicit instantiations, ac_cv_cxx_explinst, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([template class A { T t; }; template class A;], [], ac_cv_cxx_explinst=yes, ac_cv_cxx_explinst=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_explinst" = yes; then AC_DEFINE(HAVE_INSTANTIATIONS,, [define if the compiler supports explicit instantiations]) fi ]) dnl @synopsis AC_CXX_DYNAMIC_CAST dnl dnl If the compiler supports dynamic_cast<>, define HAVE_DYNAMIC_CAST. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_DYNAMIC_CAST, [AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>, ac_cv_cxx_dynamic_cast, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include class Base { public : Base () {} virtual void f () = 0;}; class Derived : public Base { public : Derived () {} virtual void f () {} };],[ Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1;], ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_dynamic_cast" = yes; then AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>]) fi ]) dnl @synopsis AC_CXX_NAMESPACES dnl dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_NAMESPACES, [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) dnl @synopsis AC_CXX_BOOL dnl dnl If the compiler recognizes bool as a separate built-in type, dnl define HAVE_BOOL. Note that a typedef is not a separate dnl type since you cannot overload a function such that it accepts either dnl the basic type or the typedef. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_BOOL, [AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, ac_cv_cxx_bool, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ int f(int x){return 1;} int f(char x){return 1;} int f(bool x){return 1;} ],[bool b = true; return f(b);], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_bool" = yes; then AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type]) fi ]) AC_DEFUN(AC_DEFINE_DIR, [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse($3, , AC_DEFINE_UNQUOTED($1, "$ac_expanded"), AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3)) ]) dnl @synopsis AC_CXX_MUTABLE dnl dnl If the compiler allows modifying class data members flagged with dnl the mutable keyword even in const objects (for example in the dnl body of a const member function), define HAVE_MUTABLE. dnl dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl AC_DEFUN(AC_CXX_MUTABLE, [AC_CACHE_CHECK(whether the compiler supports the mutable keyword, ac_cv_cxx_mutable, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ class A { mutable int i; public: int f (int n) const { i = n; return i; } }; ],[A a; return a.f (1);], ac_cv_cxx_mutable=yes, ac_cv_cxx_mutable=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_mutable" = yes; then AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword]) fi ]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # serial 40 AC_PROG_LIBTOOL AC_DEFUN(AC_PROG_LIBTOOL, [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # Save cache, so that ltconfig can load it AC_CACHE_SAVE # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ || AC_MSG_ERROR([libtool configure failed]) # Reload cache, that may have been modified by ltconfig AC_CACHE_LOAD # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Redirect the config.log output again, so that the ltconfig log is not # clobbered by the next message. exec 5>>./config.log ]) AC_DEFUN(AC_LIBTOOL_SETUP, [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl case "$target" in NONE) lt_target="$host" ;; *) lt_target="$target" ;; esac # Check for any special flags to pass to ltconfig. # # the following will cause an existing older ltconfig to fail, so # we ignore this at the expense of the cache file... Checking this # will just take longer ... bummer! #libtool_flags="--cache-file=$cache_file" # test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], [libtool_flags="$libtool_flags --enable-dlopen"]) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [libtool_flags="$libtool_flags --enable-win32-dll"]) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac ]) # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AC_ENABLE_SHARED, [dnl define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AC_ENABLE_STATIC, [dnl define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN(AC_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. changequote(,)dnl [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' changequote([,])dnl # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) AC_DEFUN(AC_PROG_LD_GNU, [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi]) ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN(AC_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. ac_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" break else ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case "$lt_target" in *-*-beos* | *-*-cygwin*) # These system don't have libm ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, main, LIBM="-lm") ;; esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library, adds --enable-ltdl-convenience to # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed # to be `${top_builddir}/libltdl'. Make sure you start DIR with # '${top_builddir}/' (note the single quotes!) if your package is not # flat, and, if you're not using automake, define top_builddir as # appropriate in the Makefiles. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library, and adds --enable-ltdl-install to # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed # to be `${top_builddir}/libltdl'. Make sure you start DIR with # '${top_builddir}/' (note the single quotes!) if your package is not # flat, and, if you're not using automake, define top_builddir as # appropriate in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" INCLTDL= fi ]) dnl old names AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl dnl This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL])dnl # Macro to add for using GNU gettext. # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 5 AC_DEFUN(AM_WITH_NLS, [AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) USE_INCLUDED_LIBINTL=no dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then AC_DEFINE(ENABLE_NLS) AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If gettext or catgets are available (in this order) we dnl use this. Else we have to fall back to GNU NLS library. dnl catgets is only used if permitted by option --with-catgets. nls_cv_header_intl= nls_cv_header_libgt= CATOBJEXT=NONE AC_CHECK_HEADER(libintl.h, [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, [AC_TRY_LINK([#include ], [return (int) gettext ("")], gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) if test "$gt_cv_func_gettext_libc" != "yes"; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CACHE_CHECK([for gettext in libintl], gt_cv_func_gettext_libintl, [AC_CHECK_LIB(intl, gettext, gt_cv_func_gettext_libintl=yes, gt_cv_func_gettext_libintl=no)], gt_cv_func_gettext_libintl=no)]) fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then AC_DEFINE(HAVE_GETTEXT) AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then AC_CHECK_FUNCS(dcgettext) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) INSTOBJEXT=.mo fi fi ]) if test "$CATOBJEXT" = "NONE"; then AC_MSG_CHECKING([whether catgets can be used]) AC_ARG_WITH(catgets, [ --with-catgets use catgets functions if available], nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) AC_MSG_RESULT($nls_cv_use_catgets) if test "$nls_cv_use_catgets" = "yes"; then dnl No gettext in C library. Try catgets next. AC_CHECK_LIB(i, main) AC_CHECK_FUNC(catgets, [AC_DEFINE(HAVE_CATGETS) INTLOBJS="\$(CATOBJS)" AC_PATH_PROG(GENCAT, gencat, no)dnl if test "$GENCAT" != "no"; then AC_PATH_PROG(GMSGFMT, gmsgfmt, no) if test "$GMSGFMT" = "no"; then AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) fi AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) USE_INCLUDED_LIBINTL=yes CATOBJEXT=.cat INSTOBJEXT=.cat DATADIRNAME=lib INTLDEPS='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi]) fi fi if test "$CATOBJEXT" = "NONE"; then dnl Neither gettext nor catgets in included in the C library. dnl Fall back on GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_SUBST(MSGFMT) USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INSTOBJEXT=.mo DATADIRNAME=share INTLDEPS='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po else DATADIRNAME=share nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) # If this is used in GNU gettext we have to set USE_NLS to `yes' # because some of the sources are only built for this goal. if test "$PACKAGE" = gettext; then USE_NLS=yes USE_INCLUDED_LIBINTL=yes fi dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLDEPS) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) AC_DEFUN(AM_GNU_GETTEXT, [AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ unistd.h sys/param.h]) AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ strdup __argz_count __argz_stringify __argz_next]) if test "${ac_cv_func_stpcpy+set}" != "set"; then AC_CHECK_FUNCS(stpcpy) fi if test "${ac_cv_func_stpcpy}" = "yes"; then AC_DEFINE(HAVE_STPCPY) fi AM_LC_MESSAGES AM_WITH_NLS if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; esac done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl The reference to in the installed file dnl must be resolved because we cannot expect the users of this dnl to define HAVE_LOCALE_H. if test $ac_cv_header_locale_h = yes; then INCLUDE_LOCALE_H="#include " else INCLUDE_LOCALE_H="\ /* The system does not provide the header . Take care yourself. */" fi AC_SUBST(INCLUDE_LOCALE_H) dnl Determine which catalog format we have (if any is needed) dnl For now we know about two different formats: dnl Linux libc-5 and the normal X/Open format test -d intl || mkdir intl if test "$CATOBJEXT" = ".cat"; then AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) dnl Transform the SED scripts while copying because some dumb SEDs dnl cannot handle comments. sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed fi dnl po2tbl.sed is always needed. sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed dnl In the intl/Makefile.in we have a special dependency which makes dnl only sense for gettext. We comment this out for non-gettext dnl packages. if test "$PACKAGE" = "gettext"; then GT_NO="#NO#" GT_YES= else GT_NO= GT_YES="#YES#" fi AC_SUBST(GT_NO) AC_SUBST(GT_YES) dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl *** For now the libtool support in intl/Makefile is not for real. l= AC_SUBST(l) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # Search path for a program which passes the given test. # Ulrich Drepper , 1996. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 1 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN(AM_PATH_PROG_WITH_TEST, [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test -n "[$]$1"; then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # Check whether LC_MESSAGES is available in . # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 1 AC_DEFUN(AM_LC_MESSAGES, [if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES) fi fi]) OpenJade-1.4devel/config.guess0000755000000000000000000007477407030222743012054 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 # Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit system type (host/target name). # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then CC_FOR_BUILD="$HOST_CC" else if test x"$CC" != x; then CC_FOR_BUILD="$CC" else CC_FOR_BUILD=cc fi fi fi # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then ./$dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-cbm-sysv4 exit 0;; amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; arm32:NetBSD:*:*) echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; macppc:NetBSD:*:*) echo powerpc-apple-netbsd${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:4) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=4.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) sed 's/^ //' << EOF >$dummy.c #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` rm -f $dummy.c $dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i?86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*T3E:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; F301:UNIX_System_V:*:*) echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | i?86:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) if test -x /usr/bin/objformat; then if test "elf" = "`/usr/bin/objformat`"; then echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` exit 0 fi fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_help_string=`cd /; ld --help 2>&1` ld_supported_emulations=`echo $ld_help_string \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// s/ .*// p'` case "$ld_supported_emulations" in *ia64) echo "${UNAME_MACHINE}-unknown-linux" exit 0 ;; i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 ;; armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 ;; elf32arm*) echo "${UNAME_MACHINE}-unknown-linux-gnu" exit 0 ;; armelf_linux*) echo "${UNAME_MACHINE}-unknown-linux-gnu" exit 0 ;; m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 ;; elf32ppc) # Determine Lib Version cat >$dummy.c < #if defined(__GLIBC__) extern char __libc_version[]; extern char __libc_release[]; #endif main(argc, argv) int argc; char *argv[]; { #if defined(__GLIBC__) printf("%s %s\n", __libc_version, __libc_release); #else printf("unkown\n"); #endif return 0; } EOF LIBC="" $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null if test "$?" = 0 ; then ./$dummy | grep 1\.99 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then sed 's/^ //' <$dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF LIBC="" $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then ./$dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac objdump --private-headers $dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 elif test "${UNAME_MACHINE}" = "mips" ; then cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i?86) VENDOR=pc; ;; *) VENDOR=unknown; ;; esac # Determine whether the default compiler is a.out or elf cat >$dummy.c < #ifdef __cplusplus int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; i?86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i?86:*:5:7*) # Fixed at (any) Pentium or better UNAME_MACHINE=i586 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-qnx-qnx${UNAME_VERSION} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) printf ("vax-dec-bsd\n"); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi #echo '(Unable to guess system type)' 1>&2 exit 1 OpenJade-1.4devel/config.h.in0000644000021000000240000002047307037440752011564 /* config.h.in. Generated automatically from configure.in by autoheader. */ // Copyright (C) 1999 Matthias Clasen, Peter Nilsson // See the file COPYING for copying permissions. #include /* Define if using alloca.c. */ #undef C_ALLOCA /* Define to empty if the keyword does not work. */ #undef const /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define if your struct stat has st_blksize. */ #undef HAVE_ST_BLKSIZE /* Define as __inline if that's what the C compiler calls it. */ #undef inline /* Define to `long' if doesn't define. */ #undef off_t /* Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE /* Define to `unsigned' if doesn't define. */ #undef size_t /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* these are needed for GNU gettext */ #undef ENABLE_NLS #undef HAVE_CATGETS #undef HAVE_GETTEXT #undef HAVE_LC_MESSAGES #undef HAVE_STPCPY /* define this appropriately if the type sig_atomic_t is not available */ #undef sig_atomic_t /* define this if the new handler takes size_t and returns int. */ #undef SP_FANCY_NEW_HANDLER /* The number of bytes in a bool. */ #undef SIZEOF_BOOL /* The number of bytes in a size_t. */ #undef SIZEOF_SIZE_T /* The number of bytes in a unsigned int. */ #undef SIZEOF_UNSIGNED_INT /* The number of bytes in a unsigned short. */ #undef SIZEOF_UNSIGNED_SHORT /* Define if you have the __argz_count function. */ #undef HAVE___ARGZ_COUNT /* Define if you have the __argz_next function. */ #undef HAVE___ARGZ_NEXT /* Define if you have the __argz_stringify function. */ #undef HAVE___ARGZ_STRINGIFY /* Define if you have the dcgettext function. */ #undef HAVE_DCGETTEXT /* Define if you have the getcwd function. */ #undef HAVE_GETCWD /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE /* Define if you have the memcmp function. */ #undef HAVE_MEMCMP /* Define if you have the munmap function. */ #undef HAVE_MUNMAP /* Define if you have the putenv function. */ #undef HAVE_PUTENV /* Define if you have the setenv function. */ #undef HAVE_SETENV /* Define if you have the setlocale function. */ #undef HAVE_SETLOCALE /* Define if you have the stpcpy function. */ #undef HAVE_STPCPY /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP /* Define if you have the strchr function. */ #undef HAVE_STRCHR /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the header file. */ #undef HAVE_ARGZ_H /* Define if you have the header file. */ #undef HAVE_CASSERT /* Define if you have the header file. */ #undef HAVE_LIMITS_H /* Define if you have the header file. */ #undef HAVE_LOCALE_H /* Define if you have the header file. */ #undef HAVE_MALLOC_H /* Define if you have the header file. */ #undef HAVE_NEW /* Define if you have the header file. */ #undef HAVE_NL_TYPES_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the i library (-li). */ #undef HAVE_LIBI /* Define if you have the pthread library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Package name */ #undef OPENJADE_PACKAGE /* Package version */ #undef OPENJADE_VERSION /* location of message catalogs */ #undef OPENJADE_LOCALE_DIR /* message domain */ #undef OPENJADE_MESSAGE_DOMAIN /* define if bool is a built-in type */ #undef HAVE_BOOL /* define if the compiler supports the mutable keyword */ #undef HAVE_MUTABLE /* define if the compiler recognizes typename */ #undef HAVE_TYPENAME /* define if the compiler accepts the new for scoping rules */ #undef HAVE_NEW_FOR_SCOPING /* define if the compiler supports placement operator delete */ #undef HAVE_PLACEMENT_OPERATOR_DELETE /* define if the compiler supports dynamic_cast<> */ #undef HAVE_DYNAMIC_CAST /* define if the compiler implements namespaces */ #undef HAVE_NAMESPACES /* define if the compiler supports explicit instantiations */ #undef HAVE_INSTANTIATIONS /* define if placement operator new is declared */ #undef HAVE_PLACEMENT_OPERATOR_NEW /* define if the C++ compiler supports the std namespace */ #undef HAVE_NAMESPACE_STD /* define this to include template definitions in the headers */ #undef SP_DEFINE_TEMPLATES /* define this to compile explicit template instantiations */ #undef SP_MANUAL_INST /* define this if your system misses new.h */ #undef SP_NEW_H_MISSING /* define this if set_new_handler() has to be declared extern C */ #undef SP_SET_NEW_HANDLER_EXTERN_C /* define this if the new handler takes size_t and returns int */ #undef SP_FANCY_NEW_HANDLER /* set this to the location of builtins.dsl */ #undef DEFAULT_SCHEME_BUILTINS /* define this to build a multi-byte version */ #undef SP_MULTI_BYTE /* define this to build the grove in a separate thread, if possible */ #undef USE_THREADS /* define this to build the mif backend */ #undef JADE_MIF /* define this to build the mif backend */ #undef JADE_MIF /* define this to build the html backend */ #undef JADE_HTML /* define this to build the html backend */ #undef JADE_HTML #ifdef HAVE_BOOL #define SP_HAVE_BOOL #endif /* HAVE_BOOL */ #if (SIZEOF_BOOL == 1) #define SP_SIZEOF_BOOL_1 #endif #if (SIZEOF_WCHAR_T == SIZEOF_UNSIGNED_SHORT) #define SP_WCHAR_T_USHORT #endif #ifdef SP_HAVE_SETMODE #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\r' #define SP_LINE_TERM2 '\n' #endif #endif /* not SP_HAVE_SETMODE */ #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\n' #endif #ifndef HAVE_NEW_FOR_SCOPING // This simulates the new ANSI "for" scope rules #define for if (0); else for #endif /* HAVE_NEW_FOR_SCOPING */ #ifndef SP_HAVE_TYPENAME #define typename /* as nothing */ #endif #ifndef SP_DLLEXPORT #define SP_DLLEXPORT /* as nothing */ #endif #ifndef SP_DLLIMPORT #define SP_DLLIMPORT /* as nothing */ #endif #ifdef SP_USE_DLL #ifdef BUILD_LIBSP #define SP_API SP_DLLEXPORT #else #define SP_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define SP_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef SP_WIDE_SYSTEM #ifndef SP_MULTI_BYTE #define SP_MULTI_BYTE #endif #endif #ifdef HAVE_NAMESPACES #define SP_NAMESPACE OpenSP #define DSSSL_NAMESPACE OpenJade_DSSSL #define GROVE_NAMESPACE OpenJade_Grove #endif /* HAVE_NAMESPACES */ #ifdef SP_NAMESPACE #define SP_NAMESPACE_SCOPE SP_NAMESPACE:: #else #define SP_NAMESPACE_SCOPE #endif /* SP_NAMESPACE */ #ifdef HAVE_DYNAMIC_CAST #define SP_HAVE_RTTI #endif /* HAVE_DYNAMIC_CAST */ #ifdef HAVE_TYPENAME #define SP_HAVE_TYPENAME #endif /* HAVE_TYPENAME */ #ifdef HAVE_PATHNAME_STYLE_DOS #define SP_MSDOS_FILENAMES #else #define SP_POSIX_FILENAMES #endif /* HAVE_PATHNAME_STYLE_DOS */ #ifdef HAVE_INSTANTIATIONS #define SP_ANSI_CLASS_INST #endif /* HAVE_INSTANTIATIONS */ #ifdef HAVE_SETLOCALE #define SP_HAVE_LOCALE #endif /* HAVE_SETLOCALE */ #ifdef HAVE_GETTEXT #define SP_HAVE_GETTEXT #endif /* HAVE_GETTEXT */ #ifdef WORDS_BIGENDIAN #define SP_BIG_ENDIAN #endif /* WORDS_BIGENDIAN */ #ifdef HAVE_LIBTHREADS #define SP_MUTEX_MACH #endif /* HAVE_LIBTHREADS */ #ifdef HAVE_LIBPTHREAD #define SP_MUTEX_PTHREADS #endif /* HAVE_LIBPTHREAD */ #ifdef HAVE_PLACEMENT_OPERATOR_DELETE #define SP_HAVE_PLACEMENT_OPERATOR_DELETE #endif /* HAVE_PLACEMENT_OPERATOR_DELETE */ #ifndef HAVE_PLACEMENT_OPERATOR_NEW #define SP_DECLARE_PLACEMENT_OPERATOR_NEW #endif /* HAVE_PLACEMENT_OPERATOR_NEW */ #ifndef HAVE_NAMESPACE_STD #define SP_NO_STD_NAMESPACE #endif /* HAVE_NAMESPACE_STD */ OpenJade-1.4devel/config.sub0000755000000000000000000005772707030222743011516 #! /bin/sh # Configuration validation subroutine script, version 1.1. # Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] then echo Configuration name missing. 1>&2 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 echo "or $0 ALIAS" 1>&2 echo where ALIAS is a recognized configuration type. 1>&2 exit 1 fi # First pass through any local machine types. case $1 in *local*) echo $1 exit 0 ;; *) ;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ | thumb | d10v | fr30) basic_machine=$basic_machine-unknown ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ | f301-* | armv*-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-cbm ;; amigaos | amigados) basic_machine=m68k-cbm os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [ctj]90-cray) basic_machine=c90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; i386-go32 | go32) basic_machine=i386-unknown os=-go32 ;; i386-mingw32 | mingw32) basic_machine=i386-unknown os=-mingw32 ;; i386-qnx | qnx) basic_machine=i386-qnx ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-unknown os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; np1) basic_machine=np1-gould ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=rs6000-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sparc | sparcv9) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -qnx) os=-qnx4 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -*MiNT) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f301-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -*MiNT) vendor=atari ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os OpenJade-1.4devel/configure0000755000021000000240000052404407070155631011447 #! /bin/sh # From configure.in Id: configure.in,v 1.21 2000/03/28 16:10:47 clasen Exp # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 # # Check to make sure that the build environment is sane. # # Like AC_CONFIG_HEADER, but automatically create stamp file. # serial 40 AC_PROG_LIBTOOL # AC_LIBTOOL_DLOPEN - enable checks for dlopen support # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. # AC_DISABLE_STATIC - set the default static flag to --disable-static # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install # AC_PROG_LD - find the path to the GNU or non-GNU linker # AC_PROG_NM - find the path to a BSD-compatible name lister # AC_CHECK_LIBM - check for math library # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library, adds --enable-ltdl-convenience to # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed # to be `${top_builddir}/libltdl'. Make sure you start DIR with # '${top_builddir}/' (note the single quotes!) if your package is not # flat, and, if you're not using automake, define top_builddir as # appropriate in the Makefiles. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library, and adds --enable-ltdl-install to # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed # to be `${top_builddir}/libltdl'. Make sure you start DIR with # '${top_builddir}/' (note the single quotes!) if your package is not # flat, and, if you're not using automake, define top_builddir as # appropriate in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. # Macro to add for using GNU gettext. # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 5 # Search path for a program which passes the given test. # Ulrich Drepper , 1996. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 1 # Check whether LC_MESSAGES is available in . # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 1 # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-shared[=PKGS] build shared libraries [default=yes]" ac_help="$ac_help --enable-static[=PKGS] build static libraries [default=yes]" ac_help="$ac_help --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" ac_help="$ac_help --with-gnu-ld assume the C compiler uses GNU ld [default=no]" ac_help="$ac_help --disable-libtool-lock avoid locking (might break parallel builds)" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help --with-included-gettext use the GNU gettext library included here" ac_help="$ac_help --with-catgets use catgets functions if available" ac_help="$ac_help --enable-threads run grove builder in a separate thread [default=no]" ac_help="$ac_help --enable-mif build the FrameMaker MIF backend [default=yes]" ac_help="$ac_help --enable-html build the HTML+CSS backend [default=yes]" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=dsssl # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:736: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:789: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:846: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=OpenJade VERSION=1.4devel if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 echo "configure:885: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:898: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:911: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:924: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:937: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:954: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <> confdefs.h <&6 echo "configure:1004: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1034: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1117: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 1128 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1159: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:1164: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:1192: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1224: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1308: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CXX" && break done test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1340: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF #line 1351 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1382: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:1387: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi echo "$ac_t""$ac_cv_prog_gxx" 1>&6 if test $ac_cv_prog_gxx = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 echo "configure:1415: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 echo "configure:1447: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CXXCPP=/lib/cpp fi rm -f conftest* ac_cv_prog_CXXCPP="$CXXCPP" ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi fi CXXCPP="$ac_cv_prog_CXXCPP" echo "$ac_t""$CXXCPP" 1>&6 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:1501: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1554: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1577: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:1605: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi for ac_prog in perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1636: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PERL" in /*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PERL="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi PERL="$ac_cv_path_PERL" if test -n "$PERL"; then echo "$ac_t""$PERL" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$PERL" && break done test -n "$PERL" || PERL="perl" # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:1748: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 echo "configure:1769: checking build system type" >&5 build_alias=$build case "$build_alias" in NONE) case $nonopt in NONE) build_alias=$host_alias ;; *) build_alias=$nonopt ;; esac ;; esac build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 echo "configure:1798: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 echo "configure:1822: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "configure:1825: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$ac_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else echo "$ac_t""no" 1>&6 fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 echo "configure:1860: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi fi echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 echo "configure:1876: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. ac_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" break else ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi fi NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 case "$target" in NONE) lt_target="$host" ;; *) lt_target="$target" ;; esac # Check for any special flags to pass to ltconfig. # # the following will cause an existing older ltconfig to fail, so # we ignore this at the expense of the cache file... Checking this # will just take longer ... bummer! #libtool_flags="--cache-file=$cache_file" # test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" : fi test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. echo '#line 1945 "configure"' > conftest.$ac_ext if { (eval echo configure:1946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 echo "configure:1967: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* lt_cv_cc_needs_belf=no fi rm -f conftest* fi echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Save cache, so that ltconfig can load it cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Redirect the config.log output again, so that the ltconfig log is not # clobbered by the next message. exec 5>>./config.log echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 echo "configure:2082: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6 echo "configure:2127: checking for cthread_fork in -lthreads" >&5 ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo threads | sed -e 's/^a-zA-Z0-9_/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi fi ALL_LINGUAS="de sv" echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 echo "configure:2177: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then echo "$ac_t""yes" 1>&6 ISC=yes # If later tests want to check for ISC. cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF if test "$GCC" = yes; then CC="$CC -posix" else CC="$CC -Xp" fi else echo "$ac_t""no" 1>&6 ISC= fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:2198: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:2302: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:2356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 echo "configure:2377: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done fi echo "$ac_t""$ac_cv_c_inline" 1>&6 case "$ac_cv_c_inline" in inline | yes) ;; no) cat >> confdefs.h <<\EOF #define inline EOF ;; *) cat >> confdefs.h <&6 echo "configure:2417: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else rm -rf conftest* ac_cv_type_off_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_off_t" 1>&6 if test $ac_cv_type_off_t = no; then cat >> confdefs.h <<\EOF #define off_t long EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:2450: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 echo "configure:2485: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF if { (eval echo configure:2497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_alloca_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 if test $ac_cv_header_alloca_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA_H 1 EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 echo "configure:2518: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main() { char *p = (char *) alloca(1); ; return 0; } EOF if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_func_alloca_works=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA 1 EOF fi if test $ac_cv_func_alloca_works = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.${ac_objext} cat >> confdefs.h <<\EOF #define C_ALLOCA 1 EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 echo "configure:2583: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5 | egrep "webecray" >/dev/null 2>&1; then rm -rf conftest* ac_cv_os_cray=yes else rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2613: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <&6 fi done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 echo "configure:2668: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < addr) ? 1 : -1; } main () { exit (find_stack_direction() < 0); } EOF if { (eval echo configure:2695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_c_stack_direction=-1 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 cat >> confdefs.h <&6 echo "configure:2720: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2759: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 echo "configure:2812: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef HAVE_UNISTD_H # include # endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ #ifdef __cplusplus extern "C" { void *malloc(unsigned); } #else char *malloc(); #endif int main() { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize(); /* * First, make a file with some known garbage in it. */ data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) *(data + i) = rand(); umask(0); fd = creat("conftestmmap", 0600); if (fd < 0) exit(1); if (write(fd, data, pagesize) != pagesize) exit(1); close(fd); /* * Next, try to mmap the file at a fixed address which * already has something else allocated at it. If we can, * also make sure that we see the same garbage. */ fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit(1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit(1); /* * Finally, make sure that changes to the mapped area * do not percolate back to the file as seen by read(). * (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) exit(1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit(1); close(fd); unlink("conftestmmap"); exit(0); } EOF if { (eval echo configure:2960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_mmap_fixed_mapped=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >> confdefs.h <<\EOF #define HAVE_MMAP 1 EOF fi for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2988: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:3028: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:3056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done if test "${ac_cv_func_stpcpy+set}" != "set"; then for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:3085: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:3113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done fi if test "${ac_cv_func_stpcpy}" = "yes"; then cat >> confdefs.h <<\EOF #define HAVE_STPCPY 1 EOF fi if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 echo "configure:3147: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF if { (eval echo configure:3159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* am_cv_val_LC_MESSAGES=no fi rm -f conftest* fi echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 if test $am_cv_val_LC_MESSAGES = yes; then cat >> confdefs.h <<\EOF #define HAVE_LC_MESSAGES 1 EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 echo "configure:3180: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi echo "$ac_t""$USE_NLS" 1>&6 USE_INCLUDED_LIBINTL=no if test "$USE_NLS" = "yes"; then cat >> confdefs.h <<\EOF #define ENABLE_NLS 1 EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 echo "configure:3200: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then nls_cv_header_intl= nls_cv_header_libgt= CATOBJEXT=NONE ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 echo "configure:3219: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:3229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 echo "configure:3246: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* gt_cv_func_gettext_libc=no fi rm -f conftest* fi echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 echo "configure:3274: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 echo "configure:3309: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 echo "configure:3314: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 gt_cv_func_gettext_libintl=yes else echo "$ac_t""no" 1>&6 gt_cv_func_gettext_libintl=no fi fi echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then cat >> confdefs.h <<\EOF #define HAVE_GETTEXT 1 EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3372: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then echo "$ac_t""$MSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$MSGFMT" != "no"; then for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:3406: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3461: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT="$ac_cv_path_GMSGFMT" if test -n "$GMSGFMT"; then echo "$ac_t""$GMSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3497: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then echo "$ac_t""$XGETTEXT" 1>&6 else echo "$ac_t""no" 1>&6 fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CATOBJEXT=.mo DATADIRNAME=lib fi rm -f conftest* INSTOBJEXT=.mo fi fi else echo "$ac_t""no" 1>&6 fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 echo "configure:3560: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" nls_cv_use_catgets=$withval else nls_cv_use_catgets=no fi echo "$ac_t""$nls_cv_use_catgets" 1>&6 if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 echo "configure:3573: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 echo "configure:3616: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char catgets(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_catgets) || defined (__stub___catgets) choke me #else catgets(); #endif ; return 0; } EOF if { (eval echo configure:3644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_catgets=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_CATGETS 1 EOF INTLOBJS="\$(CATOBJS)" # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3666: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GENCAT" in /*) ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GENCAT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" ;; esac fi GENCAT="$ac_cv_path_GENCAT" if test -n "$GENCAT"; then echo "$ac_t""$GENCAT" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$GENCAT" != "no"; then # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3702: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" ;; esac fi GMSGFMT="$ac_cv_path_GMSGFMT" if test -n "$GMSGFMT"; then echo "$ac_t""$GMSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$GMSGFMT" = "no"; then # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3739: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" ;; esac fi GMSGFMT="$ac_cv_path_GMSGFMT" if test -n "$GMSGFMT"; then echo "$ac_t""$GMSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3774: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then echo "$ac_t""$XGETTEXT" 1>&6 else echo "$ac_t""no" 1>&6 fi USE_INCLUDED_LIBINTL=yes CATOBJEXT=.cat INSTOBJEXT=.cat DATADIRNAME=lib INTLDEPS='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi else echo "$ac_t""no" 1>&6 fi fi fi if test "$CATOBJEXT" = "NONE"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then INTLOBJS="\$(GETTOBJS)" # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3832: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then echo "$ac_t""$MSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT="$ac_cv_path_GMSGFMT" if test -n "$GMSGFMT"; then echo "$ac_t""$GMSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:3902: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then echo "$ac_t""$XGETTEXT" 1>&6 else echo "$ac_t""no" 1>&6 fi USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INSTOBJEXT=.mo DATADIRNAME=share INTLDEPS='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po else DATADIRNAME=share nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi # If this is used in GNU gettext we have to set USE_NLS to `yes' # because some of the sources are only built for this goal. if test "$PACKAGE" = gettext; then USE_NLS=yes USE_INCLUDED_LIBINTL=yes fi for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 echo "configure:3995: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; esac done LINGUAS=$NEW_LINGUAS echo "$ac_t""$LINGUAS" 1>&6 fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi if test $ac_cv_header_locale_h = yes; then INCLUDE_LOCALE_H="#include " else INCLUDE_LOCALE_H="\ /* The system does not provide the header . Take care yourself. */" fi test -d intl || mkdir intl if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 echo "configure:4023: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 msgformat=linux else echo "$ac_t""no" 1>&6 msgformat=xopen fi sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed fi sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed if test "$PACKAGE" = "gettext"; then GT_NO="#NO#" GT_YES= else GT_NO= GT_YES="#YES#" fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi l= test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES for ac_hdr in locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:4101: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$datadir/locale"\" )` cat >> confdefs.h <> confdefs.h <&6 echo "configure:4156: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:4236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi for ac_hdr in limits.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:4263: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross for ac_hdr in new cassert do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:4310: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:4348: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 echo "configure:4381: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { struct stat s; s.st_blksize; ; return 0; } EOF if { (eval echo configure:4394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_st_blksize=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 if test $ac_cv_struct_st_blksize = yes; then cat >> confdefs.h <<\EOF #define HAVE_ST_BLKSIZE 1 EOF fi echo $ac_n "checking for sig_atomic_t in signal.h""... $ac_c" 1>&6 echo "configure:4415: checking for sig_atomic_t in signal.h" >&5 if eval "test \"`echo '$''{'ac_cv_have_sig_atomic_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { sig_atomic_t x; ; return 0; } EOF if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_have_sig_atomic_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_have_sig_atomic_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_have_sig_atomic_t" 1>&6 if test "$ac_cv_have_sig_atomic_t" = "no" then echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6 echo "configure:4443: checking for sig_atomic_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_sig_atomic_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])sig_atomic_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_sig_atomic_t=yes else rm -rf conftest* ac_cv_type_sig_atomic_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6 if test $ac_cv_type_sig_atomic_t = no; then cat >> confdefs.h <<\EOF #define sig_atomic_t int EOF fi fi echo $ac_n "checking size of size_t""... $ac_c" 1>&6 echo "configure:4477: checking size of size_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(size_t)); exit(0); } EOF if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_size_t=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_sizeof_size_t=0 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_size_t" 1>&6 cat >> confdefs.h <&6 echo "configure:4519: checking size of unsigned int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(unsigned int)); exit(0); } EOF if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_int=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_sizeof_unsigned_int=0 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_unsigned_int" 1>&6 cat >> confdefs.h <&6 echo "configure:4561: checking size of unsigned short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(unsigned short)); exit(0); } EOF if { (eval echo configure:4583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_short=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_sizeof_unsigned_short=0 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_unsigned_short" 1>&6 cat >> confdefs.h <&6 echo "configure:4603: checking size of wchar_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_wchar_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #include main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(wchar_t)); exit(0); } EOF if { (eval echo configure:4626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_wchar_t=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_sizeof_wchar_t=0 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 cat >> confdefs.h <&6 echo "configure:4646: checking whether the compiler recognizes bool as a built-in type" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_bool=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_bool=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_bool" 1>&6 if test "$ac_cv_cxx_bool" = yes; then cat >> confdefs.h <<\EOF #define HAVE_BOOL EOF fi if test "$ac_cv_cxx_bool" = yes; then echo $ac_n "checking size of bool""... $ac_c" 1>&6 echo "configure:4700: checking size of bool" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(bool)); exit(0); } EOF if { (eval echo configure:4722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_bool=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_sizeof_bool=0 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_bool" 1>&6 cat >> confdefs.h <&6 echo "configure:4743: checking whether the compiler supports the mutable keyword" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_mutable'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_mutable=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_mutable=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_mutable" 1>&6 if test "$ac_cv_cxx_mutable" = yes; then cat >> confdefs.h <<\EOF #define HAVE_MUTABLE EOF fi echo $ac_n "checking whether the compiler recognizes typename""... $ac_c" 1>&6 echo "configure:4797: checking whether the compiler recognizes typename" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_typename'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <class X {public:X(){}}; int main() { X z; return 0; ; return 0; } EOF if { (eval echo configure:4817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_typename=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_typename=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_typename" 1>&6 if test "$ac_cv_cxx_typename" = yes; then cat >> confdefs.h <<\EOF #define HAVE_TYPENAME EOF fi echo $ac_n "checking whether the compiler accepts the new for scoping rules""... $ac_c" 1>&6 echo "configure:4846: checking whether the compiler accepts the new for scoping rules" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_new_for_scoping'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_new_for_scoping=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_new_for_scoping=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_new_for_scoping" 1>&6 if test "$ac_cv_cxx_new_for_scoping" = yes; then cat >> confdefs.h <<\EOF #define HAVE_NEW_FOR_SCOPING EOF fi echo $ac_n "checking whether the compiler supports placement operator delete""... $ac_c" 1>&6 echo "configure:4901: checking whether the compiler supports placement operator delete" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_placement_operator_delete'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { class Thing { public: Thing() { }; void *operator new(size_t,bool) { }; void operator delete(size_t,void*) { }; }; ; return 0; } EOF if { (eval echo configure:4926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_placement_operator_delete=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_placement_operator_delete=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_placement_operator_delete" 1>&6 if test "$ac_cv_cxx_placement_operator_delete" = yes; then cat >> confdefs.h <<\EOF #define HAVE_PLACEMENT_OPERATOR_DELETE EOF fi echo $ac_n "checking whether the compiler supports dynamic_cast<>""... $ac_c" 1>&6 echo "configure:4955: checking whether the compiler supports dynamic_cast<>" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_dynamic_cast'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < class Base { public : Base () {} virtual void f () = 0;}; class Derived : public Base { public : Derived () {} virtual void f () {} }; int main() { Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1; ; return 0; } EOF if { (eval echo configure:4978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_dynamic_cast=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_dynamic_cast=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_dynamic_cast" 1>&6 if test "$ac_cv_cxx_dynamic_cast" = yes; then cat >> confdefs.h <<\EOF #define HAVE_DYNAMIC_CAST EOF fi echo $ac_n "checking whether the compiler implements namespaces""... $ac_c" 1>&6 echo "configure:5007: checking whether the compiler implements namespaces" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_namespaces'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_namespaces=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_namespaces=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_namespaces" 1>&6 if test "$ac_cv_cxx_namespaces" = yes; then cat >> confdefs.h <<\EOF #define HAVE_NAMESPACES EOF fi echo $ac_n "checking whether the compiler supports explicit instantiations""... $ac_c" 1>&6 echo "configure:5056: checking whether the compiler supports explicit instantiations" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_explinst'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < class A { T t; }; template class A; int main() { ; return 0; } EOF if { (eval echo configure:5076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_explinst=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_explinst=no fi rm -f conftest* ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross fi echo "$ac_t""$ac_cv_cxx_explinst" 1>&6 if test "$ac_cv_cxx_explinst" = yes; then cat >> confdefs.h <<\EOF #define HAVE_INSTANTIATIONS EOF fi echo $ac_n "checking for placement operator new""... $ac_c" 1>&6 echo "configure:5105: checking for placement operator new" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_placement_operator_new'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_NEW #include #else #include #endif class A { public: A() {}; }; A* foo() { void *x; A *bar = new (x) A; return bar; }; int main() { ; return 0; } EOF if { (eval echo configure:5132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_placement_operator_new=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_placement_operator_new=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_cxx_placement_operator_new" 1>&6 if test "$ac_cv_cxx_placement_operator_new" = yes; then cat >> confdefs.h <<\EOF #define HAVE_PLACEMENT_OPERATOR_NEW 1 EOF fi echo $ac_n "checking whether the C++ compiler supports the std namespace""... $ac_c" 1>&6 echo "configure:5153: checking whether the C++ compiler supports the std namespace" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_namespace_std'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #else #include #endif int main() { std::set_new_handler(0); ; return 0; } EOF if { (eval echo configure:5171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_namespace_std=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_namespace_std=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_cxx_namespace_std" 1>&6 if test "$ac_cv_cxx_namespace_std" = yes; then cat >> confdefs.h <<\EOF #define HAVE_NAMESPACE_STD 1 EOF fi if test "$GXX"; then echo $ac_n "checking whether GNU C++ supports automatic template instantiation""... $ac_c" 1>&6 echo "configure:5193: checking whether GNU C++ supports automatic template instantiation" >&5 if eval "test \"`echo '$''{'ac_cv_c_gnu_automatic_templates'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 8) yes #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ac_cv_c_gnu_automatic_templates=yes else rm -rf conftest* ac_cv_c_gnu_automatic_templates=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_gnu_automatic_templates" 1>&6 if test "$ac_cv_c_gnu_automatic_templates" = yes; then cat >> confdefs.h <<\EOF #define SP_DEFINE_TEMPLATES 1 EOF else cat >> confdefs.h <<\EOF #define SP_MANUAL_INST 1 EOF CXXFLAGS="$CXXFLAGS -fno-implicit-templates" fi echo $ac_n "checking whether GNU C++ links with libg++ if we include new.h""... $ac_c" 1>&6 echo "configure:5232: checking whether GNU C++ links with libg++ if we include new.h" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_gnu_avoid_new_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ac_cv_cxx_gnu_avoid_new_h=yes else rm -rf conftest* ac_cv_cxx_gnu_avoid_new_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_cxx_gnu_avoid_new_h" 1>&6 if test "$ac_cv_cxx_gnu_avoid_new_h" = yes; then cat >> confdefs.h <<\EOF #define SP_NEW_H_MISSING 1 EOF echo $ac_n "checking whether to declare set_new_handler extern "C"""... $ac_c" 1>&6 echo "configure:5264: checking whether to declare set_new_handler extern "C"" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_new_handler_extern_c'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_new_handler_extern_c=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_new_handler_extern_c=yes fi rm -f conftest* fi echo "$ac_t""$ac_cv_cxx_new_handler_extern_c" 1>&6 if test "$ac_cv_cxx_new_handler_extern_c" = yes; then cat >> confdefs.h <<\EOF #define SP_SET_NEW_HANDLER_EXTERN_C 1 EOF fi fi fi echo $ac_n "checking whether new_handler accepts size_t and returns int""... $ac_c" 1>&6 echo "configure:5302: checking whether new_handler accepts size_t and returns int" >&5 if eval "test \"`echo '$''{'ac_cv_cxx_fancy_new_handler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int oom(size_t) { } int main() { set_new_handler(oom); ; return 0; } EOF if { (eval echo configure:5317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cxx_fancy_new_handler=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cxx_fancy_new_handler=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_cxx_fancy_new_handler" 1>&6 if test "$ac_cv_cxx_fancy_new_handler" = yes; then cat >> confdefs.h <<\EOF #define SP_FANCY_NEW_HANDLER 1 EOF fi for ac_func in memcmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:5341: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" fi done for ac_func in setlocale do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:5401: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," cat >> confdefs.h <> confdefs.h <<\EOF #define SP_MULTI_BYTE 1 EOF echo $ac_n "checking whether to run the grove builder in a separate thread""... $ac_c" 1>&6 echo "configure:5486: checking whether to run the grove builder in a separate thread" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" if test "$enableval" != "no"; then cat >> confdefs.h <<\EOF #define USE_THREADS 1 EOF echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether to build the Framemaker MIF backend""... $ac_c" 1>&6 echo "configure:5504: checking whether to build the Framemaker MIF backend" >&5 # Check whether --enable-mif or --disable-mif was given. if test "${enable_mif+set}" = set; then enableval="$enable_mif" if test "$enableval" = "yes"; then cat >> confdefs.h <<\EOF #define JADE_MIF 1 EOF echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi else cat >> confdefs.h <<\EOF #define JADE_MIF 1 EOF echo "$ac_t""yes" 1>&6 fi echo $ac_n "checking whether to build the HTML+CSS backend""... $ac_c" 1>&6 echo "configure:5526: checking whether to build the HTML+CSS backend" >&5 # Check whether --enable-html or --disable-html was given. if test "${enable_html+set}" = set; then enableval="$enable_html" if test "$enableval" = "yes"; then cat >> confdefs.h <<\EOF #define JADE_HTML 1 EOF echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi else cat >> confdefs.h <<\EOF #define JADE_HTML 1 EOF echo "$ac_t""yes" 1>&6 fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "${PACKAGE}-${VERSION}.spec:spec.in Makefile msggen.pl style/Makefile grove/Makefile spgrove/Makefile jade/Makefile dsssl/Makefile jadedoc/Makefile jadedoc/images/Makefile intl/Makefile po/Makefile.in config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@CXX@%$CXX%g s%@CXXCPP@%$CXXCPP%g s%@LN_S@%$LN_S%g s%@RANLIB@%$RANLIB%g s%@PERL@%$PERL%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@LIBTOOL@%$LIBTOOL%g s%@ALLOCA@%$ALLOCA%g s%@USE_NLS@%$USE_NLS%g s%@MSGFMT@%$MSGFMT%g s%@GMSGFMT@%$GMSGFMT%g s%@XGETTEXT@%$XGETTEXT%g s%@GENCAT@%$GENCAT%g s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g s%@CATALOGS@%$CATALOGS%g s%@CATOBJEXT@%$CATOBJEXT%g s%@DATADIRNAME@%$DATADIRNAME%g s%@GMOFILES@%$GMOFILES%g s%@INSTOBJEXT@%$INSTOBJEXT%g s%@INTLDEPS@%$INTLDEPS%g s%@INTLLIBS@%$INTLLIBS%g s%@INTLOBJS@%$INTLOBJS%g s%@POFILES@%$POFILES%g s%@POSUB@%$POSUB%g s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g s%@GT_NO@%$GT_NO%g s%@GT_YES@%$GT_YES%g s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g s%@l@%$l%g s%@OPENJADE_MESSAGE_DOMAIN@%$OPENJADE_MESSAGE_DOMAIN%g s%@LIBOBJS@%$LIBOBJS%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF srcdir=$ac_given_srcdir while test -n "$ac_sources"; do set $ac_dests; ac_dest=$1; shift; ac_dests=$* set $ac_sources; ac_source=$1; shift; ac_sources=$* echo "linking $srcdir/$ac_source to $ac_dest" if test ! -r $srcdir/$ac_source; then { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } fi rm -f $ac_dest # Make relative symlinks. # Remove last slash and all that follows it. Not all systems have dirname. ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then # The dest file is in a subdirectory. test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dest_dir_suffix. ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dest_dir_suffix= ac_dots= fi case "$srcdir" in [/$]*) ac_rel_source="$srcdir/$ac_source" ;; *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; esac # Make a symlink if possible; otherwise try a hard link. if ln -s $ac_rel_source $ac_dest 2>/dev/null || ln $srcdir/$ac_source $ac_dest; then : else { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } fi done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac echo creating po/Makefile sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 OpenJade-1.4devel/configure.in0000644000021000000240000001635307070154607012052 AC_REVISION([$Id: configure.in,v 1.21 2000/03/28 16:10:47 clasen Exp $]) dnl dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 1998 Cees A. de Groot, 1999 Matthias Clasen dnl dnl dnl Credits: this autoconf script was largely "inspired" by the dnl autoconf script around SP made by Henry Thompson. dnl dnl Initialization AC_INIT(dsssl) AM_INIT_AUTOMAKE(OpenJade, 1.4devel, no-define) AM_CONFIG_HEADER(config.h) AM_SANITY_CHECK dnl Use different names than usually to avoid conflicts. AC_DEFINE_UNQUOTED(OPENJADE_PACKAGE, "$PACKAGE", [Package name]) AC_DEFINE_UNQUOTED(OPENJADE_VERSION, "$VERSION", [Package version]) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_MAKE_SET AC_PATH_PROGS(PERL, perl, perl) AM_PROG_LIBTOOL dnl Checks for libraries. AC_CHECK_LIB(pthread,pthread_create,,AC_CHECK_LIB(threads,cthread_fork)) ALL_LINGUAS="de sv" AM_GNU_GETTEXT AC_CHECK_HEADERS(locale.h) AC_DEFINE_DIR(OPENJADE_LOCALE_DIR, datadir/locale, [location of message catalogs]) OPENJADE_MESSAGE_DOMAIN=jade AC_DEFINE_UNQUOTED(OPENJADE_MESSAGE_DOMAIN, "$OPENJADE_MESSAGE_DOMAIN", [message domain]) AC_SUBST(OPENJADE_MESSAGE_DOMAIN) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(limits.h) AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(new cassert) dnl Checks for typedefs, structures and compiler characteristics. AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE AC_CACHE_CHECK(for sig_atomic_t in signal.h, ac_cv_have_sig_atomic_t, AC_TRY_LINK([#include ],sig_atomic_t x;, ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)) if test "$ac_cv_have_sig_atomic_t" = "no" then AC_CHECK_TYPE(sig_atomic_t,int) fi AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(unsigned int) AC_CHECK_SIZEOF(unsigned short) OJ_CHECK_SIZEOF(wchar_t, wchar.h) AC_CXX_BOOL if test "$ac_cv_cxx_bool" = yes; then AC_CHECK_SIZEOF(bool) fi AC_CXX_MUTABLE AC_CXX_TYPENAME AC_CXX_NEW_FOR_SCOPING AC_CXX_PLACEMENT_OPERATOR_DELETE AC_CXX_DYNAMIC_CAST AC_CXX_NAMESPACES AC_CXX_EXPLICIT_INSTANTIATIONS AC_CACHE_CHECK(for placement operator new, ac_cv_cxx_placement_operator_new, [AC_TRY_COMPILE([#include #ifdef HAVE_NEW #include #else #include #endif class A { public: A() {}; }; A* foo() { void *x; A *bar = new (x) A; return bar; };],, ac_cv_cxx_placement_operator_new=yes, ac_cv_cxx_placement_operator_new=no) ]) if test "$ac_cv_cxx_placement_operator_new" = yes; then AC_DEFINE(HAVE_PLACEMENT_OPERATOR_NEW,1, [define if placement operator new is declared]) fi AC_CACHE_CHECK(whether the C++ compiler supports the std namespace, ac_cv_cxx_namespace_std, [AC_TRY_COMPILE([ #ifdef HAVE_NEW #include #else #include #endif],[ std::set_new_handler(0);], ac_cv_cxx_namespace_std=yes, ac_cv_cxx_namespace_std=no) ]) if test "$ac_cv_cxx_namespace_std" = yes; then AC_DEFINE(HAVE_NAMESPACE_STD,1, [define if the C++ compiler supports the std namespace]) fi if test "$GXX"; then dnl These need tests for non-GNU compilers AC_CACHE_CHECK(whether GNU C++ supports automatic template instantiation, ac_cv_c_gnu_automatic_templates, AC_EGREP_CPP(yes,[ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 8) yes #endif ], ac_cv_c_gnu_automatic_templates=yes, ac_cv_c_gnu_automatic_templates=no)) if test "$ac_cv_c_gnu_automatic_templates" = yes; then AC_DEFINE(SP_DEFINE_TEMPLATES,1, [define this to include template definitions in the headers]) else AC_DEFINE(SP_MANUAL_INST,1, [define this to compile explicit template instantiations]) CXXFLAGS="$CXXFLAGS -fno-implicit-templates" fi AC_CACHE_CHECK(whether GNU C++ links with libg++ if we include new.h, ac_cv_cxx_gnu_avoid_new_h, AC_EGREP_CPP(yes,[ #if (__GNUC__ == 2 && __GNUC_MINOR__ < 8) yes #endif ], ac_cv_cxx_gnu_avoid_new_h=yes, ac_cv_cxx_gnu_avoid_new_h=no)) if test "$ac_cv_cxx_gnu_avoid_new_h" = yes; then AC_DEFINE(SP_NEW_H_MISSING,1, [define this if your system misses new.h]) AC_CACHE_CHECK(whether to declare set_new_handler extern "C", ac_cv_cxx_new_handler_extern_c, [AC_TRY_COMPILE([ typedef void (*new_handler)(); new_handler set_new_handler(new_handler);],[ set_new_handler(0);], ac_cv_cxx_new_handler_extern_c=no, ac_cv_cxx_new_handler_extern_c=yes) ]) if test "$ac_cv_cxx_new_handler_extern_c" = yes; then AC_DEFINE(SP_SET_NEW_HANDLER_EXTERN_C,1, [define this if set_new_handler() has to be declared extern "C"]) fi fi fi AC_CACHE_CHECK(whether new_handler accepts size_t and returns int, ac_cv_cxx_fancy_new_handler, [AC_TRY_COMPILE([ #include #include int oom(size_t) { }],[set_new_handler(oom);], ac_cv_cxx_fancy_new_handler=yes, ac_cv_cxx_fancy_new_handler=no) ]) if test "$ac_cv_cxx_fancy_new_handler" = yes; then AC_DEFINE(SP_FANCY_NEW_HANDLER,1, [define this if the new handler takes size_t and returns int]) fi dnl Checks for library functions. AC_REPLACE_FUNCS(memcmp) AC_CHECK_FUNCS(setlocale) dnl Checks for system services. dnl Package options. AC_ARG_PROGRAM AC_DEFINE_UNQUOTED(DEFAULT_SCHEME_BUILTINS,"$prefix/share/$PACKAGE/builtins.dsl", [set this to the location of builtins.dsl]) AC_DEFINE(SP_MULTI_BYTE,1, [define this to build a multi-byte version]) AC_MSG_CHECKING(whether to run the grove builder in a separate thread) AC_ARG_ENABLE(threads, changequote(<,>)dnl < --enable-threads run grove builder in a separate thread [default=no]>, changequote([,])dnl [if test "$enableval" != "no"; then AC_DEFINE(USE_THREADS,1, [define this to build the grove in a separate thread, if possible]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi], AC_MSG_RESULT(no)) AC_MSG_CHECKING(whether to build the Framemaker MIF backend) AC_ARG_ENABLE(mif, changequote(<,>)dnl < --enable-mif build the FrameMaker MIF backend [default=yes]>, changequote([,])dnl [if test "$enableval" = "yes"; then AC_DEFINE(JADE_MIF,1, [define this to build the mif backend]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi], AC_DEFINE(JADE_MIF,1, [define this to build the mif backend]) AC_MSG_RESULT(yes)) AC_MSG_CHECKING(whether to build the HTML+CSS backend) AC_ARG_ENABLE(html, changequote(<,>)dnl < --enable-html build the HTML+CSS backend [default=yes]>, changequote([,])dnl [if test "$enableval" = "yes"; then AC_DEFINE(JADE_HTML,1, [define this to build the html backend]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi], AC_DEFINE(JADE_HTML,1, [define this to build the html backend]) AC_MSG_RESULT(yes)) AC_SUBST(LIBOBJS) AC_OUTPUT([${PACKAGE}-${VERSION}.spec:spec.in Makefile msggen.pl style/Makefile grove/Makefile spgrove/Makefile jade/Makefile dsssl/Makefile jadedoc/Makefile jadedoc/images/Makefile intl/Makefile po/Makefile.in], [echo creating po/Makefile sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) OpenJade-1.4devel/install-sh0000755000000000000000000001273607046720574011542 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 OpenJade-1.4devel/ltconfig0000755000000000000000000027432607030222743011262 #! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.4 TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # As osf3* with the addition of the -msym flag if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2212: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2252: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2299: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2339: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2387: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2452: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2490: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: OpenJade-1.4devel/ltmain.sh0000644000000000000000000032770607030222743011350 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then echo "$modename: not configured to build any kind of library" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case "$arg" in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in execute_dlfiles) eval "$prev=\"\$$prev \$arg\"" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case "$arg" in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case "$nonopt" in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case "$arg" in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case "$mode" in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do # Accept any command-line options. case "$arg" in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; esac case "$user_target" in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly in scan # sets, so we specify it separately. case "$lastarg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case "$user_target" in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case "$libobj" in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case "$libobj" in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if test -z "$pic_flag" && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then command="$base_compile $srcfile" if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $rm "$lockfile" fi exit 0 ;; # libtool link mode link) modename="$modename: link" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (!dll) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case "$prev" in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case "$arg" in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case "$arg" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi prevarg="$arg" case "$arg" in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: not more than one -exported-symbols argument allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 absdir="$dir" fi dir="$absdir" ;; esac case " $deplibs " in *" $arg "*) ;; *) deplibs="$deplibs $arg";; esac case " $lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir";; esac case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) dllsearchdir=`cd "$dir" && pwd || echo "$dir"` case ":$dllsearchpath:" in ::) dllsearchpath="$dllsearchdir";; *":$dllsearchdir:"*) ;; *) dllsearchpath="$dllsearchpath:$dllsearchdir";; esac ;; esac ;; -l*) if test "$arg" = "-lc"; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # These systems don't actually have c library (as such) continue ;; esac elif test "$arg" = "-lm"; then case "$host" in *-*-cygwin* | *-*-beos*) # These systems don't actually have math library (as such) continue ;; esac fi deplibs="$deplibs $arg" ;; -module) module=yes continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # If we have no pic_flag, then this is the same as -all-static. if test -z "$pic_flag" && test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; *.o | *.obj | *.a | *.lib) # A standard object. objs="$objs $arg" ;; *.lo) # A library object. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= fi libobjs="$libobjs $arg" ;; *.la) # A libtool-controlled library. dlname= libdir= library_names= old_library= # Check to see that this really is a libtool archive. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 exit 1 fi # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file # If there is no directory component, then add one. case "$arg" in */* | *\\*) . $arg ;; *) . ./$arg ;; esac # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 exit 1 fi # Find the relevant object directory and library name. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` if test "X$installed" = Xyes; then dir="$libdir" else dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$arg"; then dir="$objdir" else dir="$dir/$objdir" fi fi if test -n "$dependency_libs"; then # Extract -R and -L from dependency_libs temp_deplibs= for deplib in $dependency_libs; do case "$deplib" in -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` case " $rpath $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; -L*) case "$compile_command $temp_deplibs " in *" $deplib "*) ;; *) temp_deplibs="$temp_deplibs $deplib";; esac temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` case " $lib_search_path " in *" $temp_dir "*) ;; *) lib_search_path="$lib_search_path $temp_dir";; esac ;; *) temp_deplibs="$temp_deplibs $deplib";; esac done dependency_libs="$temp_deplibs" fi if test -z "$libdir"; then # It is a libtool convenience library, so add in its objects. convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$deplibs$dependency_libs" compile_command="$compile_command $dir/$old_library$dependency_libs" finalize_command="$finalize_command $dir/$old_library$dependency_libs" continue fi # This library was specified with -dlopen. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking statically, # we need to preload. prev=dlprefiles else # We should not create a dependency on this library, but we # may need any libraries it requires. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" prev= continue fi fi # The library was specified with -dlpreopen. if test "$prev" = dlprefiles; then # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then dlprefiles="$dlprefiles $dir/$old_library" else dlprefiles="$dlprefiles $dir/$linklib" fi prev= fi if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then link_against_libtool_libs="$link_against_libtool_libs $arg" if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # We need an absolute path. case "$dir" in [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 absdir="$dir" fi ;; esac # This is the magic to use -rpath. # Skip directories that are in the system default run-time # search path, unless they have been requested with -R. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac lib_linked=yes case "$hardcode_action" in immediate | unsupported) if test "$hardcode_direct" = no; then compile_command="$compile_command $dir/$linklib" deplibs="$deplibs $dir/$linklib" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) dllsearchdir=`cd "$dir" && pwd || echo "$dir"` if test -n "$dllsearchpath"; then dllsearchpath="$dllsearchpath:$dllsearchdir" else dllsearchpath="$dllsearchdir" fi ;; esac elif test "$hardcode_minus_L" = no; then case "$host" in *-*-sunos*) compile_shlibpath="$compile_shlibpath$dir:" ;; esac case "$compile_command " in *" -L$dir "*) ;; *) compile_command="$compile_command -L$dir";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -L$dir -l$name" elif test "$hardcode_shlibpath_var" = no; then case ":$compile_shlibpath:" in *":$dir:"*) ;; *) compile_shlibpath="$compile_shlibpath$dir:";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then compile_command="$compile_command $absdir/$linklib" deplibs="$deplibs $absdir/$linklib" elif test "$hardcode_minus_L" = yes; then case "$compile_command " in *" -L$absdir "*) ;; *) compile_command="$compile_command -L$absdir";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -L$absdir -l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$compile_shlibpath:" in *":$absdir:"*) ;; *) compile_shlibpath="$compile_shlibpath$absdir:";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then finalize_command="$finalize_command $libdir/$linklib" elif test "$hardcode_minus_L" = yes; then case "$finalize_command " in *" -L$libdir "*) ;; *) finalize_command="$finalize_command -L$libdir";; esac finalize_command="$finalize_command -l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$finalize_shlibpath:" in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:";; esac finalize_command="$finalize_command -l$name" else # We cannot seem to hardcode it, guess we'll fake it. case "$finalize_command " in *" -L$dir "*) ;; *) finalize_command="$finalize_command -L$libdir";; esac finalize_command="$finalize_command -l$name" fi else # Transform directly to old archives if we don't build new libraries. if test -n "$pic_flag" && test -z "$old_library"; then $echo "$modename: cannot find static library for \`$arg'" 1>&2 exit 1 fi # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_command="$compile_command $dir/$linklib" finalize_command="$finalize_command $dir/$linklib" else case "$compile_command " in *" -L$dir "*) ;; *) compile_command="$compile_command -L$dir";; esac compile_command="$compile_command -l$name" case "$finalize_command " in *" -L$dir "*) ;; *) finalize_command="$finalize_command -L$dir";; esac finalize_command="$finalize_command -l$name" fi fi # Add in any libraries that this one depends upon. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; esac # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" case "$output" in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.a | *.lib) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" ;; *.la) # Make sure we only generate libraries of the form `libNAME.la'. case "$outputname" in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi if test -n "$objs"; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 exit 1 fi # How the heck are we supposed to write a wrapper for a shared library? if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 exit 1 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi dependency_libs="$deplibs" if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case "$current" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$revision" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$age" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case "$version_type" in none) ;; irix) major=`expr $current - $age + 1` versuffix="$major.$revision" verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; windows) # Like Linux, but with '-' rather than '.', since we only # want one extension on Windows 95. major=`expr $current - $age` versuffix="-$major-$age-$revision" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi dependency_libs="$deplibs" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" ;; esac fi # Create the output directory, or remove our outputs if we need to. if test -d $output_objdir; then $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* else $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi if test "$build_libtool_libs" = yes; then # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case "$deplibs_check_method" in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linkopts="$linkopts $flag" fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; *.lo | *.o | *.obj) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case "$output" in *.lo) if test -n "$objs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; # Anything else should be a program. *) if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$compile_rpath " in *" $libdir "*) ;; *) compile_rpath="$compile_rpath $libdir" ;; esac case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the binary in the object directory, then wrap it. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case "$dlsyms" in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = {\ " sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr_t) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case "$host" in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: link_against_libtool_libs='$link_against_libtool_libs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname' progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if (cd \"\$thisdir\" && eval \$relink_command); then : else $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case "$output" in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" if test -n "$xrpath"; then temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" done dependency_libs="$temp_xrpath $dependency_libs" fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i fi $rm $output $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$dlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Directory that this library needs to be installed in: libdir='$install_libdir'\ " done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case "$arg" in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case "$destdir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case "$file" in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case "$file" in *.a | *.lib) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" test "X$dir" = "X$file/" && dir= dir="$dir$objdir" # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift # Install the shared library and build the symlinks. $show "$install_prog $dir/$realname $destdir/$realname" $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case "$destfile" in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.o | *.obj) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then link_against_libtool_libs= relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$link_against_libtool_libs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $link_against_libtool_libs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case "$lib" in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case "$file" in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case "$file" in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool uninstall mode uninstall) modename="$modename: uninstall" rm="$nonopt" files= for arg do case "$arg" in -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` rmfiles="$file" case "$name" in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" done test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles" $run $rm $rmfiles if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi $show "$rm $rmfiles" $run $rm $rmfiles ;; *) $show "$rm $rmfiles" $run $rm $rmfiles ;; esac done exit 0 ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case "$mode" in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: OpenJade-1.4devel/missing0000755000000000000000000001421307046720574011125 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 OpenJade-1.4devel/mkinstalldirs0000755000000000000000000000132207046720574012331 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here OpenJade-1.4devel/msggen.pl.in0000644000021000000240000001463007057722641011763 #! /usr/bin/perl # Copyright (c) 1994 James Clark, 2000 Matthias Clasen # See the file COPYING for copying permission. use POSIX; # Package and version. $package = '@PACKAGE@'; $version = '@VERSION@'; $prog = $0; $prog =~ s@.*/@@; $gen_c = 0; undef $opt_l; undef $opt_p; do 'getopts.pl'; &Getopts('l:p:'); $module = $opt_l; $pot_file = $opt_p; $num = 0; foreach $def_file (@ARGV) { @tag_used = (); open(DEF, $def_file) || die "can't open \`$def_file': $!\n"; while () { chop; if (/^!cxx$/) { $gen_c = 1; next; } if (/^=/) { if (!defined($opt_p)) { $n = substr($_, 1); &error("= directive must increase message num") if ($n < $num); $num = $n; } next; } if (/^-/) { # a deleted message $num++; next; } next if /^[ ]*#/; next if /^[ ]*$/; @field = split('\+', $_, 5); &error("too few fields") if $#field < 3; if ($#field == 4 && $field[4] =~ /^%J/) { $field[3] .= '+'; $field[3] .= substr($field[4], 2); $#field = 3; } if ($field[0] eq "") { $type[$num] = ""; $argc = 0; } else { $field[0] =~ /^[IWQXE][0-9]$/ || &error("invalid first field");; $type[$num] = substr($field[0], 0, 1); $argc = int(substr($field[0], 1, 1)); } $nargs[$num] = $argc; $field[1] =~ /^[a-zA-Z_][a-zA-Z0-9_]+$/ || &error("invalid tag"); $tag[$num] = $field[1]; &error("duplicate tag $field[1]") if (!defined($opt_p) && defined($tag_used{$field[1]})); $tag_used{$field[1]} = 1; $field[2] =~ /^((ISO(\/IEC)? [0-9]+:[0-9]+ )?(([A-Z]?[0-9]+(\.[0-9]+)*(p[0-9]+)?)|(\[[0-9]+(\.[0-9]*)?\]))( (ISO(\/IEC)? [0-9]+:[0-9]+ )?(([A-Z]?[0-9]+(\.[0-9]+)*(p[0-9]+)?)|(\[[0-9]+(\.[0-9]*)?\])))*)?$/ || &error("invalid clauses field"); # push @clauses, $field[2]; $clauses[$num] = $field[2]; if ($argc == 0) { if ($field[0] ne "") { $field[3] =~ /^([^%]|%%)*$/ || &error("invalid character after %"); } } else { $field[3] =~ /^([^%]|%[%1-$argc])*$/ || &error("invalid character after %"); } $auxloc[$num] = ($#field == 4 ? "L" : ""); $message[$num] = $field[3]; $num++; if ($#field == 4) { $message2[$num] = $field[4]; $num++; } } close(DEF); if (!defined($opt_p)) { $file_base = $ARGV[0]; $file_base =~ s/\.[^.]*$//; $class = $file_base; $class =~ s|.*[\\/]||; # this is needed on Windows NT chmod 0666, "$file_base.h"; unlink("$file_base.h"); open(OUT, ">$file_base.h"); chmod 0444, "$file_base.h"; select(OUT); print < #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct $class { END foreach $i (0 .. $#message) { if (defined($message[$i])) { print " // $i\n"; print " static const Message"; if ($type[$i] eq "") { print "Fragment"; } else { print "Type$nargs[$i]$auxloc[$i]"; } print " $tag[$i];\n"; } } print "};\n"; print <$file_base.cxx"); chmod 0444, "$file_base.cxx"; select(OUT); print <$file_base.rc"); chmod 0444, "$file_base.rc"; select(OUT); print "STRINGTABLE\nBEGIN\n"; foreach $i (0 .. $#message) { if (defined($message[$i])) { $str = $message[$i]; $str =~ s/"/""/g; printf " %d, \"%s\"\n", $i, $str; } elsif (defined($message2[$i])) { $str = $message2[$i]; $str =~ s/"/""/g; printf " %d, \"%s\"\n", $i, $str; } } print "END\n"; close(OUT); } # !opt_p } # foreach def_file if (defined($opt_p)) { # this is needed for GNU gettext chmod 0666, "$pot_file"; unlink("$pot_file"); open(OUT, ">$pot_file"); chmod 0444, "$pot_file"; select(OUT); $crdate = POSIX::strftime "%Y-%m-%d %H:%M+0000", gmtime; print <, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\\n" "POT-Creation-Date: $crdate\\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n" "Last-Translator: FULL NAME \\n" "Language-Team: LANGUAGE \\n" "MIME-Version:: 1.0\\n" "Content-Type: text/plain; charset=CHARSET\\n" "Content-Transfer-Encoding: ENCODING\\n" END foreach $i (0 .. $#message) { if (defined($message[$i]) && !defined($written{$message[$i]})) { next if $message[$i] eq ""; $written{$message[$i]} = 1; $str = $message[$i]; $str =~ s/"/\\"/g; printf "msgid \"%s\"\nmsgstr \"\"\n\n", $str; } elsif (defined($message2[$i]) && ! defined($written{$message2[$i]})) { $written{$message2[$i]} = 1; $str = $message2[$i]; $str =~ s/"/\\"/g; printf "msgid \"%s\"\nmsgstr \"\"\n\n", $str; } } } close(OUT); sub error { die "$def_file:$.: $_[0]\n"; } OpenJade-1.4devel/spec.in0000644000021000000240000000523207070153674011020 # Copyright (C) 2000 Matthias Clasen # See the file COPYING for copying permissions. Summary: OpenJade group's DSSSL engine Name: @PACKAGE@ Version: @VERSION@ Release: 1 BuildRoot: /tmp/@PACKAGE@-@VERSION@-buildroot Copyright: Copyright 1997 James Clark Group: Applications/Text Source: http://download.sourceforge.net/openjade/@PACKAGE@-@VERSION@.tar.gz URL: http://openjade.sourceforge.net Vendor: The OpenJade team Packager: Matthias Clasen Requires: @PACKAGE@-lib %description OpenJade is an implementation of the DSSSL style language. The OpenJade engine is a useful tool (in conjunction with a DSSSL style sheet) for translating SGML documents into other formats. OpenJade can currently generate SGML, HTML, RTF, MIF and TeX. In conjunction with the "jadetex" TeX style, it can generate quite nice output. %package lib Summary: Runtime libraries for OpenJade group's DSSSL engine Group: System Environment/Libraries Requires: OpenSP-lib %description lib This is the OpenJade shared library runtime support. These C++ libraries contain the actual DSSSL engine, an abstract C++ interface to groves and an implementation of this interface on top of OpenSP. %package devel Summary: Libraries and include files for developing DSSSL applications. Group: Development/Libraries Requires: OpenSP-devel %description devel This contains include files and libraries for OpenJade. These C++ libraries contain the actual DSSSL engine, an abstract C++ interface to groves and an implementation of this interface on top of OpenSP. %prep # check that rpm is new enough to know internal macros like %{_prefix} rpmversion=`rpm -q --queryformat '%{RPMVERSION}' rpm | cut -d. -f1` [ ${rpmversion} -lt 3 ] && { echo "please update rpm" exit 1 ; } # unpack source .tar.gz package %setup %build # configure build system according to rpm settings ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --libexecdir=%{_libexecdir} --datadir=%{_datadir} --sysconfdir=%{_sysconfdir} --sharedstatedir=%{_sharedstatedir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --includedir=%{_includedir} --oldincludedir=%{_oldincludedir} --infodir=%{_infodir} --mandir=%{_mandir} # compile and link make CFLAGS="${RPM_OPT_FLAGS}" %install # install all files make "DESTDIR=${RPM_BUILD_ROOT}" install %clean test "$RPM_BUILD_ROOT" = "/" || rm -rf "$RPM_BUILD_ROOT" %files %defattr(-, root, root) %{_bindir}/* %{_datadir}/@PACKAGE@/* %doc /usr/doc/@PACKAGE@/* %files lib %defattr(-, root, root) %{_libdir}/*.so.* %files devel %defattr(-, root, root) %{_libdir}/lib*.{so,a,la} %{_includedir}/@PACKAGE@/* OpenJade-1.4devel/config.h0000644000021000000240000002133507070155746011160 /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ // Copyright (C) 1999 Matthias Clasen, Peter Nilsson // See the file COPYING for copying permissions. #include /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define if you have alloca, as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Define if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define if your struct stat has st_blksize. */ #define HAVE_ST_BLKSIZE 1 /* Define as __inline if that's what the C compiler calls it. */ /* #undef inline */ /* Define to `long' if doesn't define. */ /* #undef off_t */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define to `unsigned' if doesn't define. */ /* #undef size_t */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* these are needed for GNU gettext */ #define ENABLE_NLS 1 /* #undef HAVE_CATGETS */ #define HAVE_GETTEXT 1 #define HAVE_LC_MESSAGES 1 #define HAVE_STPCPY 1 /* define this appropriately if the type sig_atomic_t is not available */ /* #undef sig_atomic_t */ /* define this if the new handler takes size_t and returns int. */ /* #undef SP_FANCY_NEW_HANDLER */ /* The number of bytes in a bool. */ #define SIZEOF_BOOL 1 /* The number of bytes in a size_t. */ #define SIZEOF_SIZE_T 4 /* The number of bytes in a unsigned int. */ #define SIZEOF_UNSIGNED_INT 4 /* The number of bytes in a unsigned short. */ #define SIZEOF_UNSIGNED_SHORT 2 /* Define if you have the __argz_count function. */ #define HAVE___ARGZ_COUNT 1 /* Define if you have the __argz_next function. */ #define HAVE___ARGZ_NEXT 1 /* Define if you have the __argz_stringify function. */ #define HAVE___ARGZ_STRINGIFY 1 /* Define if you have the dcgettext function. */ #define HAVE_DCGETTEXT 1 /* Define if you have the getcwd function. */ #define HAVE_GETCWD 1 /* Define if you have the getpagesize function. */ #define HAVE_GETPAGESIZE 1 /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the munmap function. */ #define HAVE_MUNMAP 1 /* Define if you have the putenv function. */ #define HAVE_PUTENV 1 /* Define if you have the setenv function. */ #define HAVE_SETENV 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the stpcpy function. */ #define HAVE_STPCPY 1 /* Define if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the header file. */ #define HAVE_ARGZ_H 1 /* Define if you have the header file. */ #define HAVE_CASSERT 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ #define HAVE_NEW 1 /* Define if you have the header file. */ #define HAVE_NL_TYPES_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define if you have the i library (-li). */ /* #undef HAVE_LIBI */ /* Define if you have the pthread library (-lpthread). */ #define HAVE_LIBPTHREAD 1 /* Package name */ #define OPENJADE_PACKAGE "OpenJade" /* Package version */ #define OPENJADE_VERSION "1.4devel" /* location of message catalogs */ #define OPENJADE_LOCALE_DIR "/free/opt/share/locale" /* message domain */ #define OPENJADE_MESSAGE_DOMAIN "jade" /* define if bool is a built-in type */ #define HAVE_BOOL /* define if the compiler supports the mutable keyword */ #define HAVE_MUTABLE /* define if the compiler recognizes typename */ #define HAVE_TYPENAME /* define if the compiler accepts the new for scoping rules */ #define HAVE_NEW_FOR_SCOPING /* define if the compiler supports placement operator delete */ /* #undef HAVE_PLACEMENT_OPERATOR_DELETE */ /* define if the compiler supports dynamic_cast<> */ #define HAVE_DYNAMIC_CAST /* define if the compiler implements namespaces */ #define HAVE_NAMESPACES /* define if the compiler supports explicit instantiations */ #define HAVE_INSTANTIATIONS /* define if placement operator new is declared */ #define HAVE_PLACEMENT_OPERATOR_NEW 1 /* define if the C++ compiler supports the std namespace */ #define HAVE_NAMESPACE_STD 1 /* define this to include template definitions in the headers */ #define SP_DEFINE_TEMPLATES 1 /* define this to compile explicit template instantiations */ /* #undef SP_MANUAL_INST */ /* define this if your system misses new.h */ /* #undef SP_NEW_H_MISSING */ /* define this if set_new_handler() has to be declared extern C */ /* #undef SP_SET_NEW_HANDLER_EXTERN_C */ /* define this if the new handler takes size_t and returns int */ /* #undef SP_FANCY_NEW_HANDLER */ /* set this to the location of builtins.dsl */ #define DEFAULT_SCHEME_BUILTINS "/free/opt/share/OpenJade/builtins.dsl" /* define this to build a multi-byte version */ #define SP_MULTI_BYTE 1 /* define this to build the grove in a separate thread, if possible */ /* #undef USE_THREADS */ /* define this to build the mif backend */ #define JADE_MIF 1 /* define this to build the mif backend */ #define JADE_MIF 1 /* define this to build the html backend */ #define JADE_HTML 1 /* define this to build the html backend */ #define JADE_HTML 1 #ifdef HAVE_BOOL #define SP_HAVE_BOOL #endif /* HAVE_BOOL */ #if (SIZEOF_BOOL == 1) #define SP_SIZEOF_BOOL_1 #endif #if (SIZEOF_WCHAR_T == SIZEOF_UNSIGNED_SHORT) #define SP_WCHAR_T_USHORT #endif #ifdef SP_HAVE_SETMODE #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\r' #define SP_LINE_TERM2 '\n' #endif #endif /* not SP_HAVE_SETMODE */ #ifndef SP_LINE_TERM1 #define SP_LINE_TERM1 '\n' #endif #ifndef HAVE_NEW_FOR_SCOPING // This simulates the new ANSI "for" scope rules #define for if (0); else for #endif /* HAVE_NEW_FOR_SCOPING */ #ifndef SP_HAVE_TYPENAME #define typename /* as nothing */ #endif #ifndef SP_DLLEXPORT #define SP_DLLEXPORT /* as nothing */ #endif #ifndef SP_DLLIMPORT #define SP_DLLIMPORT /* as nothing */ #endif #ifdef SP_USE_DLL #ifdef BUILD_LIBSP #define SP_API SP_DLLEXPORT #else #define SP_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define SP_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef SP_WIDE_SYSTEM #ifndef SP_MULTI_BYTE #define SP_MULTI_BYTE #endif #endif #ifdef HAVE_NAMESPACES #define SP_NAMESPACE OpenSP #define DSSSL_NAMESPACE OpenJade_DSSSL #define GROVE_NAMESPACE OpenJade_Grove #endif /* HAVE_NAMESPACES */ #ifdef SP_NAMESPACE #define SP_NAMESPACE_SCOPE SP_NAMESPACE:: #else #define SP_NAMESPACE_SCOPE #endif /* SP_NAMESPACE */ #ifdef HAVE_DYNAMIC_CAST #define SP_HAVE_RTTI #endif /* HAVE_DYNAMIC_CAST */ #ifdef HAVE_TYPENAME #define SP_HAVE_TYPENAME #endif /* HAVE_TYPENAME */ #ifdef HAVE_PATHNAME_STYLE_DOS #define SP_MSDOS_FILENAMES #else #define SP_POSIX_FILENAMES #endif /* HAVE_PATHNAME_STYLE_DOS */ #ifdef HAVE_INSTANTIATIONS #define SP_ANSI_CLASS_INST #endif /* HAVE_INSTANTIATIONS */ #ifdef HAVE_SETLOCALE #define SP_HAVE_LOCALE #endif /* HAVE_SETLOCALE */ #ifdef HAVE_GETTEXT #define SP_HAVE_GETTEXT #endif /* HAVE_GETTEXT */ #ifdef WORDS_BIGENDIAN #define SP_BIG_ENDIAN #endif /* WORDS_BIGENDIAN */ #ifdef HAVE_LIBTHREADS #define SP_MUTEX_MACH #endif /* HAVE_LIBTHREADS */ #ifdef HAVE_LIBPTHREAD #define SP_MUTEX_PTHREADS #endif /* HAVE_LIBPTHREAD */ #ifdef HAVE_PLACEMENT_OPERATOR_DELETE #define SP_HAVE_PLACEMENT_OPERATOR_DELETE #endif /* HAVE_PLACEMENT_OPERATOR_DELETE */ #ifndef HAVE_PLACEMENT_OPERATOR_NEW #define SP_DECLARE_PLACEMENT_OPERATOR_NEW #endif /* HAVE_PLACEMENT_OPERATOR_NEW */ #ifndef HAVE_NAMESPACE_STD #define SP_NO_STD_NAMESPACE #endif /* HAVE_NAMESPACE_STD */ OpenJade-1.4devel/instmac.pl0000755000021000000240000000235707012606262011531 #! /bin/perl -w # # Copyright (c) 1999 Avi Kivity # instmac.pl -- generate template instantiations # derived from James Clark's instmac.m4 # $index = 0; $func_index = 0; sub header { print <<__HEADER__; #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif __HEADER__ } sub instantiate { my ($class) = @_; print <<__INSTANTIATION__; #ifdef __DECCXX #pragma define_template $class #else #ifdef __xlC__ #pragma define($class) #else #ifdef SP_ANSI_CLASS_INST template class $class; #else typedef $class Dummy_$index; #endif #endif #endif __INSTANTIATION__ ++$index; } sub func_instantiate { my ($a1, $a2, $a3, $a4) = @_; print <<__FUNC_INSTANTIATION__; #ifdef __GNUG__ template void $a1($a2, $a3, $a4); #else static void func_$func_index ($a2 arg1, $a3 arg2, $a4 arg3) { (void)$a1(arg1, arg2, arg3); } #endif __FUNC_INSTANTIATION__ ++$func_index; } header; while () { if (/^__instantiate\((.*)\)\s*$/) { $arg = $1; $arg = $1 if /`(.*)'/; instantiate $arg; } elsif (/^__instantiate\((.*)\)\s*$/) { die "instantiate_func3 found!"; } else { print; } } OpenJade-1.4devel/msggen.pl0000644000021000000240000001462607070155751011360 #! /usr/bin/perl # Copyright (c) 1994 James Clark, 2000 Matthias Clasen # See the file COPYING for copying permission. use POSIX; # Package and version. $package = 'OpenJade'; $version = '1.4devel'; $prog = $0; $prog =~ s@.*/@@; $gen_c = 0; undef $opt_l; undef $opt_p; do 'getopts.pl'; &Getopts('l:p:'); $module = $opt_l; $pot_file = $opt_p; $num = 0; foreach $def_file (@ARGV) { @tag_used = (); open(DEF, $def_file) || die "can't open \`$def_file': $!\n"; while () { chop; if (/^!cxx$/) { $gen_c = 1; next; } if (/^=/) { if (!defined($opt_p)) { $n = substr($_, 1); &error("= directive must increase message num") if ($n < $num); $num = $n; } next; } if (/^-/) { # a deleted message $num++; next; } next if /^[ ]*#/; next if /^[ ]*$/; @field = split('\+', $_, 5); &error("too few fields") if $#field < 3; if ($#field == 4 && $field[4] =~ /^%J/) { $field[3] .= '+'; $field[3] .= substr($field[4], 2); $#field = 3; } if ($field[0] eq "") { $type[$num] = ""; $argc = 0; } else { $field[0] =~ /^[IWQXE][0-9]$/ || &error("invalid first field");; $type[$num] = substr($field[0], 0, 1); $argc = int(substr($field[0], 1, 1)); } $nargs[$num] = $argc; $field[1] =~ /^[a-zA-Z_][a-zA-Z0-9_]+$/ || &error("invalid tag"); $tag[$num] = $field[1]; &error("duplicate tag $field[1]") if (!defined($opt_p) && defined($tag_used{$field[1]})); $tag_used{$field[1]} = 1; $field[2] =~ /^((ISO(\/IEC)? [0-9]+:[0-9]+ )?(([A-Z]?[0-9]+(\.[0-9]+)*(p[0-9]+)?)|(\[[0-9]+(\.[0-9]*)?\]))( (ISO(\/IEC)? [0-9]+:[0-9]+ )?(([A-Z]?[0-9]+(\.[0-9]+)*(p[0-9]+)?)|(\[[0-9]+(\.[0-9]*)?\])))*)?$/ || &error("invalid clauses field"); # push @clauses, $field[2]; $clauses[$num] = $field[2]; if ($argc == 0) { if ($field[0] ne "") { $field[3] =~ /^([^%]|%%)*$/ || &error("invalid character after %"); } } else { $field[3] =~ /^([^%]|%[%1-$argc])*$/ || &error("invalid character after %"); } $auxloc[$num] = ($#field == 4 ? "L" : ""); $message[$num] = $field[3]; $num++; if ($#field == 4) { $message2[$num] = $field[4]; $num++; } } close(DEF); if (!defined($opt_p)) { $file_base = $ARGV[0]; $file_base =~ s/\.[^.]*$//; $class = $file_base; $class =~ s|.*[\\/]||; # this is needed on Windows NT chmod 0666, "$file_base.h"; unlink("$file_base.h"); open(OUT, ">$file_base.h"); chmod 0444, "$file_base.h"; select(OUT); print < #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct $class { END foreach $i (0 .. $#message) { if (defined($message[$i])) { print " // $i\n"; print " static const Message"; if ($type[$i] eq "") { print "Fragment"; } else { print "Type$nargs[$i]$auxloc[$i]"; } print " $tag[$i];\n"; } } print "};\n"; print <$file_base.cxx"); chmod 0444, "$file_base.cxx"; select(OUT); print <$file_base.rc"); chmod 0444, "$file_base.rc"; select(OUT); print "STRINGTABLE\nBEGIN\n"; foreach $i (0 .. $#message) { if (defined($message[$i])) { $str = $message[$i]; $str =~ s/"/""/g; printf " %d, \"%s\"\n", $i, $str; } elsif (defined($message2[$i])) { $str = $message2[$i]; $str =~ s/"/""/g; printf " %d, \"%s\"\n", $i, $str; } } print "END\n"; close(OUT); } # !opt_p } # foreach def_file if (defined($opt_p)) { # this is needed for GNU gettext chmod 0666, "$pot_file"; unlink("$pot_file"); open(OUT, ">$pot_file"); chmod 0444, "$pot_file"; select(OUT); $crdate = POSIX::strftime "%Y-%m-%d %H:%M+0000", gmtime; print <, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\\n" "POT-Creation-Date: $crdate\\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n" "Last-Translator: FULL NAME \\n" "Language-Team: LANGUAGE \\n" "MIME-Version:: 1.0\\n" "Content-Type: text/plain; charset=CHARSET\\n" "Content-Transfer-Encoding: ENCODING\\n" END foreach $i (0 .. $#message) { if (defined($message[$i]) && !defined($written{$message[$i]})) { next if $message[$i] eq ""; $written{$message[$i]} = 1; $str = $message[$i]; $str =~ s/"/\\"/g; printf "msgid \"%s\"\nmsgstr \"\"\n\n", $str; } elsif (defined($message2[$i]) && ! defined($written{$message2[$i]})) { $written{$message2[$i]} = 1; $str = $message2[$i]; $str =~ s/"/\\"/g; printf "msgid \"%s\"\nmsgstr \"\"\n\n", $str; } } } close(OUT); sub error { die "$def_file:$.: $_[0]\n"; } OpenJade-1.4devel/jade.dsw0000644000021000000240000001171506763554131011164 Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "all"=.\all\all.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name groveoa End Project Dependency Begin Project Dependency Project_Dep_Name jade End Project Dependency Begin Project Dependency Project_Dep_Name nsgmls End Project Dependency Begin Project Dependency Project_Dep_Name sgmlnorm End Project Dependency Begin Project Dependency Project_Dep_Name spam End Project Dependency Begin Project Dependency Project_Dep_Name spent End Project Dependency Begin Project Dependency Project_Dep_Name sx End Project Dependency Begin Project Dependency Project_Dep_Name spcat End Project Dependency }}} ############################################################################### Project: "grove"=.\grove\grove.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "groveoa"=.\groveoa\groveoa.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name grove End Project Dependency Begin Project Dependency Project_Dep_Name spgrove End Project Dependency Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "jade"=.\jade\jade.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name grove End Project Dependency Begin Project Dependency Project_Dep_Name spgrove End Project Dependency Begin Project Dependency Project_Dep_Name style End Project Dependency Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "jadedist"=.\jadedist\jadedist.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name all End Project Dependency }}} ############################################################################### Project: "lib"=.\lib\lib.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "nsgmls"=.\nsgmls\nsgmls.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "sgmlnorm"=.\sgmlnorm\sgmlnorm.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "spam"=.\spam\spam.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "spcat"=.\spcat\spcat.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "spent"=.\spent\spent.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "spgrove"=.\spgrove\spgrove.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name grove End Project Dependency Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "style"=.\style\style.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name grove End Project Dependency Begin Project Dependency Project_Dep_Name spgrove End Project Dependency Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Project: "sx"=.\sx\sx.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name lib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### OpenJade-1.4devel/jade.mak0000644000021000000240000057600206713071515011137 # Microsoft Developer Studio Generated NMAKE File, Format Version 4.20 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 # TARGTYPE "Win32 (x86) External Target" 0x0106 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 !IF "$(CFG)" == "" CFG=groveoa - Win32 Debug !MESSAGE No configuration specified. Defaulting to groveoa - Win32 Debug. !ENDIF !IF "$(CFG)" != "grove - Win32 Release" && "$(CFG)" != "grove - Win32 Debug" &&\ "$(CFG)" != "spgrove - Win32 Release" && "$(CFG)" != "spgrove - Win32 Debug" &&\ "$(CFG)" != "style - Win32 Release" && "$(CFG)" != "style - Win32 Debug" &&\ "$(CFG)" != "jade - Win32 Release" && "$(CFG)" != "jade - Win32 Debug" &&\ "$(CFG)" != "jadedist - Win32 Release" && "$(CFG)" != "groveoa - Win32 Release"\ && "$(CFG)" != "groveoa - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE on this makefile !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "jade.mak" CFG="groveoa - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "grove - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "grove - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spgrove - Win32 Release" (based on\ "Win32 (x86) Dynamic-Link Library") !MESSAGE "spgrove - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "style - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "style - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "jade - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "jade - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "jadedist - Win32 Release" (based on "Win32 (x86) External Target") !MESSAGE "groveoa - Win32 Release" (based on\ "Win32 (x86) Dynamic-Link Library") !MESSAGE "groveoa - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF ################################################################################ # Begin Project # PROP Target_Last_Scanned "groveoa - Win32 Debug" !IF "$(CFG)" == "grove - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "grove\Release" # PROP BASE Intermediate_Dir "grove\Release" # PROP BASE Target_Dir "grove" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "grove\Release" # PROP Intermediate_Dir "grove\Release" # PROP Target_Dir "grove" OUTDIR=.\grove\Release INTDIR=.\grove\Release ALL : ".\bin\grove.dll" CLEAN : -@erase "$(INTDIR)\LocNode.obj" -@erase "$(INTDIR)\Node.obj" -@erase "$(OUTDIR)\grove.exp" -@erase "$(OUTDIR)\grove.lib" -@erase ".\bin\grove.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBGROVE" /YX /c CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "include" /D "NDEBUG" /D "WIN32" /D\ "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D\ SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBGROVE" /Fp"$(INTDIR)/grove.pch" /YX\ /Fo"$(INTDIR)/" /c CPP_OBJS=.\grove\Release/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 MTL_PROJ=/nologo /D "NDEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/grove.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20200000 /subsystem:windows /dll /machine:I386 /out:"bin\grove.dll" # SUBTRACT LINK32 /profile LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib /nologo /base:0x20200000 /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)/grove.pdb" /machine:I386 /out:"bin\grove.dll"\ /implib:"$(OUTDIR)/grove.lib" LINK32_OBJS= \ "$(INTDIR)\LocNode.obj" \ "$(INTDIR)\Node.obj" ".\bin\grove.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "grove - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "grove\Debug" # PROP BASE Intermediate_Dir "grove\Debug" # PROP BASE Target_Dir "grove" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "grove\Debug" # PROP Intermediate_Dir "grove\Debug" # PROP Target_Dir "grove" OUTDIR=.\grove\Debug INTDIR=.\grove\Debug ALL : ".\dbgbin\grove.dll" CLEAN : -@erase "$(INTDIR)\LocNode.obj" -@erase "$(INTDIR)\Node.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\grove.exp" -@erase "$(OUTDIR)\grove.lib" -@erase "$(OUTDIR)\grove.pdb" -@erase ".\dbgbin\grove.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBGROVE" /YX /c CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /D "_DEBUG" /D "WIN32"\ /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D\ SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBGROVE" /Fp"$(INTDIR)/grove.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\grove\Debug/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 MTL_PROJ=/nologo /D "_DEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/grove.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20200000 /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"dbgbin\grove.dll" LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib /nologo /base:0x20200000 /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)/grove.pdb" /debug /machine:I386 /out:"dbgbin\grove.dll"\ /implib:"$(OUTDIR)/grove.lib" LINK32_OBJS= \ "$(INTDIR)\LocNode.obj" \ "$(INTDIR)\Node.obj" ".\dbgbin\grove.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "spgrove - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "spgrove\Release" # PROP BASE Intermediate_Dir "spgrove\Release" # PROP BASE Target_Dir "spgrove" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "spgrove\Release" # PROP Intermediate_Dir "spgrove\Release" # PROP Target_Dir "spgrove" OUTDIR=.\spgrove\Release INTDIR=.\spgrove\Release ALL : "grove - Win32 Release" ".\bin\spgrove.dll" CLEAN : -@erase "$(INTDIR)\GroveApp.obj" -@erase "$(INTDIR)\GroveBuilder.obj" -@erase "$(INTDIR)\SdNode.obj" -@erase "$(OUTDIR)\spgrove.exp" -@erase "$(OUTDIR)\spgrove.lib" -@erase ".\bin\spgrove.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBSPGROVE" /YX /c CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "include" /I "grove" /D "NDEBUG" /D "WIN32"\ /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D\ SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBSPGROVE" /Fp"$(INTDIR)/spgrove.pch"\ /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\spgrove\Release/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 MTL_PROJ=/nologo /D "NDEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/spgrove.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20100000 /subsystem:windows /dll /machine:I386 /out:"bin/spgrove.dll" # SUBTRACT LINK32 /profile LINK32_FLAGS=lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20100000 /subsystem:windows\ /dll /incremental:no /pdb:"$(OUTDIR)/spgrove.pdb" /machine:I386\ /out:"bin/spgrove.dll" /implib:"$(OUTDIR)/spgrove.lib" LINK32_OBJS= \ "$(INTDIR)\GroveApp.obj" \ "$(INTDIR)\GroveBuilder.obj" \ "$(INTDIR)\SdNode.obj" \ ".\grove\Release\grove.lib" ".\bin\spgrove.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "spgrove - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "spgrove\Debug" # PROP BASE Intermediate_Dir "spgrove\Debug" # PROP BASE Target_Dir "spgrove" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "spgrove\Debug" # PROP Intermediate_Dir "spgrove\Debug" # PROP Target_Dir "spgrove" OUTDIR=.\spgrove\Debug INTDIR=.\spgrove\Debug ALL : "grove - Win32 Debug" ".\dbgbin\spgrove.dll" CLEAN : -@erase "$(INTDIR)\GroveApp.obj" -@erase "$(INTDIR)\GroveBuilder.obj" -@erase "$(INTDIR)\SdNode.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\spgrove.exp" -@erase "$(OUTDIR)\spgrove.lib" -@erase "$(OUTDIR)\spgrove.pdb" -@erase ".\dbgbin\spgrove.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /D SP_NAMESPACE=James_Clark_SP /D "BUILD_LIBSPGROVE" /YX /c CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /D "_DEBUG"\ /D "WIN32" /D "_WINDOWS" /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /D SP_NAMESPACE=James_Clark_SP /D\ "BUILD_LIBSPGROVE" /Fp"$(INTDIR)/spgrove.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\spgrove\Debug/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 MTL_PROJ=/nologo /D "_DEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/spgrove.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20100000 /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"dbgbin\spgrove.dll" LINK32_FLAGS=lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20100000 /subsystem:windows\ /dll /incremental:no /pdb:"$(OUTDIR)/spgrove.pdb" /debug /machine:I386\ /out:"dbgbin\spgrove.dll" /implib:"$(OUTDIR)/spgrove.lib" LINK32_OBJS= \ "$(INTDIR)\GroveApp.obj" \ "$(INTDIR)\GroveBuilder.obj" \ "$(INTDIR)\SdNode.obj" \ ".\grove\Debug\grove.lib" ".\dbgbin\spgrove.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "style - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "style\Release" # PROP BASE Intermediate_Dir "style\Release" # PROP BASE Target_Dir "style" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "style\Release" # PROP Intermediate_Dir "style\Release" # PROP Target_Dir "style" OUTDIR=.\style\Release INTDIR=.\style\Release ALL : "spgrove - Win32 Release" "grove - Win32 Release" ".\bin\style.dll" CLEAN : -@erase "$(INTDIR)\Collector.obj" -@erase "$(INTDIR)\common_inst.obj" -@erase "$(INTDIR)\DssslApp.obj" -@erase "$(INTDIR)\DssslSpecEventHandler.obj" -@erase "$(INTDIR)\ELObj.obj" -@erase "$(INTDIR)\ELObjMessageArg.obj" -@erase "$(INTDIR)\Expression.obj" -@erase "$(INTDIR)\FlowObj.obj" -@erase "$(INTDIR)\FOTBuilder.obj" -@erase "$(INTDIR)\GroveManager.obj" -@erase "$(INTDIR)\InheritedC.obj" -@erase "$(INTDIR)\Insn.obj" -@erase "$(INTDIR)\Interpreter.obj" -@erase "$(INTDIR)\InterpreterMessages.obj" -@erase "$(INTDIR)\MacroFlowObj.obj" -@erase "$(INTDIR)\NumberCache.obj" -@erase "$(INTDIR)\Pattern.obj" -@erase "$(INTDIR)\primitive.obj" -@erase "$(INTDIR)\ProcessContext.obj" -@erase "$(INTDIR)\ProcessingMode.obj" -@erase "$(INTDIR)\SchemeParser.obj" -@erase "$(INTDIR)\Style.obj" -@erase "$(INTDIR)\style.pch" -@erase "$(INTDIR)\style_inst.obj" -@erase "$(INTDIR)\StyleEngine.obj" -@erase "$(INTDIR)\stylelib.obj" -@erase "$(OUTDIR)\style.exp" -@erase "$(OUTDIR)\style.lib" -@erase ".\bin\style.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /c CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\style\Release/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 MTL_PROJ=/nologo /D "NDEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/style.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20000000 /subsystem:windows /dll /machine:I386 /out:"bin\style.dll" # SUBTRACT LINK32 /profile LINK32_FLAGS=lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20000000 /subsystem:windows\ /dll /incremental:no /pdb:"$(OUTDIR)/style.pdb" /machine:I386\ /out:"bin\style.dll" /implib:"$(OUTDIR)/style.lib" LINK32_OBJS= \ "$(INTDIR)\Collector.obj" \ "$(INTDIR)\common_inst.obj" \ "$(INTDIR)\DssslApp.obj" \ "$(INTDIR)\DssslSpecEventHandler.obj" \ "$(INTDIR)\ELObj.obj" \ "$(INTDIR)\ELObjMessageArg.obj" \ "$(INTDIR)\Expression.obj" \ "$(INTDIR)\FlowObj.obj" \ "$(INTDIR)\FOTBuilder.obj" \ "$(INTDIR)\GroveManager.obj" \ "$(INTDIR)\InheritedC.obj" \ "$(INTDIR)\Insn.obj" \ "$(INTDIR)\Interpreter.obj" \ "$(INTDIR)\InterpreterMessages.obj" \ "$(INTDIR)\MacroFlowObj.obj" \ "$(INTDIR)\NumberCache.obj" \ "$(INTDIR)\Pattern.obj" \ "$(INTDIR)\primitive.obj" \ "$(INTDIR)\ProcessContext.obj" \ "$(INTDIR)\ProcessingMode.obj" \ "$(INTDIR)\SchemeParser.obj" \ "$(INTDIR)\Style.obj" \ "$(INTDIR)\style_inst.obj" \ "$(INTDIR)\StyleEngine.obj" \ "$(INTDIR)\stylelib.obj" \ ".\grove\Release\grove.lib" \ ".\spgrove\Release\spgrove.lib" ".\bin\style.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "style - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "style\Debug" # PROP BASE Intermediate_Dir "style\Debug" # PROP BASE Target_Dir "style" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "style\Debug" # PROP Intermediate_Dir "style\Debug" # PROP Target_Dir "style" OUTDIR=.\style\Debug INTDIR=.\style\Debug ALL : "spgrove - Win32 Debug" "grove - Win32 Debug" ".\dbgbin\style.dll"\ "$(OUTDIR)\style.bsc" CLEAN : -@erase "$(INTDIR)\Collector.obj" -@erase "$(INTDIR)\Collector.sbr" -@erase "$(INTDIR)\common_inst.obj" -@erase "$(INTDIR)\common_inst.sbr" -@erase "$(INTDIR)\DssslApp.obj" -@erase "$(INTDIR)\DssslApp.sbr" -@erase "$(INTDIR)\DssslSpecEventHandler.obj" -@erase "$(INTDIR)\DssslSpecEventHandler.sbr" -@erase "$(INTDIR)\ELObj.obj" -@erase "$(INTDIR)\ELObj.sbr" -@erase "$(INTDIR)\ELObjMessageArg.obj" -@erase "$(INTDIR)\ELObjMessageArg.sbr" -@erase "$(INTDIR)\Expression.obj" -@erase "$(INTDIR)\Expression.sbr" -@erase "$(INTDIR)\FlowObj.obj" -@erase "$(INTDIR)\FlowObj.sbr" -@erase "$(INTDIR)\FOTBuilder.obj" -@erase "$(INTDIR)\FOTBuilder.sbr" -@erase "$(INTDIR)\GroveManager.obj" -@erase "$(INTDIR)\GroveManager.sbr" -@erase "$(INTDIR)\InheritedC.obj" -@erase "$(INTDIR)\InheritedC.sbr" -@erase "$(INTDIR)\Insn.obj" -@erase "$(INTDIR)\Insn.sbr" -@erase "$(INTDIR)\Interpreter.obj" -@erase "$(INTDIR)\Interpreter.sbr" -@erase "$(INTDIR)\InterpreterMessages.obj" -@erase "$(INTDIR)\InterpreterMessages.sbr" -@erase "$(INTDIR)\MacroFlowObj.obj" -@erase "$(INTDIR)\MacroFlowObj.sbr" -@erase "$(INTDIR)\NumberCache.obj" -@erase "$(INTDIR)\NumberCache.sbr" -@erase "$(INTDIR)\Pattern.obj" -@erase "$(INTDIR)\Pattern.sbr" -@erase "$(INTDIR)\primitive.obj" -@erase "$(INTDIR)\primitive.sbr" -@erase "$(INTDIR)\ProcessContext.obj" -@erase "$(INTDIR)\ProcessContext.sbr" -@erase "$(INTDIR)\ProcessingMode.obj" -@erase "$(INTDIR)\ProcessingMode.sbr" -@erase "$(INTDIR)\SchemeParser.obj" -@erase "$(INTDIR)\SchemeParser.sbr" -@erase "$(INTDIR)\Style.obj" -@erase "$(INTDIR)\style.pch" -@erase "$(INTDIR)\Style.sbr" -@erase "$(INTDIR)\style_inst.obj" -@erase "$(INTDIR)\style_inst.sbr" -@erase "$(INTDIR)\StyleEngine.obj" -@erase "$(INTDIR)\StyleEngine.sbr" -@erase "$(INTDIR)\stylelib.obj" -@erase "$(INTDIR)\stylelib.sbr" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\style.bsc" -@erase "$(OUTDIR)\style.exp" -@erase "$(OUTDIR)\style.lib" -@erase "$(OUTDIR)\style.pdb" -@erase ".\dbgbin\style.dll" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /FR /YX /c CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c CPP_OBJS=.\style\Debug/ CPP_SBRS=.\style\Debug/ .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 MTL_PROJ=/nologo /D "_DEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/style.bsc" BSC32_SBRS= \ "$(INTDIR)\Collector.sbr" \ "$(INTDIR)\common_inst.sbr" \ "$(INTDIR)\DssslApp.sbr" \ "$(INTDIR)\DssslSpecEventHandler.sbr" \ "$(INTDIR)\ELObj.sbr" \ "$(INTDIR)\ELObjMessageArg.sbr" \ "$(INTDIR)\Expression.sbr" \ "$(INTDIR)\FlowObj.sbr" \ "$(INTDIR)\FOTBuilder.sbr" \ "$(INTDIR)\GroveManager.sbr" \ "$(INTDIR)\InheritedC.sbr" \ "$(INTDIR)\Insn.sbr" \ "$(INTDIR)\Interpreter.sbr" \ "$(INTDIR)\InterpreterMessages.sbr" \ "$(INTDIR)\MacroFlowObj.sbr" \ "$(INTDIR)\NumberCache.sbr" \ "$(INTDIR)\Pattern.sbr" \ "$(INTDIR)\primitive.sbr" \ "$(INTDIR)\ProcessContext.sbr" \ "$(INTDIR)\ProcessingMode.sbr" \ "$(INTDIR)\SchemeParser.sbr" \ "$(INTDIR)\Style.sbr" \ "$(INTDIR)\style_inst.sbr" \ "$(INTDIR)\StyleEngine.sbr" \ "$(INTDIR)\stylelib.sbr" "$(OUTDIR)\style.bsc" : "$(OUTDIR)" $(BSC32_SBRS) $(BSC32) @<< $(BSC32_FLAGS) $(BSC32_SBRS) << LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20000000 /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"dbgbin\style.dll" # SUBTRACT LINK32 /map LINK32_FLAGS=lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /base:0x20000000 /subsystem:windows\ /dll /incremental:no /pdb:"$(OUTDIR)/style.pdb" /debug /machine:I386\ /out:"dbgbin\style.dll" /implib:"$(OUTDIR)/style.lib" LINK32_OBJS= \ "$(INTDIR)\Collector.obj" \ "$(INTDIR)\common_inst.obj" \ "$(INTDIR)\DssslApp.obj" \ "$(INTDIR)\DssslSpecEventHandler.obj" \ "$(INTDIR)\ELObj.obj" \ "$(INTDIR)\ELObjMessageArg.obj" \ "$(INTDIR)\Expression.obj" \ "$(INTDIR)\FlowObj.obj" \ "$(INTDIR)\FOTBuilder.obj" \ "$(INTDIR)\GroveManager.obj" \ "$(INTDIR)\InheritedC.obj" \ "$(INTDIR)\Insn.obj" \ "$(INTDIR)\Interpreter.obj" \ "$(INTDIR)\InterpreterMessages.obj" \ "$(INTDIR)\MacroFlowObj.obj" \ "$(INTDIR)\NumberCache.obj" \ "$(INTDIR)\Pattern.obj" \ "$(INTDIR)\primitive.obj" \ "$(INTDIR)\ProcessContext.obj" \ "$(INTDIR)\ProcessingMode.obj" \ "$(INTDIR)\SchemeParser.obj" \ "$(INTDIR)\Style.obj" \ "$(INTDIR)\style_inst.obj" \ "$(INTDIR)\StyleEngine.obj" \ "$(INTDIR)\stylelib.obj" \ ".\grove\Debug\grove.lib" \ ".\spgrove\Debug\spgrove.lib" ".\dbgbin\style.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "jade - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "jade\Release" # PROP BASE Intermediate_Dir "jade\Release" # PROP BASE Target_Dir "jade" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "jade\Release" # PROP Intermediate_Dir "jade\Release" # PROP Target_Dir "jade" OUTDIR=.\jade\Release INTDIR=.\jade\Release ALL : "style - Win32 Release" "spgrove - Win32 Release" "grove - Win32 Release"\ ".\bin\jade.exe" CLEAN : -@erase "$(INTDIR)\HtmlFOTBuilder.obj" -@erase "$(INTDIR)\jade.obj" -@erase "$(INTDIR)\jade.res" -@erase "$(INTDIR)\MifFOTBuilder.obj" -@erase "$(INTDIR)\RtfFOTBuilder.obj" -@erase "$(INTDIR)\RtfOle.obj" -@erase "$(INTDIR)\SgmlFOTBuilder.obj" -@erase "$(INTDIR)\TeXFOTBuilder.obj" -@erase "$(INTDIR)\TransformFOTBuilder.obj" -@erase ".\bin\jade.exe" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "style" /I "grove" /I "spgrove" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /c CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "include" /I "style" /I "grove" /I\ "spgrove" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/" /c CPP_OBJS=.\jade\Release/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< RSC=rc.exe # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" RSC_PROJ=/l 0x809 /fo"$(INTDIR)/jade.res" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/jade.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"bin/jade.exe" # SUBTRACT LINK32 /profile LINK32_FLAGS=lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no\ /pdb:"$(OUTDIR)/jade.pdb" /machine:I386 /out:"bin/jade.exe" LINK32_OBJS= \ "$(INTDIR)\HtmlFOTBuilder.obj" \ "$(INTDIR)\jade.obj" \ "$(INTDIR)\jade.res" \ "$(INTDIR)\MifFOTBuilder.obj" \ "$(INTDIR)\RtfFOTBuilder.obj" \ "$(INTDIR)\RtfOle.obj" \ "$(INTDIR)\SgmlFOTBuilder.obj" \ "$(INTDIR)\TeXFOTBuilder.obj" \ "$(INTDIR)\TransformFOTBuilder.obj" \ ".\grove\Release\grove.lib" \ ".\spgrove\Release\spgrove.lib" \ ".\style\Release\style.lib" ".\bin\jade.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "jade\Debug" # PROP BASE Intermediate_Dir "jade\Debug" # PROP BASE Target_Dir "jade" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "jade\Debug" # PROP Intermediate_Dir "jade\Debug" # PROP Target_Dir "jade" OUTDIR=.\jade\Debug INTDIR=.\jade\Debug ALL : "style - Win32 Debug" "spgrove - Win32 Debug" "grove - Win32 Debug"\ ".\dbgbin\jade.exe" CLEAN : -@erase "$(INTDIR)\HtmlFOTBuilder.obj" -@erase "$(INTDIR)\jade.obj" -@erase "$(INTDIR)\jade.res" -@erase "$(INTDIR)\MifFOTBuilder.obj" -@erase "$(INTDIR)\RtfFOTBuilder.obj" -@erase "$(INTDIR)\RtfOle.obj" -@erase "$(INTDIR)\SgmlFOTBuilder.obj" -@erase "$(INTDIR)\TeXFOTBuilder.obj" -@erase "$(INTDIR)\TransformFOTBuilder.obj" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\jade.pdb" -@erase ".\dbgbin\jade.exe" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "include" /I "style" /I "grove" /I "spgrove" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /c CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "include" /I "style" /I "grove" /I\ "spgrove" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\jade\Debug/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< RSC=rc.exe # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" RSC_PROJ=/l 0x809 /fo"$(INTDIR)/jade.res" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/jade.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 # ADD LINK32 lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"dbgbin\jade.exe" LINK32_FLAGS=lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no\ /pdb:"$(OUTDIR)/jade.pdb" /debug /machine:I386 /out:"dbgbin\jade.exe" LINK32_OBJS= \ "$(INTDIR)\HtmlFOTBuilder.obj" \ "$(INTDIR)\jade.obj" \ "$(INTDIR)\jade.res" \ "$(INTDIR)\MifFOTBuilder.obj" \ "$(INTDIR)\RtfFOTBuilder.obj" \ "$(INTDIR)\RtfOle.obj" \ "$(INTDIR)\SgmlFOTBuilder.obj" \ "$(INTDIR)\TeXFOTBuilder.obj" \ "$(INTDIR)\TransformFOTBuilder.obj" \ ".\grove\Debug\grove.lib" \ ".\spgrove\Debug\spgrove.lib" \ ".\style\Debug\style.lib" ".\dbgbin\jade.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "jadedist - Win32 Release" # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "jadedist\Release" # PROP BASE Intermediate_Dir "jadedist\Release" # PROP BASE Target_Dir "jadedist" # PROP BASE Cmd_Line "NMAKE /f jadedist.mak" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "jadedist\jadedist.exe" # PROP BASE Bsc_Name "jadedist\jadedist.bsc" # PROP Use_Debug_Libraries 0 # PROP Output_Dir "jadedist\Release" # PROP Intermediate_Dir "jadedist\Release" # PROP Target_Dir "jadedist" # PROP Cmd_Line "makedist" # PROP Rebuild_Opt "" # PROP Target_File "jadedist\jade.zip" # PROP Bsc_Name "" OUTDIR=.\jadedist\Release INTDIR=.\jadedist\Release ALL : "jade - Win32 Release" CLEAN : -@erase "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" !ELSEIF "$(CFG)" == "groveoa - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "groveoa\Release" # PROP BASE Intermediate_Dir "groveoa\Release" # PROP BASE Target_Dir "groveoa" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "groveoa\Release" # PROP Intermediate_Dir "groveoa\Release" # PROP Target_Dir "groveoa" OUTDIR=.\groveoa\Release INTDIR=.\groveoa\Release # Begin Custom Macros OutDir=.\groveoa\Release # End Custom Macros ALL : "spgrove - Win32 Release" "grove - Win32 Release" ".\bin\groveoa.dll"\ "$(OUTDIR)\regsvr32.trg" CLEAN : -@erase "$(INTDIR)\CGroveBuilder.obj" -@erase "$(INTDIR)\GroveNode.obj" -@erase "$(INTDIR)\groveoa.obj" -@erase "$(INTDIR)\groveoa.pch" -@erase "$(INTDIR)\groveoa.res" -@erase "$(INTDIR)\StdAfx.obj" -@erase "$(OUTDIR)\groveoa.exp" -@erase "$(OUTDIR)\groveoa.lib" -@erase "$(OUTDIR)\regsvr32.trg" -@erase ".\bin\groveoa.dll" -@erase ".\groveoa\groveoa.h" -@erase ".\groveoa\groveoa.tlb" -@erase ".\groveoa\groveoa_i.c" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /YX /c CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /YX\ /Fo"$(INTDIR)/" /c CPP_OBJS=.\groveoa\Release/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 MTL_PROJ=/nologo /D "NDEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" RSC_PROJ=/l 0x809 /fo"$(INTDIR)/groveoa.res" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/groveoa.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"bin/groveoa.dll" LINK32_FLAGS=lib\Release\sp133.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll\ /incremental:no /pdb:"$(OUTDIR)/groveoa.pdb" /machine:I386\ /def:".\groveoa\groveoa.def" /out:"bin/groveoa.dll"\ /implib:"$(OUTDIR)/groveoa.lib" DEF_FILE= \ ".\groveoa\groveoa.def" LINK32_OBJS= \ "$(INTDIR)\CGroveBuilder.obj" \ "$(INTDIR)\GroveNode.obj" \ "$(INTDIR)\groveoa.obj" \ "$(INTDIR)\groveoa.res" \ "$(INTDIR)\StdAfx.obj" \ ".\grove\Release\grove.lib" \ ".\spgrove\Release\spgrove.lib" ".\bin\groveoa.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << # Begin Custom Build OutDir=.\groveoa\Release TargetPath=.\bin\groveoa.dll InputPath=.\bin\groveoa.dll SOURCE=$(InputPath) "$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" regsvr32 /s /c "$(TargetPath)" echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" # End Custom Build !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "groveoa\Debug" # PROP BASE Intermediate_Dir "groveoa\Debug" # PROP BASE Target_Dir "groveoa" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "groveoa\Debug" # PROP Intermediate_Dir "groveoa\Debug" # PROP Target_Dir "groveoa" OUTDIR=.\groveoa\Debug INTDIR=.\groveoa\Debug ALL : "spgrove - Win32 Debug" "grove - Win32 Debug" ".\dbgbin\groveoa.dll" CLEAN : -@erase "$(INTDIR)\CGroveBuilder.obj" -@erase "$(INTDIR)\GroveNode.obj" -@erase "$(INTDIR)\groveoa.obj" -@erase "$(INTDIR)\groveoa.pch" -@erase "$(INTDIR)\groveoa.res" -@erase "$(INTDIR)\StdAfx.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\groveoa.exp" -@erase "$(OUTDIR)\groveoa.lib" -@erase "$(OUTDIR)\groveoa.pdb" -@erase ".\dbgbin\groveoa.dll" -@erase ".\dbgbin\groveoa.ilk" -@erase ".\groveoa\groveoa.h" -@erase ".\groveoa\groveoa.tlb" -@erase ".\groveoa\groveoa_i.c" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D GROVE_NAMESPACE=James_Clark_GROVE /YX /c CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove"\ /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /YX\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c CPP_OBJS=.\groveoa\Debug/ CPP_SBRS=.\. .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $< .c{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cpp{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< .cxx{$(CPP_SBRS)}.sbr: $(CPP) $(CPP_PROJ) $< MTL=mktyplib.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 MTL_PROJ=/nologo /D "_DEBUG" /win32 RSC=rc.exe # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" RSC_PROJ=/l 0x809 /fo"$(INTDIR)/groveoa.res" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo BSC32_FLAGS=/nologo /o"$(OUTDIR)/groveoa.bsc" BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"dbgbin\groveoa.dll" # SUBTRACT LINK32 /incremental:no LINK32_FLAGS=lib\Debug\sp133d.lib kernel32.lib user32.lib gdi32.lib\ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll\ /incremental:yes /pdb:"$(OUTDIR)/groveoa.pdb" /debug /machine:I386\ /def:".\groveoa\groveoa.def" /out:"dbgbin\groveoa.dll"\ /implib:"$(OUTDIR)/groveoa.lib" DEF_FILE= \ ".\groveoa\groveoa.def" LINK32_OBJS= \ "$(INTDIR)\CGroveBuilder.obj" \ "$(INTDIR)\GroveNode.obj" \ "$(INTDIR)\groveoa.obj" \ "$(INTDIR)\groveoa.res" \ "$(INTDIR)\StdAfx.obj" \ ".\grove\Debug\grove.lib" \ ".\spgrove\Debug\spgrove.lib" ".\dbgbin\groveoa.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF ################################################################################ # Begin Target # Name "grove - Win32 Release" # Name "grove - Win32 Debug" !IF "$(CFG)" == "grove - Win32 Release" !ELSEIF "$(CFG)" == "grove - Win32 Debug" !ENDIF ################################################################################ # Begin Source File SOURCE=.\grove\Node.cxx DEP_CPP_NODE_=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\config.h"\ ".\include\macros.h"\ "$(INTDIR)\Node.obj" : $(SOURCE) $(DEP_CPP_NODE_) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\grove\LocNode.cxx DEP_CPP_LOCNO=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\config.h"\ "$(INTDIR)\LocNode.obj" : $(SOURCE) $(DEP_CPP_LOCNO) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File # End Target ################################################################################ # Begin Target # Name "spgrove - Win32 Release" # Name "spgrove - Win32 Debug" !IF "$(CFG)" == "spgrove - Win32 Release" !ELSEIF "$(CFG)" == "spgrove - Win32 Debug" !ENDIF ################################################################################ # Begin Source File SOURCE=.\spgrove\GroveBuilder.cxx DEP_CPP_GROVE=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CodingSystem.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\grove_inst.cxx"\ ".\spgrove\GroveBuilder.h"\ ".\spgrove\SdNode.h"\ ".\spgrove\threads.h"\ "$(INTDIR)\GroveBuilder.obj" : $(SOURCE) $(DEP_CPP_GROVE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\spgrove\GroveApp.cxx DEP_CPP_GROVEA=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\spgrove\threads.h"\ "$(INTDIR)\GroveApp.obj" : $(SOURCE) $(DEP_CPP_GROVEA) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Project Dependency # Project_Dep_Name "grove" !IF "$(CFG)" == "spgrove - Win32 Release" "grove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Release" !ELSEIF "$(CFG)" == "spgrove - Win32 Debug" "grove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=.\spgrove\SdNode.cxx DEP_CPP_SDNOD=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Location.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveBuilder.h"\ ".\spgrove\SdNode.h"\ "$(INTDIR)\SdNode.obj" : $(SOURCE) $(DEP_CPP_SDNOD) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File # End Target ################################################################################ # Begin Target # Name "style - Win32 Release" # Name "style - Win32 Debug" !IF "$(CFG)" == "style - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" !ENDIF ################################################################################ # Begin Project Dependency # Project_Dep_Name "grove" !IF "$(CFG)" == "style - Win32 Release" "grove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" "grove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=.\style\stylelib.cxx DEP_CPP_STYLE=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yc"stylelib.h" BuildCmds= \ $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yc"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) \ "$(INTDIR)\stylelib.obj" : $(SOURCE) $(DEP_CPP_STYLE) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\style.pch" : $(SOURCE) $(DEP_CPP_STYLE) "$(INTDIR)" $(BuildCmds) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yc"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yc"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\stylelib.obj" : $(SOURCE) $(DEP_CPP_STYLE) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\stylelib.sbr" : $(SOURCE) $(DEP_CPP_STYLE) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\style.pch" : $(SOURCE) $(DEP_CPP_STYLE) "$(INTDIR)" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\StyleEngine.cxx DEP_CPP_STYLEE=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\StyleEngine.obj" : $(SOURCE) $(DEP_CPP_STYLEE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\StyleEngine.obj" : $(SOURCE) $(DEP_CPP_STYLEE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\StyleEngine.sbr" : $(SOURCE) $(DEP_CPP_STYLEE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Style.cxx DEP_CPP_STYLE_=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\Style.obj" : $(SOURCE) $(DEP_CPP_STYLE_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Style.obj" : $(SOURCE) $(DEP_CPP_STYLE_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\Style.sbr" : $(SOURCE) $(DEP_CPP_STYLE_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\ProcessingMode.cxx DEP_CPP_PROCE=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\ProcessingMode.obj" : $(SOURCE) $(DEP_CPP_PROCE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\ProcessingMode.obj" : $(SOURCE) $(DEP_CPP_PROCE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\ProcessingMode.sbr" : $(SOURCE) $(DEP_CPP_PROCE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\ProcessContext.cxx DEP_CPP_PROCES=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\ProcessContext.obj" : $(SOURCE) $(DEP_CPP_PROCES) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\ProcessContext.obj" : $(SOURCE) $(DEP_CPP_PROCES) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\ProcessContext.sbr" : $(SOURCE) $(DEP_CPP_PROCES) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\primitive.cxx DEP_CPP_PRIMI=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\primitive.h"\ ".\style\primitive_inst.cxx"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\primitive.obj" : $(SOURCE) $(DEP_CPP_PRIMI) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\primitive.obj" : $(SOURCE) $(DEP_CPP_PRIMI) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\primitive.sbr" : $(SOURCE) $(DEP_CPP_PRIMI) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\NumberCache.cxx DEP_CPP_NUMBE=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\NumberCache.obj" : $(SOURCE) $(DEP_CPP_NUMBE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\NumberCache.obj" : $(SOURCE) $(DEP_CPP_NUMBE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\NumberCache.sbr" : $(SOURCE) $(DEP_CPP_NUMBE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\InterpreterMessages.cxx DEP_CPP_INTER=\ ".\include\Boolean.h"\ ".\include\config.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Location.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\TypeId.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ ".\style\InterpreterMessages.h"\ !IF "$(CFG)" == "style - Win32 Release" # SUBTRACT CPP /YX "$(INTDIR)\InterpreterMessages.obj" : $(SOURCE) $(DEP_CPP_INTER) "$(INTDIR)" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fo"$(INTDIR)/" /c $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # SUBTRACT CPP /YX BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\InterpreterMessages.obj" : $(SOURCE) $(DEP_CPP_INTER) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\InterpreterMessages.sbr" : $(SOURCE) $(DEP_CPP_INTER) "$(INTDIR)" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Interpreter.cxx DEP_CPP_INTERP=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\charNames.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\sdata.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\Interpreter.obj" : $(SOURCE) $(DEP_CPP_INTERP) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Interpreter.obj" : $(SOURCE) $(DEP_CPP_INTERP) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\Interpreter.sbr" : $(SOURCE) $(DEP_CPP_INTERP) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Insn.cxx DEP_CPP_INSN_=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\Insn.obj" : $(SOURCE) $(DEP_CPP_INSN_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Insn.obj" : $(SOURCE) $(DEP_CPP_INSN_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\Insn.sbr" : $(SOURCE) $(DEP_CPP_INSN_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\FOTBuilder.cxx DEP_CPP_FOTBU=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\FOTBuilder.obj" : $(SOURCE) $(DEP_CPP_FOTBU) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\FOTBuilder.obj" : $(SOURCE) $(DEP_CPP_FOTBU) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\FOTBuilder.sbr" : $(SOURCE) $(DEP_CPP_FOTBU) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Expression.cxx DEP_CPP_EXPRE=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\Expression.obj" : $(SOURCE) $(DEP_CPP_EXPRE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Expression.obj" : $(SOURCE) $(DEP_CPP_EXPRE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\Expression.sbr" : $(SOURCE) $(DEP_CPP_EXPRE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\ELObjMessageArg.cxx DEP_CPP_ELOBJ=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\ELObjMessageArg.obj" : $(SOURCE) $(DEP_CPP_ELOBJ) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\ELObjMessageArg.obj" : $(SOURCE) $(DEP_CPP_ELOBJ) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\ELObjMessageArg.sbr" : $(SOURCE) $(DEP_CPP_ELOBJ) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\ELObj.cxx DEP_CPP_ELOBJ_=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\ELObj.obj" : $(SOURCE) $(DEP_CPP_ELOBJ_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\ELObj.obj" : $(SOURCE) $(DEP_CPP_ELOBJ_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\ELObj.sbr" : $(SOURCE) $(DEP_CPP_ELOBJ_) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\DssslSpecEventHandler.cxx DEP_CPP_DSSSL=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\InternalInputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\DssslSpecEventHandler.obj" : $(SOURCE) $(DEP_CPP_DSSSL) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\DssslSpecEventHandler.obj" : $(SOURCE) $(DEP_CPP_DSSSL) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\DssslSpecEventHandler.sbr" : $(SOURCE) $(DEP_CPP_DSSSL) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Collector.cxx DEP_CPP_COLLE=\ ".\include\Boolean.h"\ ".\include\config.h"\ ".\include\macros.h"\ ".\style\Collector.h"\ !IF "$(CFG)" == "style - Win32 Release" # SUBTRACT CPP /YX "$(INTDIR)\Collector.obj" : $(SOURCE) $(DEP_CPP_COLLE) "$(INTDIR)" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fo"$(INTDIR)/" /c $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # SUBTRACT CPP /YX BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Collector.obj" : $(SOURCE) $(DEP_CPP_COLLE) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\Collector.sbr" : $(SOURCE) $(DEP_CPP_COLLE) "$(INTDIR)" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\FlowObj.cxx DEP_CPP_FLOWO=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FlowObj_inst.cxx"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\FlowObj.obj" : $(SOURCE) $(DEP_CPP_FLOWO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\FlowObj.obj" : $(SOURCE) $(DEP_CPP_FLOWO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\FlowObj.sbr" : $(SOURCE) $(DEP_CPP_FLOWO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\InheritedC.cxx DEP_CPP_INHER=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\InheritedC.obj" : $(SOURCE) $(DEP_CPP_INHER) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\InheritedC.obj" : $(SOURCE) $(DEP_CPP_INHER) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\InheritedC.sbr" : $(SOURCE) $(DEP_CPP_INHER) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\style_inst.cxx DEP_CPP_STYLE_I=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\style_inst.obj" : $(SOURCE) $(DEP_CPP_STYLE_I) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\style_inst.obj" : $(SOURCE) $(DEP_CPP_STYLE_I) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\style_inst.sbr" : $(SOURCE) $(DEP_CPP_STYLE_I) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\common_inst.cxx DEP_CPP_COMMO=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\common_inst.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\common_inst.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\common_inst.sbr" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\InterpreterMessages.msg !IF "$(CFG)" == "style - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "style - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\style_inst.m4 !IF "$(CFG)" == "style - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\FlowObj_inst.m4 !IF "$(CFG)" == "style - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\common_inst.m4 !IF "$(CFG)" == "style - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\GroveManager.cxx DEP_CPP_GROVEM=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\GroveManager.obj" : $(SOURCE) $(DEP_CPP_GROVEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\GroveManager.obj" : $(SOURCE) $(DEP_CPP_GROVEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\GroveManager.sbr" : $(SOURCE) $(DEP_CPP_GROVEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\DssslApp.cxx DEP_CPP_DSSSLA=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\sptchar.h"\ ".\include\StorageManager.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\spgrove\SdNode.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslAppMessages.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\jade_version.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\DssslApp.obj" : $(SOURCE) $(DEP_CPP_DSSSLA) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\DssslApp.obj" : $(SOURCE) $(DEP_CPP_DSSSLA) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\DssslApp.sbr" : $(SOURCE) $(DEP_CPP_DSSSLA) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Project Dependency # Project_Dep_Name "spgrove" !IF "$(CFG)" == "style - Win32 Release" "spgrove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" "spgrove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=.\style\jade_version.h !IF "$(CFG)" == "style - Win32 Release" !ELSEIF "$(CFG)" == "style - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\Pattern.cxx DEP_CPP_PATTE=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\Pattern.obj" : $(SOURCE) $(DEP_CPP_PATTE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\Pattern.obj" : $(SOURCE) $(DEP_CPP_PATTE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\Pattern.sbr" : $(SOURCE) $(DEP_CPP_PATTE) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\MacroFlowObj.cxx DEP_CPP_MACRO=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\MacroFlowObj.obj" : $(SOURCE) $(DEP_CPP_MACRO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\MacroFlowObj.obj" : $(SOURCE) $(DEP_CPP_MACRO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\MacroFlowObj.sbr" : $(SOURCE) $(DEP_CPP_MACRO) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\style\SchemeParser.cxx DEP_CPP_SCHEM=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\ArcEngine.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\Collector.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\DssslSpecEventHandler.h"\ ".\style\ELObj.h"\ ".\style\ELObjMessageArg.h"\ ".\style\EvalContext.h"\ ".\style\Expression.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ ".\style\Insn.h"\ ".\style\Insn2.h"\ ".\style\Interpreter.h"\ ".\style\InterpreterMessages.h"\ ".\style\MacroFlowObj.h"\ ".\style\NumberCache.h"\ ".\style\Pattern.h"\ ".\style\ProcessContext.h"\ ".\style\ProcessingMode.h"\ ".\style\SchemeParser.h"\ ".\style\SosofoObj.h"\ ".\style\Style.h"\ ".\style\style_pch.h"\ ".\style\StyleEngine.h"\ ".\style\stylelib.h"\ ".\style\VM.h"\ !IF "$(CFG)" == "style - Win32 Release" # ADD CPP /Yu"stylelib.h" "$(INTDIR)\SchemeParser.obj" : $(SOURCE) $(DEP_CPP_SCHEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(CPP) /nologo /MD /W3 /GX /O2 /I "spgrove" /I "grove" /I "include" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h" /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "style - Win32 Debug" # ADD CPP /Yu"stylelib.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "spgrove" /I "grove" /I "include" /D\ "_DEBUG" /D "WIN32" /D "_WINDOWS" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D\ SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /FR"$(INTDIR)/" /Fp"$(INTDIR)/style.pch" /Yu"stylelib.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\SchemeParser.obj" : $(SOURCE) $(DEP_CPP_SCHEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) "$(INTDIR)\SchemeParser.sbr" : $(SOURCE) $(DEP_CPP_SCHEM) "$(INTDIR)"\ "$(INTDIR)\style.pch" $(BuildCmds) !ENDIF # End Source File # End Target ################################################################################ # Begin Target # Name "jade - Win32 Release" # Name "jade - Win32 Debug" !IF "$(CFG)" == "jade - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" !ENDIF ################################################################################ # Begin Source File SOURCE=.\jade\SgmlFOTBuilder.cxx DEP_CPP_SGMLF=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CodingSystem.h"\ ".\include\config.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\ExternalId.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\macros.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ ".\jade\SgmlFOTBuilder.h"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ "$(INTDIR)\SgmlFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_SGMLF) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\RtfFOTBuilder.cxx DEP_CPP_RTFFO=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetInfo.h"\ ".\include\CharsetRegistry.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityManager.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\InputSource.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\macros.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\OutputByteStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StorageManager.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\jade\RtfFOTBuilder.h"\ ".\jade\RtfFOTBuilder_inst.cxx"\ ".\jade\RtfMessages.h"\ ".\jade\RtfOle.h"\ ".\jade\TmpOutputByteStream.h"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ "$(INTDIR)\RtfFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_RTFFO) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\jade.cxx DEP_CPP_JADE_=\ ".\grove\Node.h"\ ".\include\Allocator.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityApp.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrnoMessageArg.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\macros.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserApp.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\sptchar.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\jade\HtmlFOTBuilder.h"\ ".\jade\JadeMessages.h"\ ".\jade\MifFOTBuilder.h"\ ".\jade\RtfFOTBuilder.h"\ ".\jade\SgmlFOTBuilder.h"\ ".\jade\TeXFOTBuilder.h"\ ".\jade\TransformFOTBuilder.h"\ ".\spgrove\GroveApp.h"\ ".\spgrove\GroveBuilder.h"\ ".\style\dsssl_ns.h"\ ".\style\DssslApp.h"\ ".\style\FOTBuilder.h"\ ".\style\GroveManager.h"\ !IF "$(CFG)" == "jade - Win32 Release" # ADD CPP /D "JADE_MIF" "$(INTDIR)\jade.obj" : $(SOURCE) $(DEP_CPP_JADE_) "$(INTDIR)" $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "style" /I "grove" /I\ "spgrove" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /D "JADE_MIF" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "jade - Win32 Debug" # ADD CPP /D "JADE_MIF" "$(INTDIR)\jade.obj" : $(SOURCE) $(DEP_CPP_JADE_) "$(INTDIR)" $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "include" /I "style" /I "grove" /I\ "spgrove" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /D "JADE_MIF" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\HtmlFOTBuilder.cxx DEP_CPP_HTMLF=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\ErrnoMessageArg.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\IListIter.h"\ ".\include\IListIterBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\macros.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ ".\jade\HtmlFOTBuilder.h"\ ".\jade\HtmlFOTBuilder_inst.cxx"\ ".\jade\HtmlMessages.h"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ "$(INTDIR)\HtmlFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_HTMLF) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\HtmlFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\jade.rc DEP_RSC_JADE_R=\ ".\jade\HtmlMessages.rc"\ ".\jade\JadeMessages.rc"\ ".\jade\RtfMessages.rc"\ ".\jade\TeXMessages.rc"\ ".\style\DssslAppMessages.rc"\ ".\style\InterpreterMessages.rc"\ !IF "$(CFG)" == "jade - Win32 Release" # ADD BASE RSC /l 0x809 /i "jade" # ADD RSC /l 0x809 /i "jade" /i "style" /d "JADE_MIF" "$(INTDIR)\jade.res" : $(SOURCE) $(DEP_RSC_JADE_R) "$(INTDIR)" $(RSC) /l 0x809 /fo"$(INTDIR)/jade.res" /i "jade" /i "style" /d "NDEBUG" /d\ "JADE_MIF" $(SOURCE) !ELSEIF "$(CFG)" == "jade - Win32 Debug" # ADD BASE RSC /l 0x809 /i "jade" # ADD RSC /l 0x809 /i "jade" /i "style" /d "JADE_MIF" "$(INTDIR)\jade.res" : $(SOURCE) $(DEP_RSC_JADE_R) "$(INTDIR)" $(RSC) /l 0x809 /fo"$(INTDIR)/jade.res" /i "jade" /i "style" /d "_DEBUG" /d\ "JADE_MIF" $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\JadeMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\HtmlMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\RtfFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\TeXFOTBuilder.cxx DEP_CPP_TEXFO=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\config.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\ExternalId.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\OutputByteStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ ".\jade\TeXFOTBuilder.h"\ ".\jade\TeXFOTBuilder_inst.cxx"\ ".\jade\TeXMessages.h"\ ".\jade\TmpOutputByteStream.h"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ "$(INTDIR)\TeXFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_TEXFO) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Project Dependency # Project_Dep_Name "grove" !IF "$(CFG)" == "jade - Win32 Release" "grove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" "grove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Project Dependency # Project_Dep_Name "spgrove" !IF "$(CFG)" == "jade - Win32 Release" "spgrove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" "spgrove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=.\jade\RtfMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\TransformFOTBuilder.cxx DEP_CPP_TRANS=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\ErrnoMessageArg.h"\ ".\include\ExternalId.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ ".\jade\TransformFOTBuilder.h"\ ".\jade\TransformFOTBuilder_inst.cxx"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ "$(INTDIR)\TransformFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_TRANS) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Source File SOURCE=.\dsssl\fot.dtd !IF "$(CFG)" == "jade - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\TransformFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\RtfOle.cxx DEP_CPP_RTFOL=\ ".\include\Boolean.h"\ ".\include\config.h"\ ".\include\OutputByteStream.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\jade\RtfOle.h"\ ".\style\dsssl_ns.h"\ "$(INTDIR)\RtfOle.obj" : $(SOURCE) $(DEP_CPP_RTFOL) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) # End Source File ################################################################################ # Begin Project Dependency # Project_Dep_Name "style" !IF "$(CFG)" == "jade - Win32 Release" "style - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="style - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" "style - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="style - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=.\jade\MifFOTBuilder.cxx DEP_CPP_MIFFO=\ ".\grove\Node.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetInfo.h"\ ".\include\CmdLineApp.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityManager.h"\ ".\include\ErrnoMessageArg.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\IList.h"\ ".\include\IListBase.h"\ ".\include\InputSource.h"\ ".\include\IQueue.cxx"\ ".\include\IQueue.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageReporter.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StorageManager.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\jade\MifFOTBuilder.h"\ ".\jade\MifFOTBuilder_inst.cxx"\ ".\jade\MifMessages.h"\ ".\jade\TmpOutputByteStream.h"\ ".\style\dsssl_ns.h"\ ".\style\FOTBuilder.h"\ !IF "$(CFG)" == "jade - Win32 Release" # ADD CPP /D "JADE_MIF" "$(INTDIR)\MifFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_MIFFO) "$(INTDIR)" $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "style" /I "grove" /I\ "spgrove" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /D "JADE_MIF" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/" /c\ $(SOURCE) !ELSEIF "$(CFG)" == "jade - Win32 Debug" # ADD CPP /D "JADE_MIF" "$(INTDIR)\MifFOTBuilder.obj" : $(SOURCE) $(DEP_CPP_MIFFO) "$(INTDIR)" $(CPP) /nologo /MDd /W3 /GX /Zi /Od /I "include" /I "style" /I "grove" /I\ "spgrove" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D SP_NAMESPACE=James_Clark_SP\ /D DSSSL_NAMESPACE=James_Clark_DSSSL /D GROVE_NAMESPACE=James_Clark_GROVE /D\ "SP_MULTI_BYTE" /D "JADE_MIF" /Fp"$(INTDIR)/jade.pch" /YX /Fo"$(INTDIR)/"\ /Fd"$(INTDIR)/" /c $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\MifFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\jade\TeXFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" !ELSEIF "$(CFG)" == "jade - Win32 Debug" !ENDIF # End Source File # End Target ################################################################################ # Begin Target # Name "jadedist - Win32 Release" !IF "$(CFG)" == "jadedist - Win32 Release" ".\jadedist\jade.zip" : CD jadedist makedist !ENDIF ################################################################################ # Begin Project Dependency # Project_Dep_Name "jade" !IF "$(CFG)" == "jadedist - Win32 Release" "jade - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="jade - Win32 Release" !ENDIF # End Project Dependency ################################################################################ # Begin Source File SOURCE=".\jadedist\bin-files.txt" # End Source File ################################################################################ # Begin Source File SOURCE=.\jadedist\files.txt # End Source File ################################################################################ # Begin Source File SOURCE=.\jadedist\makedist.bat # End Source File # End Target ################################################################################ # Begin Target # Name "groveoa - Win32 Release" # Name "groveoa - Win32 Debug" !IF "$(CFG)" == "groveoa - Win32 Release" !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" !ENDIF ################################################################################ # Begin Source File SOURCE=.\groveoa\GroveNode.cxx DEP_CPP_GROVEN=\ ".\grove\LocNode.h"\ ".\grove\Node.h"\ ".\groveoa\GroveNode.h"\ ".\groveoa\groveoa.h"\ ".\groveoa\StdAfx.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetInfo.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityManager.h"\ ".\include\ExtendEntityManager.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Location.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\OutputByteStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\StorageManager.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\xnew.h"\ !IF "$(CFG)" == "groveoa - Win32 Release" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\GroveNode.obj" : $(SOURCE) $(DEP_CPP_GROVEN) "$(INTDIR)"\ "$(INTDIR)\groveoa.pch" ".\groveoa\groveoa.h" $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /c $(SOURCE) !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\GroveNode.obj" : $(SOURCE) $(DEP_CPP_GROVEN) "$(INTDIR)"\ ".\groveoa\groveoa.h" "$(INTDIR)\groveoa.pch" $(CPP) /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove"\ /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\groveoa.cxx DEP_CPP_GROVEO=\ ".\groveoa\CGroveBuilder.h"\ ".\groveoa\groveoa.h"\ ".\groveoa\groveoa_i.c"\ ".\groveoa\StdAfx.h"\ ".\include\Allocator.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\WinApp.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ !IF "$(CFG)" == "groveoa - Win32 Release" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\groveoa.obj" : $(SOURCE) $(DEP_CPP_GROVEO) "$(INTDIR)"\ "$(INTDIR)\groveoa.pch" ".\groveoa\groveoa.h" ".\groveoa\groveoa_i.c" $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /c $(SOURCE) !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\groveoa.obj" : $(SOURCE) $(DEP_CPP_GROVEO) "$(INTDIR)"\ ".\groveoa\groveoa.h" ".\groveoa\groveoa_i.c" "$(INTDIR)\groveoa.pch" $(CPP) /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove"\ /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\groveoa.rc DEP_RSC_GROVEOA=\ ".\groveoa\GroveBuilder.rgs"\ ".\groveoa\groveoa.tlb"\ !IF "$(CFG)" == "groveoa - Win32 Release" "$(INTDIR)\groveoa.res" : $(SOURCE) $(DEP_RSC_GROVEOA) "$(INTDIR)"\ ".\groveoa\groveoa.tlb" $(RSC) /l 0x809 /fo"$(INTDIR)/groveoa.res" /i "groveoa" /d "NDEBUG"\ $(SOURCE) !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" "$(INTDIR)\groveoa.res" : $(SOURCE) $(DEP_RSC_GROVEOA) "$(INTDIR)"\ ".\groveoa\groveoa.tlb" $(RSC) /l 0x809 /fo"$(INTDIR)/groveoa.res" /i "groveoa" /d "_DEBUG"\ $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\StdAfx.cxx DEP_CPP_STDAF=\ ".\groveoa\StdAfx.h"\ !IF "$(CFG)" == "groveoa - Win32 Release" # ADD CPP /Yc"stdafx.h" BuildCmds= \ $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yc"stdafx.h"\ /Fo"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\groveoa.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" $(BuildCmds) !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # ADD CPP /Yc"stdafx.h" BuildCmds= \ $(CPP) /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove"\ /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yc"stdafx.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ "$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" $(BuildCmds) "$(INTDIR)\groveoa.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" $(BuildCmds) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\CGroveBuilder.cxx DEP_CPP_CGROV=\ ".\grove\Node.h"\ ".\groveoa\CGroveBuilder.h"\ ".\groveoa\GroveNode.h"\ ".\groveoa\groveoa.h"\ ".\groveoa\StdAfx.h"\ ".\include\Allocator.h"\ ".\include\Attribute.h"\ ".\include\Attributed.h"\ ".\include\Boolean.h"\ ".\include\CharMap.cxx"\ ".\include\CharMap.h"\ ".\include\CharsetDecl.h"\ ".\include\CharsetInfo.h"\ ".\include\CodingSystem.h"\ ".\include\CodingSystemKit.h"\ ".\include\config.h"\ ".\include\constant.h"\ ".\include\ContentToken.h"\ ".\include\CopyOwner.cxx"\ ".\include\CopyOwner.h"\ ".\include\Dtd.h"\ ".\include\ElementType.h"\ ".\include\Entity.h"\ ".\include\EntityCatalog.h"\ ".\include\EntityDecl.h"\ ".\include\EntityManager.h"\ ".\include\ErrorCountEventHandler.h"\ ".\include\Event.h"\ ".\include\EventsWanted.h"\ ".\include\ExternalId.h"\ ".\include\Hash.h"\ ".\include\HashTable.cxx"\ ".\include\HashTable.h"\ ".\include\HashTableItemBase.cxx"\ ".\include\HashTableItemBase.h"\ ".\include\ISet.cxx"\ ".\include\ISet.h"\ ".\include\Link.h"\ ".\include\Location.h"\ ".\include\Lpd.h"\ ".\include\Markup.h"\ ".\include\Message.h"\ ".\include\MessageArg.h"\ ".\include\MessageBuilder.h"\ ".\include\MessageFormatter.h"\ ".\include\MessageTable.h"\ ".\include\Mode.h"\ ".\include\Named.h"\ ".\include\NamedResource.h"\ ".\include\NamedResourceTable.h"\ ".\include\NamedTable.h"\ ".\include\NCVector.h"\ ".\include\Notation.h"\ ".\include\OutputByteStream.h"\ ".\include\OutputCharStream.h"\ ".\include\Owner.cxx"\ ".\include\Owner.h"\ ".\include\OwnerTable.cxx"\ ".\include\OwnerTable.h"\ ".\include\ParserOptions.h"\ ".\include\PointerTable.cxx"\ ".\include\PointerTable.h"\ ".\include\Ptr.cxx"\ ".\include\Ptr.h"\ ".\include\RangeMap.cxx"\ ".\include\RangeMap.h"\ ".\include\Resource.h"\ ".\include\rtti.h"\ ".\include\Sd.h"\ ".\include\SdText.h"\ ".\include\SgmlParser.h"\ ".\include\ShortReferenceMap.h"\ ".\include\sptchar.h"\ ".\include\StringC.h"\ ".\include\StringOf.cxx"\ ".\include\StringOf.h"\ ".\include\StringResource.h"\ ".\include\SubstTable.cxx"\ ".\include\SubstTable.h"\ ".\include\Syntax.h"\ ".\include\Text.h"\ ".\include\TypeId.h"\ ".\include\UnivCharsetDesc.h"\ ".\include\Vector.cxx"\ ".\include\Vector.h"\ ".\include\WinApp.h"\ ".\include\XcharMap.cxx"\ ".\include\XcharMap.h"\ ".\include\xnew.h"\ ".\spgrove\GroveBuilder.h"\ !IF "$(CFG)" == "groveoa - Win32 Release" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\CGroveBuilder.obj" : $(SOURCE) $(DEP_CPP_CGROV) "$(INTDIR)"\ "$(INTDIR)\groveoa.pch" ".\groveoa\groveoa.h" $(CPP) /nologo /MD /W3 /GX /O2 /I "include" /I "grove" /I "spgrove" /D\ "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /c $(SOURCE) !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # ADD CPP /Yu"stdafx.h" "$(INTDIR)\CGroveBuilder.obj" : $(SOURCE) $(DEP_CPP_CGROV) "$(INTDIR)"\ ".\groveoa\groveoa.h" "$(INTDIR)\groveoa.pch" $(CPP) /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "grove" /I "spgrove"\ /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D\ "_WINDLL" /D SP_NAMESPACE=James_Clark_SP /D "SP_MULTI_BYTE" /D\ GROVE_NAMESPACE=James_Clark_GROVE /Fp"$(INTDIR)/groveoa.pch" /Yu"stdafx.h"\ /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\groveoa.def !IF "$(CFG)" == "groveoa - Win32 Release" !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" !ENDIF # End Source File ################################################################################ # Begin Source File SOURCE=.\groveoa\groveoa.idl !IF "$(CFG)" == "groveoa - Win32 Release" # Begin Custom Build InputDir=".\groveoa" InputPath=.\groveoa\groveoa.idl BuildCmds= \ midl /Oicf /h $(InputDir)\groveoa.h /iid $(InputDir)\groveoa_i.c /proxy\ $(InputDir)\groveoa_p.c /tlb $(InputDir)\groveoa.tlb $(InputPath) \ "$(InputDir)\groveoa.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "$(InputDir)\groveoa.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "$(InputDir)\groveoa_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" # Begin Custom Build InputDir=".\groveoa" InputPath=.\groveoa\groveoa.idl BuildCmds= \ midl /Oicf /h $(InputDir)\groveoa.h /iid $(InputDir)\groveoa_i.c /proxy\ $(InputDir)\groveoa_p.c /tlb $(InputDir)\groveoa.tlb $(InputPath) \ "$(InputDir)\groveoa.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "$(InputDir)\groveoa.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "$(InputDir)\groveoa_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ENDIF # End Source File ################################################################################ # Begin Project Dependency # Project_Dep_Name "grove" !IF "$(CFG)" == "groveoa - Win32 Release" "grove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Release" !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" "grove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="grove - Win32 Debug" !ENDIF # End Project Dependency ################################################################################ # Begin Project Dependency # Project_Dep_Name "spgrove" !IF "$(CFG)" == "groveoa - Win32 Release" "spgrove - Win32 Release" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Release" !ELSEIF "$(CFG)" == "groveoa - Win32 Debug" "spgrove - Win32 Debug" : $(MAKE) /$(MAKEFLAGS) /F ".\jade.mak" CFG="spgrove - Win32 Debug" !ENDIF # End Project Dependency # End Target # End Project ################################################################################ OpenJade-1.4devel/jade-generate.mak0000644000021000000240000000150707016270563012721 # This is a Makefile for nmake that makes all the .cxx and .h files that # are automatically generated. It's too painful to do in the IDE. # You'll need perl in your PATH to use this. PERL=perl GENSRCS=\ style\style_inst.cxx \ style\FlowObj_inst.cxx \ style\primitive_inst.cxx \ style\common_inst.cxx \ spgrove\grove_inst.cxx \ jade\HtmlFOTBuilder_inst.cxx \ jade\RtfFOTBuilder_inst.cxx \ jade\TeXFOTBuilder_inst.cxx \ jade\MifFOTBuilder_inst.cxx \ jade\TransformFOTBuilder_inst.cxx \ jade\JadeMessages.h \ jade\HtmlMessages.h \ jade\RtfMessages.h \ jade\TeXMessages.h \ jade\MifMessages.h \ style\DssslAppMessages.h \ style\InterpreterMessages.h .SUFFIXES: .m4 .msg all: $(GENSRCS) .m4.cxx: del /f $@ 2> nul $(PERL) lib\instmac.pl $< >$@ attrib +r $@ .msg.h: del /f $@ 2> nul $(PERL) -w msggen.pl -l xModule $< attrib +r $@ OpenJade-1.4devel/all/0000755000021000000240000000000007021010043010336 5OpenJade-1.4devel/all/CVS/0000755000021000000240000000000007021010043010771 5OpenJade-1.4devel/all/CVS/Root0000644000021000000240000000006607054313170011576 clasen@cvs.openjade.sourceforge.net:/cvsroot/openjade OpenJade-1.4devel/all/CVS/Repository0000644000021000000240000000001107021010043013003 jade/all OpenJade-1.4devel/all/CVS/Entries0000644000021000000240000000000207021010043012235 D OpenJade-1.4devel/OpenJade-1.4devel.spec0000644000021000000240000000522007070405301013377 # Copyright (C) 2000 Matthias Clasen # See the file COPYING for copying permissions. Summary: OpenJade group's DSSSL engine Name: OpenJade Version: 1.4devel Release: 1 BuildRoot: /tmp/OpenJade-1.4devel-buildroot Copyright: Copyright 1997 James Clark Group: Applications/Text Source: http://download.sourceforge.net/openjade/OpenJade-1.4devel.tar.gz URL: http://openjade.sourceforge.net Vendor: The OpenJade team Packager: Matthias Clasen Requires: OpenJade-lib %description OpenJade is an implementation of the DSSSL style language. The OpenJade engine is a useful tool (in conjunction with a DSSSL style sheet) for translating SGML documents into other formats. OpenJade can currently generate SGML, HTML, RTF, MIF and TeX. In conjunction with the "jadetex" TeX style, it can generate quite nice output. %package lib Summary: Runtime libraries for OpenJade group's DSSSL engine Group: System Environment/Libraries Requires: OpenSP-lib %description lib This is the OpenJade shared library runtime support. These C++ libraries contain the actual DSSSL engine, an abstract C++ interface to groves and an implementation of this interface on top of OpenSP. %package devel Summary: Libraries and include files for developing DSSSL applications. Group: Development/Libraries Requires: OpenSP-devel %description devel This contains include files and libraries for OpenJade. These C++ libraries contain the actual DSSSL engine, an abstract C++ interface to groves and an implementation of this interface on top of OpenSP. %prep # check that rpm is new enough to know internal macros like %{_prefix} rpmversion=`rpm -q --queryformat '%{RPMVERSION}' rpm | cut -d. -f1` [ ${rpmversion} -lt 3 ] && { echo "please update rpm" exit 1 ; } # unpack source .tar.gz package %setup %build # configure build system according to rpm settings ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --libexecdir=%{_libexecdir} --datadir=%{_datadir} --sysconfdir=%{_sysconfdir} --sharedstatedir=%{_sharedstatedir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --includedir=%{_includedir} --oldincludedir=%{_oldincludedir} --infodir=%{_infodir} --mandir=%{_mandir} # compile and link make CFLAGS="${RPM_OPT_FLAGS}" %install # install all files make "DESTDIR=${RPM_BUILD_ROOT}" install %clean test "$RPM_BUILD_ROOT" = "/" || rm -rf "$RPM_BUILD_ROOT" %files %defattr(-, root, root) %{_bindir}/* %{_datadir}/OpenJade/* %doc /usr/doc/OpenJade/* %files lib %defattr(-, root, root) %{_libdir}/*.so.* %files devel %defattr(-, root, root) %{_libdir}/lib*.{so,a,la} %{_includedir}/OpenJade/* OpenJade-1.4devel/jadedoc/0000777000021000000240000000000007070410036011175 5OpenJade-1.4devel/jadedoc/Makefile.in0000644000021000000240000002335207070410035013162 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ SUBDIRS = images docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = autoconf.htm contributors.htm copying.txt dsssl2.htm index.htm mif.htm rtf.htm tex.htm transform.htm xmlfo.htm EXTRA_DIST = autoconf.htm contributors.htm copying.txt dsssl2.htm index.htm mif.htm rtf.htm tex.htm transform.htm xmlfo.htm mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = DATA = $(pkgdoc_DATA) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps jadedoc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p; \ fi; fi; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) list='$(pkgdoc_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgdocdir)/$$p; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = jadedoc distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-pkgdocDATA install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-pkgdocDATA uninstall: uninstall-recursive all-am: Makefile $(DATA) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-recursive maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive .PHONY: uninstall-pkgdocDATA install-pkgdocDATA install-data-recursive \ uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/jadedoc/Makefile.am0000644000021000000240000000060507013365661013160 ## Process this file with automake to produce Makefile.in SUBDIRS = images docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = autoconf.htm contributors.htm copying.txt dsssl2.htm \ index.htm mif.htm rtf.htm tex.htm transform.htm xmlfo.htm EXTRA_DIST = autoconf.htm contributors.htm copying.txt dsssl2.htm \ index.htm mif.htm rtf.htm tex.htm transform.htm xmlfo.htm OpenJade-1.4devel/jadedoc/autoconf.htm0000644000021000000240000000577507057732415013474 OpenJade autoconf support

OpenJade autoconf support

We have dropped the old jade Makefiles in favour of the GNU configuration tools automake, autoconf and libtool. If building OpenJade doesn't work out of the box on your system, we'd like to receive feedback and patches for your operating system.

Usage

% ./configure; make; make install

configure options

--help
Print a full list of options. This document only deals with the non-standard options.
--enable-threads
Run the grove builder in a separate thread.
--disable-mif
Don't build the MIF backend.
--disable-html
Don't build the HTML backend.

Local defines

If you have some extra additions to OpenJade, you can set CFLAGS/CXXFLAGS and/or LDFLAGS/LIBS at configure time:

CXXFLAGS=-Dmyhacks LDFLAGS=-L/opt/myhacks LIBS=-lmyhacks ./configure

Check the invocation of ld in Makefile.comm for the exact semantics of LDFLAGS and LIBS.

Tested platforms

  • RedHat Linux 5.2 (egcs 1.0.3, glibc 2.0.7)
  • RedHat Linux 6.0 (gcc 2.95.1, glibc 2.1.1)
  • SuSE Linux 5.3 (gcc 2.7.2.1, libc 5.5.46)
  • Solaris 2.6 (gcc 2.8.1)
  • Digital Unix 4.0/Alpha (gcc-2.95, gcc-2.95.1 and gcc-2.95.2 don't work)

Shared library support

By default, ./configure attempts to build shared libraries and link against them. This is done via the libtool utility, a utility that knows how to build shared libraries on a number of platforms.

By default, only shared libraries are built. If you have difficulties building shared libraries, or you want to build static versions, you can use the --{enable,disable}{shared,static} options to configure libtool to your likings.

According to the libtool 1.2 docs, shared libraries work on:

  • AIX 3.x (*-*-aix3*)
  • AIX 4.x (*-*-aix4*)
  • AmigaOS (*-*-amigaos*)
  • Digital/UNIX 3.x, 4.x, a.k.a. OSF/1 (*-*-osf3*, *-*-osf4*)
  • FreeBSD 2.x, 3.x (*-*-freebsd2*, *-*-freebsd3*)
  • GNU/Linux ELF (*-*-linux-gnu*, except aout, coff, and oldld)
  • HP-UX 9.x, 10.x (*-*-hpux9*, *-*-hpux10*) [see note]
  • IRIX 5.x, 6.x (*-*-irix5*, *-*-irix6*)
  • NetBSD 1.x (*-*-netbsd*)
  • OpenBSD 2.x (*-*-openbsd*)
  • OS/2 using EMX (*-*-os2*)
  • SCO OpenServer 5.x (*-*-sco3.2v5*)
  • Solaris 2.x (*-*-solaris2*)
  • SunOS 4.x, a.k.a. Solaris 1.x (*-*-sunos4*)
  • UnixWare 2.x (*-*-sysv4.2uw2*)
  • UTS 4.x (*-*-uts4*)
  • All ELF targets that use both the GNU C compiler (gcc) and GNU ld

One more note from the libtool documentation: the HP/UX sed seems to be badly broken, install GNU sed before attempting to build - libtool depends on a working sed.

OpenJade-1.4devel/jadedoc/contributors.htm0000644000021000000240000001230307035730357014373 OpenJade Contributors

OpenJade

Contributors

James Clark:
The father of Jade. James made the first version called Jade. He was instrumental to the idea of a single set of flow objects and multiple backend formats. James carried the Jade project for several years until it became a group project and got renamed OpenJade. He is no longer participating to the OpenJade project but his spirit still and will always remain with us. He created most of the Openjade code and the SGML/XML and the RTF backends. But it is shorter to tell what he didn't do than what he did :-)
Matthias Clasen:
I am an old-time LaTeX user and a scheme lover. My first jade hacking experience was trying to use dsssl to produce properly formatted indexes, realizing the need for language-dependent string sorting. That code is now part of OpenJade. Since I think that the full power of DSSSL can only be explored with a reasonably complete implementation, I am working to fill the gaps in jade's coverage of the standard.
Avi Kivity:
I stumbled on Jade after attempts to format SGML documents using C++ proved too cumbersome. I was impressed by the power of DSSSL and the functional programming style, which I hadn't used before. My main interest is fully-integrated backends; that is, formatters which do the layout themselves and do not depend on external layout engines like TeX or Word. I also maintain the CVS repository and perform builds and releases.
Didier PH Martin:
I encountered Jade simply by browsing to find new ways to process XML/SGML documents. I had to learn it without a book and with minimal documentation. The more I know about this environment the more I learn to appreciate it. This is why, I am a fervant advocate of DSSSL, OpenJade and work hard to provide to members of the OpenJade community, a rich environment, an adequate documentation, a future to this language.

After more than 20 years in the computer business, I still enjoy creating and learning. As a canadian member of the ISO Document Description and Processing Languages comittee, my goal is to make a DSSSL-2 possible reality.

Peter Nilsson:
The man behind braifo.
Sebastian Ratz:
You have a question about Tex? Sebastian is the right guy to answer to your question. He created the Tex backend processor with David and Kathleen.
Kathleen Marszalek:
She is the bee, working hard and methodical. She created the Tex and MIF backends with other members of the team.
Paul Prescod:
Paul has always a good comment to bring to the table. He created the MIF backend with Kathleen.
David Megginson:
An other fellow canadian that is bringing every day to the XML community ideas, new code, its commitment. He created the Tex backend with Kathleen and Sebastian.
Cees de Groot:
Cees wrote the initial autoconf support for jade.

 

OpenJade-1.4devel/jadedoc/copying.txt0000644000021000000240000000243506765305124013341 Copyright (c) 1994, 1995, 1996 James Clark Copyright (c) 1999 The OpenJade group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL JAMES CLARK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of James Clark shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from James Clark. OpenJade-1.4devel/jadedoc/dsssl2.htm0000644000021000000240000006202006765756324013064 Experimental DSSSL extensions for XSL

OpenJade

Experimental DSSSL extensions

Contents

Introduction

This document descibes some experimental extensions to DSSSL that are implemented in OpenJade. These are designed so that, with these extensions, DSSSL provides a superset of the semantics XSL for flow object tree construction. OpenJade has a -2 option that enables these extensions.

These extensions do not include the additional flow object classes and characteristics that will be needed for XSL; in particular they do not include the HTML/CSS flow object classes.

UpBack to top 

Imperative programming

The following features come from R4RS:

  • assignment (set!) expressions (with restrictions)
  • vectors (with restrictions)
  • call-with-current-continuation (with restrictions)
  • begin expressions
  • multiple expressions in procedure bodies, cond clauses
  • alternate in if expression optional
  • it is not an error when nothing matches in cond or case expression
  • eqv? and memv procedures; these behave as specified in R4RS for vectors but behave the same as equal? for strings and lists

    This is so that case expressions can use eqv? as required by R4RS without breaking compatibility with existing DSSSL code which assumes case expressions with strings and lists will use equal?. R4RS specifies that eqv? should return #t when its arguments "should normally be regarded as the same object". R4RS treats strings and lists as mutable and its specification of eqv? for strings and lists is consistent with this. So long as DSSSL keeps strings and lists as immutable data-types with value semantics, it is more consistent to define eqv? to behave like equal? for them.

The use of side-effects is restricted. Assignment to top-level variables is not allowed. There is also the concept that a memory location can be read-only. When a memory location is read-only, it is an error to change that location. An memory location can be recursively marked as read-only; this means that the memory location along with all memory locations reachable from that memory location become read-only. A memory location is recursively marked as read-only when:

  • an object stored in that memory location is bound to a top-level variable
  • an expression specifying a characteristic is evaluated and a variable that names that memory location occurs free in that expression; for example, this would be an error:
    
    (let ((x 10pt))
      (make paragraph
        font-size: (begin (set! x 12pt) x)))
    
  • an object stored in that memory location is returned by a (inherited-C) or (actual-C) procedure
  • an object stored in that memory location is passed as the first argument to the node-list-map procedure

A continuation created with call-with-current-continuation cannot be called if it is read-only, and can only be used to return to a stack frame in the current call chain (sometimes referred to as upwards only).

There's a void data type with a single value which can be written as #v. This is returned by cond, case and if expressions which don't match.

UpBack to top 

Style rules

When a construction rule has a keyword argument list instead of a construct expression it is treated as a style rule. For example,


(element H1
  font-size: 14pt
  font-weight: 'bold)

The keyword argument list can include a use: keyword just as with style expressions. See the XSL proposal for the semantics of style rules.

UpBack to top 

Extended patterns

The syntax for element patterns is extended. These provide provide a superset of the semantics of XSL patterns. They are allowed both in element construction rules and in contexts where a match-element? pattern is currently allowed (eg select-elements, process-matching-children, process-first-descendant).

A pattern is either a single gi or a list. A list consists of a sequence of gis, where each gi can be followed by one or more keyword/value pairs (where the value is always a single datum). A gi can be #t, a string or a symbol. The following keywords are allowed:

id:
followed by a string or symbol
class:
followed by a string or symbol
repeat:
followed by one of the symbols *, +, ?
only:
followed by one of the symbols of-type, of-any
position:
followed by one of the symbols first-of-type, first-of-any, last-of-type, last-of-any
attributes:
followed by a list of name/value pairs; for backward compatibility with match-element? patterns in the current DSSSL standard the attributes: keyword can be omitted; #t and #f can be used as a value to test for presence or absence of attributes.
children:
followed by a pattern; each of the elements in the pattern must occur as child; repeat: is not allowed in children patterns; the children: qualifier is allowed on any gi in a pattern not just the last element
priority:
followed by an integer; multiple priority: qualifiers are allowed in a pattern and will be added together
importance:
followed by an integer; multiple importance: qualifiers are allowed and will be added together

Class attribute names are declared using


(declare-class-attribute "class")

or


(declare-class-attribute class)

Id attribute names can be declared similarily using declare-id-attribute.

Some examples:


(element (E importance: 42) ...)

(element (E attributes: (A1 V1)) ...)

(element (P E children: C) ...)

(element (P children: C priority: -11
          E children: C attributes: (A1 V1 A2 V2))
 ...)

(element (P E children: (A children: C B children: C)) ...)

The last is equivalent to the following in XSL syntax:


<element type="P">
  <target-element type="E">
     <element type="A">
       <element type="C"/>
     </element>
     <element type="B">
       <element type="C"/>
     </element>
  </target-element>
</element>
UpBack to top 

Multiple patterns per rule

An or-element construction rule has the syntax


(or-element (pattern+) expression)

where pattern is any pattern that could be allowed in an element construction rule. It is equivalent to a sequence of element construction rules.

For example,


(or-element (H1 H2 H3)
  font-weight: 'bold)

(or-element ((H1 TITLE) (H2 TITLE) (H3 TITLE))
  font-weight: 'bold)

is equivalent to


(element H1
  font-weight: 'bold)

(element H2
  font-weight: 'bold)

(element H3
  font-weight: 'bold)

(element (H1 TITLE)
  font-weight: 'bold)

(element (H2 TITLE)
  font-weight: 'bold)

(element (H3 TITLE)
  font-weight: 'bold)
UpBack to top 

Flow object macros

A flow object macro can be defined like this:

 

(declare-flow-object-macro list-item ((indent 1in) (marker "\bullet") #!contents contents)
  (make paragraph
       first-line-start-indent: (- indent)
       start-indent: (+ indent (inherited-start-indent))
       (make line-field
            field-width: indent
            (literal marker)
       )
  contents
  )
)

(root
    (make simple-page-sequence
        (make paragraph
              (literal "Para 1")
        )
        (make list-item
              (literal "Item 1")
              (make list-item
                    indent: .5in
                    marker: "\black-circle"
                    (literal "Sub item 1.1")
              )
        )
        (make list-item
              font-weight: 'bold
              (literal "Item 2")
              (make list-item
                    (literal "Sub item 2.1")
              )
         )
        (make paragraph
              (literal "Para 2")
        )
    )
)

If the formal argument list includes #!contents the flow object behaves like a compound flow object, otherwise like an atomic flow object. Inherited characteristics can be specified; these are applied to a sequence flow object which is automatically wrapped around what is returned by the body of the flow object macro. The preceding formal arguments are the non-inherited characteristics; like keyword arguments they can be specified either as id (in which case they default to #f), or as (id init-expression).

Note that flow object macros are quite different from ordinary procedures in that the macro body is not evaluated when the make expression is evaluated, but rather when the flow object is to be added to the tree; this allows (inherited-c) and (actual-c) procedures to be used in flow object macro characteristics, non-inherited as well as inherited, just as with normal flow objects. It is also possible to use (inherited-c) and (actual-c) procedures in the body of the flow object macro; they will return the same result as if they were used in the specification of a characteristic on the invocation of the flow object macro.

For an example of a library built with the macro facility read: Simple XML to HTML Conversion and Rendition Example

UpBack to top 

Characteristic value conversion

Most characteristic values can now be specified as strings and will be converted appropriately. For boolean valued characteristics any of the strings "true", "false", "yes" and "no" are acceptable.

UpBack to top 

Characteristic names

The question mark that can be omitted from those DSSSL characteristic names that end with a question mark. This is because the question mark is not (and cannot reasonably be made) a legal XML name character.

UpBack to top 

The char-map characteristic

The char-map inherited characteristic accept, in addition to #f and a procedure, the symbols uppercase, lowercase and capitalize. uppercase means to convert every character to upper case, lowercase means to convert every character to lower case and capitalize means that the first character in every word is converterd to upper case. The country: and language: characteristics will determine how the case conversion is done.

UpBack to top 

OpenJade-1.4devel/jadedoc/index.htm0000644000021000000240000012263607035730357012760 OpenJade

OpenJade  

 

OpenJade

Contents

What is OpenJade?

OpenJade is an implementation of the ISO/IEC 10179:1996 standard DSSSL language. It is based on the James Clark implementation of DSSSL named Jade. OpenJade is now developed and maintained by the OpenJade team. The current version is 1.4.

For general information about DSSSL, see the OpenJade home page. The OpenJade home page contains useful resources such as links to articles, tutorials, libraries, etc.

Another site with lots of in-depth information about DSSSL is that of Mulberry Technologies. Among other things, it hosts the DSSSL Users mailing list.

OpenJade is a command line application and a set of components. The DSSSL engine receives as input an SGML or XML document and transforms it into formats like:

  • XML representation of the flow object tree.
  • RTF format that can be rendered and printed with Microsoft's free Word Viewer 97
  • TeX format
  • MIF format that can be rendered and printed with Framemaker
  • SGML or XML format. This is used in conjunction with non-standard flow object classes to generate SGML, thus allowing OpenJade to be used for SGML/XML transformations.

UpBack to top 

Copyright

OpenJade is licensed with almost no restrictions even for commercial use (see license terms).

If you do use OpenJade in a commercial product, we ask you, as a courtesy, to acknowledge the use of OpenJade.

UpBack to top

Building OpenJade

Win32

Only Microsoft Visual C++ 6.0 is supported. Also, Perl 5 is required; the executable must be on your PATH.

To build on the command line, ensure that the directories containing msdev and nmake are in your path, typically by executing the command:

path C:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin;
    C:/Program Files/Microsoft Visual Studio/VC98/Bin;%path%

(all in one long line) then run the command:

build-win32.bat

To build using the Visual Studio GUI, open the workspace jade.dsw and build the Win32 Release configuration of the all project. You must first do a command-line build, however, to get the perl-generated files.

Unix

Use the autoconf support.

UpBack to top

Installing OpenJade

Win32

OpenJade requires the file dsssl/builtins.dsl to operate. You can tell OpenJade where this file is in one of two ways:

  • By including a SYSTEM catalog entry for "builtins.dsl" pointing to this file. See dsssl/catalog for an example.
  • By including the dsssl/catalog catalog with the -c command line option or the SGML_CATALOG_FILES environment variable.

Unix

Run

make install
as root.

UpBack to top

Using OpenJade

Add the directory containing the OpenJade binary to your path, change directory to the dsssl directory, and do


openjade demo.sgm

If everything is working, there should be a well-formed XML file demo.fot created.

The system identifier of the document to be processed is specified as an argument to OpenJade. If this is omitted, standard input will be read.

OpenJade determines the system identifier for the DSSSL specification as follows:

  1. If the -d option is specified, it will use the argument as the system identifier.
  2. Otherwise, it will look for processing instructions in the prolog of the document. Two kinds of processing instruction are recognized:
    <?stylesheet href="sysid" type="text/dsssl">
    The system data of the processing instruction is parsed like an SGML start-tag. It will be parsed using the reference concrete syntax whatever the actual concrete syntax of the document. The name that starts the processing instruction can be either stylesheet, xml-stylesheet or xml:stylesheet. The processing instruction will be ignored unless the value of the type attribute is one of text/dsssl, text/x-dsssl, application/dsssl, or application/x-dsssl. It is also ignored if the selected backend is not suitable for one of the media types listed as the value of the media attribute. OpenJade recognizes the media types "print" (FOT, RTF, TeX and MIF backends) and "screen" (FOT and HTML backends). See the HTML4.0 specification for a list of valid media types. The value of href attribute is the system identifier of the DSSSL specification. If there are multiple processing instructions in the prolog, OpenJade selects one according to the mechanism described in the HTML4.0 specification, taking the values of the alternate and title attributes into account.
    <?dsssl sysid>
    The system identifier is the portion of the system data of the processing instruction following the initial name and any whitespace.

    Although the processing instruction is only recognized in the prolog, it need not occur in the document entity. For example, it could occur in a DTD. The system identifier will be interpreted relative to where the the processing instruction occurs.

  3. Otherwise, it will use the system identifier of the document with any extension changed to .dsl.

A DSSSL specification document can contain more than one style-specification. If the system identifier of the DSSSL specification is followed by #id, then OpenJade will use the style-specification whose unique identifier is id. This is allowed both with the -d option and with the processing instructions.

The DSSSL specification must be an SGML document conforming to the DSSSL architecture. For an example, see dsssl/demo.dsl.

OpenJade supports the following options in addition to the normal SP options (note that all options are case-sensitive, ie -g and -G are different options):

-h, --help
Display a help message and exit.
-v, --version
Show the version number.
-d sysid, --specification=sysid
This specifies that sysid is the system identifier of the DSSSL specification to be used.
-T name, --spec-title=name
This specifies that name is the title of the processing instruction to be used in determining the applicable DSSSL specification.
-G, --debug
Debug mode. When an error occurs in the evaluation of an expression, OpenJade will display a stack trace. Note that this disables tail-call optimization.
-c sysid, --catalog=sysid
Use catalog sysid.
-C, --catalogs
The arguments specify catalog files rather than the document entity. The document entity is specified by the first DOCUMENT entry in the catalog files.
-s, --strict
Strict compliance mode. Currently the only effect is that jade doesn't use any predefined character names, sdata-entity mappings or name-characters. This is useful for checking that your stylesheet is portable to other DSSSL implementations and that it is strictly compliant to the DSSSL specifications.
-t type, --output-type=type
type specifies the type of output as follows:
fot
An XML representation of the flow object tree
rtf rtf-95
RTF (used for SGML/XML to RTF transformations)
Microsoft's Rich Text Format. rtf-95 produces output optimized for Word 95 rather than Word 97.
tex
TeX (used for SGML/XML to TeX transformations)
sgml sgml-raw
SGML (used for SGML/XML to SGML transformations). sgml-raw doesn't emit linebreaks in tags.
xml xml-raw
XML (used for SGML/XML to XML transformations). xml-raw doesn't emit linebreaks in tags.
html
HTML (used for SGML/XML to HTML transformations)
mif
MIF (used for SGML/XML to MIF transformations)
-o file, --output-file=file
Write output to file instead of the default. The default filename is the name of the last input file with its extension replaced by the name of the type of output. If there is no input filename, then the extension is added onto jade-out.
-V variable, --define=variable
This is equivalent to doing (define variable #t) except that this definition will take priority over any definition of variable in a style-sheet.
-V variable=value, --define=variable=value
This is equivalent to doing (define variable "value") except that this definition will take priority over any definition of variable in a style-sheet.
-V (define variable value), --define=(define variable value)
This is equivalent to doing (define variable value) except that this definition will take priority over any definition of variable in a style-sheet. Note that you will probably have to use some escaping mechanism for the spaces to get the entire scheme expression parsed as one cmdline argument.
-2
Enable experimental DSSSL extensions.
-w type, --warning=type (examples: wxml, wmixed, wsgmldecl, etc.)
Control warnings and errors. Multiple -w options are allowed. The following values of type enable warnings:
xml
Warn about constructs that are not allowed by XML.
mixed
Warn about mixed content models that do not allow #pcdata anywhere.
sgmldecl
Warn about various dubious constructions in the SGML declaration.
should
Warn about various recommendations made in ISO 8879 that the document does not comply with. (Recommendations are expressed with ``should'', as distinct from requirements which are usually expressed with ``shall''.)
default
Warn about defaulted references.
duplicate
Warn about duplicate entity declarations.
undefined
Warn about undefined elements: elements used in the DTD but not defined.
unclosed
Warn about unclosed start and end-tags.
empty
Warn about empty start and end-tags.
net
Warn about net-enabling start-tags and null end-tags.
min-tag
Warn about minimized start and end-tags. Equivalent to combination of unclosed, empty and net warnings.
unused-map
Warn about unused short reference maps: maps that are declared with a short reference mapping declaration but never used in a short reference use declaration in the DTD.
unused-param
Warn about parameter entities that are defined but not used in a DTD. Unused internal parameter entities whose text is INCLUDE or IGNORE won't get the warning.
notation-sysid
Warn about notations for which no system identifier could be generated.
all
Warn about conditions that should usually be avoided (in the opinion of the author). Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed.

A warning can be disabled by using its name prefixed with no-. Thus -wall -wno-duplicate will enable all warnings except those about duplicate entity declarations.

The following values for warning_type disable errors:

no-idref
Do not give an error for an ID reference value which no element has as its ID. The effect will be as if each attribute declared as an ID reference value had been declared as a name.
no-significant
Do not give an error when a character that is not a significant character in the reference concrete syntax occurs in a literal in the SGML declaration. This may be useful in conjunction with certain buggy test suites.
no-valid
Do not require the document to be type-valid. This has the effect of changing the SGML declaration to specify VALIDITY NOASSERT and IMPLYDEF ATTLIST YES ELEMENT YES. An option of -wvalid has the effect of changing the SGML declaration to specify VALIDITY TYPE and IMPLYDEF ATTLIST NO ELEMENT NO. If neither -wvalid nor -wno-valid are specified, then the VALIDITY and IMPLYDEF specified in the SGML declaration will be used.

The following options are the same as their unprefixed SP counterparts, but apply only to the SGML parser used for the document or stylesheet, respectively:

--doc-open-entities, --spec-open-entities
--doc-open-elements, --spec-open-elements
--doc-error-numbers, --spec-error-numbers
--doc-references, --spec-references
--doc-include, --spec-include
--doc-warning, --spec-warning

OpenJade ignores the SP_CHARSET_FIXED and SP_SYSTEM_CHARSET environment variables and always uses Unicode as its internal character set, as if SP_CHARSET_FIXED was 1 and SP_SYSTEM_CHARSET was unset. Thus only the SP_ENCODING environment variable is relevant to OpenJade's handling of character sets.

UpBack to top 

OpenJade Extensions

The following external procedures are available. These external procedures are defined by a prototype in the same manner as in the standard. To use one of these external procedures, you must make use of the standard external-procedure procedure, using a public identifier of "UNREGISTERED::James Clark//Procedure::name" where name is the name given here, typically by including the following in the DSSSL specification:


(define name
  (external-procedure "UNREGISTERED::James Clark//Procedure::name"))

Note that external-procedure returns #f if it doesn't know about the specified public identifier. You can use this to enable your DSSSL specifications to work gracefully with other implementations which do not support these extensions.

For external procedures added by the OpenJade team, use a public identifier of the form "UNREGISTERED::OpenJade//Procedure::name".

An easy way to get access to all external procedures is to use the style specification dsssl/extensions.dsl#procedures.

Debugging


(debug obj)

Generates a message including the value of obj and then returns obj.

Simple-page-sequence header/footer control


(if-first-page sosofo1 sosofo2)

This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is the first page of the simple-page-sequence and as sosofo2 otherwise.



(if-front-page sosofo1 sosofo2)

This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is a front (ie recto, odd-numbered) page and as sosofo2 if it is a back (ie verso, even-numbered) page.

Numbering


(all-element-number)
(all-element-number osnl)

This is the same as element-number except it counts elements with any generic identifier. If osnl is not an element returns #f, otherwise returns 1 plus the number of elements that started before osnl. This provides an efficient way of creating a unique identifier for any element in a document.

External entity access


(read-entity string)

This returns a string containing the contents of the external entity with system identifier string. This should be used only for textual entities (CDATA and SDATA), and not for binary entities (NDATA).

POSIX locale access


(language lang country)

This procedure returns an object of type language, if the system supports the specified language. lang is a string or symbol giving the two letter language code. country is a string or symbol giving the two letter country code.

This procedure uses POSIX locales. It is an OpenJade addition.

URI addresses


(uri-ref-addres uri)

This procedure returns an object of type address for the resource pointed to by the given URI.

Extended standard procedures


(sgml-parse sysid #!key active: parent: architecture:)

This allows you to specify an SGML architecture with respect to which the document should be parsed. It is an OpenJade addition.



(expt q k)

This allows you to raise a quantity to an integral power. It is an OpenJade addition.

UpBack to top 

Current OpenJade Limitations

This section describes the limitations of the front-end (the general-purpose DSSSL engine); each backend also has its own limitations.

OpenJade supports only a single, fixed grove plan which comprises the following modules:

  • baseabs
  • prlgabs0
  • prlgabs1
  • instabs
  • basesds0
  • instsds0
  • subdcabs

It doesn't implement the following parts of SDQL: HyTime support, auxiliary parsing, node regular expressions.

Query rules, sosofo synchronisation, indirect sosofos, reference values, decoration areas and font properties are not supported.

Note that only inherited characteristics that are applicable to some supported flow object can be specified.

Character/glyph handling

It only supports a single pre-defined character repertoire. A character name of the form U-XXXX where XXXX are four upper-case hexadecimal digits, is recognized as referring to the Unicode character with that code. For many characters, it is also possible to use the ISO/IEC 10646 name in lower-case with words separated by hyphens.

Some common SDATA entity names from the ISO entity sets are recognized and mapped to characters. In addition an SDATA entity name of the form U-XXXX, where XXXX are four upper-case hexadecimal digits, is mapped to the Unicode character with that code.

OpenJade now supports the standard-chars, map-sdata-entity, add-name-chars, add-separator-chars and char-repertoire declaration element forms, allowing a style-sheet to define additional character names, sdata entity mappings, name characters (i.e. characters allowed in identifiers) and separator characters. Currently the only recognized character repertoire is the built-in repertoire. It has the public identifier "UNREGISTERED::OpenJade//Character Repertoire::OpenJade".

Character properties are supported, but declare-char-characteristic+property is only partially supported.

Validation

Several things that it would be desirable to have checked aren't checked:

  • When the allowed value of an inherited characteristic is a symbol, OpenJade checks only that the value is a symbol that is allowed as the value of some characteristic; #t and #f are treated as a special kind of symbol in this case.
  • OpenJade checks whether a standard flow object is occurring in a context where it is allowed, however extension flow objects (declared with declare-flow-object-class) are not checked by the front-end.
  • Most type-checking is done at run-time not compile-time.
  • OpenJade does not check for non-inherited characteristics that are required to be specified.

Other limitations

The following primitives are just stubs:

char-script-case
Always returns last argument.
address-visited?
Always returns #f.

UpBack to top

About OpenJade sources

The source of OpenJade is available via CVS from peano.mathematik.uni-freiburg.de. See the OpenJade home page for more details.

UpBack to top


All trademarks herein are the property of their respective owners. 
Copyright ©  1999 OpenJade project, All rights reserved. Created by Didier PH Martin, modified: September 7, 1999

   

 

OpenJade-1.4devel/jadedoc/mif.htm0000644000021000000240000012376106765756324012437 The OpenJade MIF backend

OpenJade

 

The OpenJade MIF backend

Created by Kathleen Marszalek and Paul Prescod
Sponsored by ISOGEN International Corp.

Contents

Supported Flow Objects

character

Inherited characteristics Non-inherited characteristics
  • font-weight
  • font-posture
  • font-name
  • font-size
  • input-whitespace-treatment
  • position-point-shift
  • language
  • country
  • color

Up Back to top  

display-group
Inherited characteristics Non-inherited characteristics
 
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

rule
Inherited characteristics Non-inherited characteristics
  • line-cap
  • line-thickness
  • line-repeat
  • line-sep
  • position-point-shift
  • display-alignment (start, end, center)
  • start-indent
  • end-indent
  • span (spans all columns if > 1)
  • color
  • orientation (horizontal, escapement)
  • length
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

score
Inherited characteristics Non-inherited characteristics
  • line-repeat (1 for type of before and through, 1 or 2 for after)
  • type (before, through, after)

Up Back to top  

line-field*
Inherited characteristics Non-inherited characteristics
  • field-width
  • field-align
 
* At the beginning of paragraph only.

Up Back to top  

leader*
Inherited characteristics Non-inherited characteristics
   
*

On the last line of paragraph only. The principal port (the leader string itself) can contain characters only.

The content of the flow object is ignored: a dotted leader will always be used. The specified length is ignored: it always fills out the line.

Up Back to top  

link
Inherited characteristics Non-inherited characteristics
 
  • destination [#f, objects returned by (idref-address ...) and (current-node-address ...)]

Up Back to top  

index-entry
Inherited characteristics Non-inherited characteristics
 
  • components
  • page-number?
  • sort-string
  • starts-page-range?
  • ends-page-range?
components
is a list of strings that represent index entry levels. This characteristic is not inherited and shall be specified.
page-number?
is a boolean specifying whether this index entry should contain page number information. This characteristic is not inherited. The default is #t.
sort-string
is either #f, specifying that this index entry's components should be used for sorting the index, or a string that should be used for sorting. This characteristic is not inherited. The default is #f.
starts-page-range?
is a boolean specifying whether the index entry starts a page range. This characteristic is not inherited. The default is #f.
ends-page-range?
is a boolean specifying whether the index entry starts a page range. This characteristic is not inherited. The default is #f.
Here's how to enable the above extension:
(declare-flow-object-class index-entry
    "UNREGISTERED::ISOGEN//Flow Object Class::index-entry")
 

Up Back to top  

external-graphic
Inherited characteristics Non-inherited characteristics
  • space-before
  • space-after
  • display?
  • scale (max)
  • max-width
  • max-height
  • entity-system-id
  • display-alignment
  • start-indent
  • end-indent
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

paragraph
Inherited characteristics Non-inherited characteristics
  • lines (wrap, asis-wrap)
  • hyphenation-ladder-count
  • hyphenation-remain-char-count
  • hyphenation-push-char-count
  • font-weight
  • font-posture
  • font-name
  • font-size
  • quadding
  • widow-count
  • orphan-count
  • language
  • country
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?
  • line-spacing
  • min-leading (#f or 0 for proportional line spacing)
  • first-line-start-indent

Up Back to top  

paragraph-break
Inherited characteristics Non-inherited characteristics
Same as for paragraph Same as for paragraph

Up Back to top  

simple-page-sequence
Inherited characteristics Non-inherited characteristics
  • page-width
  • page-height
  • left-margin
  • right-margin
  • top-margin
  • bottom-margin
  • header-margin
  • footer-margin
  • left-header
  • center-header
  • right-header
  • left-footer
  • center-footer
  • right-footer
(page-number-sosofo)
(current-node-page-number-sosofo)
"UNREGISTERED::James Clark//Procedure::if-first-page"
This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is the first page of the simple-page-sequence and as sosofo2 otherwise.
"UNREGISTERED::James Clark//Procedure::if-front-page"
This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is a front (ie recto, odd-numbered) page and as sosofo2 if it is a back (i.e. verso, even-numbered) page.
"UNREGISTERED::James Clark//Characteristic::page-n-columns"
Value is a strictly positive integer, specifying the number of columns. The initial value is 1.
"UNREGISTERED::James Clark//Characteristic::page-column-sep"
Value is a length, specifying the separation between columns. The initial value is .5in.
"UNREGISTERED::James Clark//Characteristic::page-balance-columns?"
Value is a boolean. If true, the columns on the final page of the page-sequence should be balanced. The initial value is #f.
Here's how to enable the above extensions:
(define if-first-page (external-procedure
    "UNREGISTERED::James Clark//Procedure::if-first-page"))
(define if-front-page (external-procedure  
    "UNREGISTERED::James Clark//Procedure::if-front-page"))
(declare-characteristic page-n-columns
    "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1)
(declare-characteristic page-n-columns
    "UNREGISTERED::James Clark//Characteristic::page-column-gap" (* 36 1pt))
(declare-characteristic page-balance-columns?
    "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f)
 

Up Back to top  

table
Inherited characteristics Non-inherited characteristics
  • table-border
  • display-alignment
  • start-indent
  • end-indent
  • table-width
  • before-row-border
  • after-row-border
  • before-column-border
  • after-column-border
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

table-part
Inherited characteristics Non-inherited characteristics
 
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?
  • header
  • footer

Up Back to top  

table-column
Inherited characteristics Non-inherited characteristics
  • start-indent
  • end-indent
  • column-number
  • n-columns-spanned
  • width
  • (table-unit k)

Up Back to top  

table-cell
Inherited characteristics Non-inherited characteristics
  • cell-before-row-margin
  • cell-after-row-margin
  • cell-before-column-margin
  • cell-after-column-margin
  • cell-row-alignment
  • cell-before-row-border
  • cell-after-row-border
  • cell-before-column-border
  • cell-after-column-border
  • cell-background?
  • background-color
  • column-number
  • n-columns-spanned
  • n-rows-spanned
  • starts-row?
  • ends-row?

Up Back to top  

table-border
Inherited characteristics Non-inherited characteristics
  • border-present?
  • line-thickness
  • line-repeat (0, 1, or 2)
  • line-sep
  • color
 

Up Back to top  

Problems & Limitations

Table border resolution

It's not clear how to predictably enforce cell borders that have mixed line styles. I've posted a question about this to comp.text.frame, but there were no responses so far.

External graphic width and height

In order to place external graphics inside a text flow one must use an anchored frame containing the <ImportObject...> statement. The ImportObject within the frame can shrink-wrap the referenced graphics, however the anchored frame itself cannot - in general the size of an anchored frame has to be specified explicitly. I've asked about this in comp.text.frame, but the only solutions involved using external programs to read the graphic size from graphic files.

Space before non-paragraph displayed objects

Flow objects like external-graphic need to be anchored to empty paragraphs so that that frame can determine their position on the page automatically. Since the smallest paragraph height is 2pt (smallest font size that can be used), the total space before such objects should be larger than that. This does not apply to the paragraph flow objects themselves, and to the rule flow object. The rule flow object has the placement direction display size of 0 and it's possible to use negative PgfLeading to let the next paragraph move up if necessary.

The vertical positioning of the displayed rule flow object

Since the rule is position using inlined anchored frame, the placement is relative to the font baseline. It's assumed that the baseline is 1/3 the font size from the bottom.

The box flow object

Not sure how to implement it since anchored frames must have fixed height. Maybe using tables would work here(?)

Tips

Creating hypertext documents

You must decide on the filename extension you'll use at the stage when you run jade. If you don't want the .mif extension for your final document, feel free to use other extension when specifying the file name using the -o option.

  1. Open the book file.
  2. While holding SHIFT, select File->Open All Files in Book from the menu.
  3. Save each file using View Only format - make sure you use original filenames.

Updating page numbering

  1. Open the book file.
  2. While holding SHIFT, select File->Open All Files in Book from the menu.
  3. Select File->Generate/Update... and then press Update.

Specifying colors

OpenJade supports all color spaces specified in DSSSL. The following example uses the RGB color space to create a red rule:

(make rule
    color: (color (color-space "ISO/IEC 10179:1996//Color-Space Family::Device RGB")
                   1 0 0)
    ...
)
OpenJade-1.4devel/jadedoc/rtf.htm0000644000021000000240000012735006765756324012455 The OpenJade RTF backend

OpenJade

 

The OpenJade RTF backend

Created by James Clark

Contents

Supported Flow Objects

character

Inherited characteristics Non-inherited characteristics
  • font-weight
  • font-posture
  • font-name
  • font-size
  • input-whitespace-treatment
  • position-point-shift
  • language
  • country
  • color
 

Up Back to top  

display-group
Inherited characteristics Non-inherited characteristics
 
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

rule
Inherited characteristics Non-inherited characteristics
  • line-cap
  • line-thickness
  • line-repeat
  • line-sep
  • position-point-shift
  • display-alignment (start, end, center)
  • start-indent
  • end-indent
  • span (spans all columns if > 1)
  • color
  • orientation (horizontal, escapement)
  • length
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Only the horizontal orientation is supported. Rules only show up in Page Layout View

Up Back to top  

score
Inherited characteristics Non-inherited characteristics
  • line-repeat (1 for type of before and through, 1 or 2 for after)
  • type (before, through, after)

Up Back to top  

line-field*
Inherited characteristics Non-inherited characteristics
  • field-width
  • field-align
 
* At the beginning of paragraph only.

Up Back to top  

leader*
Inherited characteristics Non-inherited characteristics
   
* On the last line of paragraph only. The principal port (the leader string itself) can contain characters only.

The content of the flow object is ignored: a dotted leader will always be used. The specified length is ignored: it always fills out the line.

Up Back to top  

link
Inherited characteristics Non-inherited characteristics
 
  • destination [#f, objects returned by (idref-address ...) and (current-node-address ...)]
* Only destinations that are single elements in the same RTF output file.

Up Back to top  

index-entry
Inherited characteristics Non-inherited characteristics
 
  • components
  • page-number?
  • sort-string
  • starts-page-range?
  • ends-page-range?
components
is a list of strings that represent index entry levels. This characteristic is not inherited and shall be specified.
page-number?
is a boolean specifying whether this index entry should contain page number information. This characteristic is not inherited. The default is #t.
sort-string
is either #f, specifying that this index entry's components should be used for sorting the index, or a string that should be used for sorting. This characteristic is not inherited. The default is #f.
starts-page-range?
is a boolean specifying whether the index entry starts a page range. This characteristic is not inherited. The default is #f.
ends-page-range?
is a boolean specifying whether the index entry starts a page range. This characteristic is not inherited. The default is #f.
Only destinations that are single elements in the same RTF output file.

Up Back to top  

external-graphic
Inherited characteristics Non-inherited characteristics
  • space-before
  • space-after
  • display?
  • scale (max)
  • max-width
  • max-height
  • entity-system-id
  • display-alignment
  • start-indent
  • end-indent
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

On Windows platforms, this can be used to embed OLE objects, by making the the value of the notation-system-id: a formal system identifier whose storage manager is CLSID and whose storage object identifier is the COM CLSID (including surrounding braces). The system identifier may also be just <CLSID> (that is, the storage object identifier may be empty); in this case, the OLE default CLSID for the file (usually chosen based on the file's extension) will be used.

 

Up Back to top  

paragraph
Inherited characteristics Non-inherited characteristics
  • lines (wrap, asis-wrap)
  • hyphenation-ladder-count
  • hyphenation-remain-char-count
  • hyphenation-push-char-count
  • font-weight
  • font-posture
  • font-name
  • font-size
  • quadding
  • widow-count
  • orphan-count
  • language
  • country
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?
  • line-spacing
  • min-leading (#f or 0 for proportional line spacing)
  • first-line-start-indent

Up Back to top  

paragraph-break
Inherited characteristics Non-inherited characteristics
Same as for paragraph Same as for paragraph

Up Back to top  

simple-page-sequence
Inherited characteristics Non-inherited characteristics
  • page-width
  • page-height
  • left-margin
  • right-margin
  • top-margin
  • bottom-margin
  • header-margin
  • footer-margin
  • left-header
  • center-header
  • right-header
  • left-footer
  • center-footer
  • right-footer
(page-number-sosofo)
(current-node-page-number-sosofo)
"UNREGISTERED::James Clark//Procedure::if-first-page"
This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is the first page of the simple-page-sequence and as sosofo2 otherwise.
"UNREGISTERED::James Clark//Procedure::if-front-page"
This can be used only in the specification of the value of one of the header/footer characteristics of simple-page-sequence. It returns a sosofo that will display as sosofo1 if the page is a front (ie recto, odd-numbered) page and as sosofo2 if it is a back (i.e. verso, even-numbered) page.
"UNREGISTERED::James Clark//Characteristic::page-n-columns"
Value is a strictly positive integer, specifying the number of columns. The initial value is 1.
"UNREGISTERED::James Clark//Characteristic::page-column-sep"
Value is a length, specifying the separation between columns. The initial value is .5in.
"UNREGISTERED::James Clark//Characteristic::page-balance-columns?"
Value is a boolean. If true, the columns on the final page of the page-sequence should be balanced. The initial value is #f.
Here's how to enable the above extensions:
(define if-first-page (external-procedure
    "UNREGISTERED::James Clark//Procedure::if-first-page"))
(define if-front-page (external-procedure  
    "UNREGISTERED::James Clark//Procedure::if-front-page"))
(declare-characteristic page-n-columns
    "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1)
(declare-characteristic page-n-columns
    "UNREGISTERED::James Clark//Characteristic::page-column-gap" (* 36 1pt))
(declare-characteristic page-balance-columns?
    "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f)
 

Up Back to top  

table
Inherited characteristics Non-inherited characteristics
  • table-border
  • display-alignment
  • start-indent
  • end-indent
  • table-width
  • before-row-border
  • after-row-border
  • before-column-border
  • after-column-border
  • span (spans all columns if > 1)
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?

Up Back to top  

table-part
Inherited characteristics Non-inherited characteristics
 
  • space-before
  • space-after
  • keep-with-previous?
  • keep-with-next?
  • break-before (#f, page)
  • break-after (#f, page)
  • keep (#f, page)
  • may-violate-keep-before?
  • may-violate-keep-after?
  • header
  • footer

Up Back to top  

table-column
Inherited characteristics Non-inherited characteristics
  • start-indent
  • end-indent
  • column-number
  • n-columns-spanned
  • width
  • (table-unit k)

Up Back to top  

table-cell
Inherited characteristics Non-inherited characteristics
  • cell-before-row-margin
  • cell-after-row-margin
  • cell-before-column-margin
  • cell-after-column-margin
  • cell-row-alignment
  • cell-before-row-border
  • cell-after-row-border
  • cell-before-column-border
  • cell-after-column-border
  • cell-background?
  • background-color
  • column-number
  • n-columns-spanned
  • n-rows-spanned
  • starts-row?
  • ends-row?

Up Back to top  

table-border
Inherited characteristics Non-inherited characteristics
  • border-present?
  • line-thickness
  • line-repeat (0, 1, or 2)
  • line-sep
  • color
 

Up Back to top  

Many DSSSL characteristics cannot be implemented in RTF. The backend does the best it can.

In order to get correct page numbers in Microsoft Word, type the following after opening the document:

  1. CTRL+END
  2. CTRL+A
  3. F9

In Word Viewer 97, you must instead do:

  1. CTRL+END
  2. ALT
  3. V
  4. N
  5. ALT
  6. V
  7. P

Page numbers also get updated automatically when you print.

The RTF backend supports some additional characteristics. To use a characteristic named here as C, declare it using declare-characteristic with the public identifier:

"UNREGISTERED::James Clark//Characteristic::C"
heading-level
Value is an integer. It applies to paragraph flow objects. If the value is between 1 and 9, then the paragraph is output as a header of this level, otherwise it is output as body text. Using this characteristic allows Word to provide useful outline views and a document map. (Note that Word's handling of document maps for RTF documents is buggy: if you load an RTF document, and the previous document was using the Online Layout view, then RTF will attempt to guess what paragraphs are headings, which it will almost always do wrong. To avoid this, switch to the Normal view before loading an RTF document.) The initial value is 0
page-number-format
Value is a string as for format-number procedure. This controls the format of the number used by page-number-sosofo and current-page-number-sosofo for references to pages in the simple-page-sequence. The initial value is "1". It applies to simple-page-sequence flow objects.
page-number-restart?
Value is a boolean. If true, then for the purposes of page-number-sosofo and current-page-number-sosofo, the page numbers for this simple-page-sequence will restart from 1. The initial value is #f. It applies to simple-page-sequence flow objects.
page-n-columns
Value is a strictly positive integer, specifying the number of columns. The initial value is 1. It applies to simple-page-sequence flow objects.
page-column-sep
Value is a length, specifying the separation between columns. The initial value is .5in. It applies to simple-page-sequence flow objects.
page-balance-columns?
Value is a boolean. If true, the columns on the final page of the page-sequence should be balanced. The initial value is #f. It applies to simple-page-sequence flow objects.
superscript-height
Value is a length. Specifies the height of the baseline of a superscript above its parent's baseline. It applies to superscript and script flow objects.
subscript-depth
Value is a length. Specifies the depth of the baseline of a subscript below its parent's baseline. It applies to subscript and script flow objects.
over-mark-height
Value is a length. Specifies the height of the baseline of the contents of the over-mark area of a mark flow object above the baseline of the contents of the main area. It also controls the height of the contents of the mid-sup area of the script flow object. It applies to mark and script flow objects.
under-mark-depth
Value is a length. Specifies the depth of the baseline of the contents of the under-mark area of a mark flow object below the baseline of the contents of the main area. It also controls the depth of the contents of the mid-sub area of the script flow object. It applies to mark and script flow objects.
grid-row-sep
Value is a length. Specifies the separation between rows of a grid flow object.
grid-column-sep
Value is a length. Specifies the separation between columns of a grid flow object.
OpenJade-1.4devel/jadedoc/tex.htm0000644000021000000240000005635706765756324012472 The OpenJade TeX backend

OpenJade

The OpenJade TeX backend

Created by David Megginson, Sebastian Rahtz and Kathleen Marszalek
Sponsored by Novare International Corp.

Introduction

The TeX backend was initially written by David Megginson, but is now maintained by Sebastian Rahtz. In a development sponsored by Novare International (to whom many thanks!), Kathleen Marszalek drastically improved the table support.

The job of the backend is to map DSSSL flow-objects into generic TeX macro calls. Atomic flow objects appear as single \insertOBJECT{} macro calls, while non-atomic flow objects appear as nested pairs of \OBJECT{}..\endOBJECT{} macro calls.

The \insertOBJECT and \OBJECT calls receive a single argument, which is a list of definitions for inherited and non-inherited characteristics (see below). For example, the following DSSSL handler:


(element P
  (make paragraph
	start-indent: 6pt))

would generate the following TeX calls:


\startPar{\def\StartIndent{6pt}}%
CONTENTS
\endPar{}

It is important to note that any characters with values >255 will appear as \Character{value} macro calls ie.


\Character{1024}

In addition to nearly all of the flow-object classes currently supported by OpenJade, the TeX backend generates two pseudo flow-object macro calls:

  • \FOT{version}
  • \endFOT{}

These are guaranteed to appear at the very beginning and very end of the .tex output file, and give your macros a chance to grab control at both points. The argument to \FOT is the version of the TeX markup generated by the OpenJade backend (currently 2). Macro packages should check this for compatibility.

The output .tex file is not ready to be passed directly through TeX or LaTeX -- instead, it is necessary to have TeX macro definitions for all of the flow-object macros, and to set default values for the characteristics. The macros can use of TeX primitives, plain TeX, LaTeX, or any other format which is convenient.

A LaTeX macro package for use with the output of this backend has been developed by Sebastian Rahtz. The current stable release can be found on CTAN in macros/jadetex; experimental releases will be placed at http://www.tug.org/applications/jadetex/ at intervals.

Characteristics

The SETTINGS argument to the flow-object macros will contain a series of \def statements for both inherited and non-inherited characteristics. These will appear only when the characteristic's value differs from the standard default (in the case of non-inherited characteristics) or from the current value (in the case of inherited characteristics). Since these statements appear as an argument, they will not take effect until you reference the parameter explicitly.

Inherited Characteristics

The characteristics in the following table are inherited -- you should set these to their default values only once, at the beginning of the parse (but they should always revert to their previous values after a flow-object has finished):

Characteristic Default Value DSSSL Equivalent
\AsisWrapIndent 0 [#f]  
\BackgroundColor 0 [#f]  
\BackgroundLayer -1  
\BackgroundTile 0 [#f]  
\BorderAlignment center  
\BorderOmitAtBreak 0 [#f]  
\BorderPresent 1 [true]  
\BorderPriority 0  
\BottomMargin 0pt  
\BoxBorderAlignment outside  
\BoxCornerRadius 0pt [note]
\BoxOpenEnd 0 [#f]  
\BoxSizeAfter 4pt  
\BoxSizeBefore 8pt  
\BoxType border  
\CellAfterColumnMargin 0pt  
\CellAfterRowMargin 0pt  
\CellBackground 0 [#f]  
\CellBeforeColumnMargin 0pt  
\CellBeforeRowMargin 0pt  
\CellCrossed 0 [#f]  
\CellRowAlignment start  
\Color current gray  
\Country 0 [#f]  
\DisplayAlignment start  
\EndIndent 0pt  
\EndMargin 0pt  
\ExpandTabs 8  
\FieldAlign start  
\FieldWidth 0pt  
\FillingDirection top-to-bottom  
\FirstLineStartIndent 0pt  
\FloatOutLineNumbers 0 [#f]  
\FloatOutMarginalia 0 [#f]  
\FloatOutSidelines 0 [#f]  
\FontFamilyName iso-serif  
\FontName 0 [#f]  
\FontPosture upright  
\FontProportionateWidth medium  
\FontSize 10pt  
\FontStructure solid  
\FontWeight medium  
\FooterMargin 0pt  
\GlyphAlignmentMode font  
\GlyphReorderMethod ??  
\GlyphSubstMethod ??  
\HangingPunct 0 [#f]  
\HeaderMargin 0pt  
\Hyphenate ??  
\HyphenationKeep 0 [#f]  
\HyphenationLadderCount 0 [#f]  
\HyphenationMethod ??  
\HyphenationPushCharCount 2  
\HyphenationRemainCharCount 2  
\IgnoreRecordEnd 0 [#f]  
\ImplicitBidiMethod 0 [#f]  
\InhibitLineBreaks 0 [#f]  
\InputWhitespaceTreatment ??  
\JustifyGlyphSpaceMaxAdd 0pt  
\JustifyGlyphSpaceMaxRemove 0pt  
\Kern ??  
\KernMode ??  
\Language 0 [#f]  
\LastLineEndIndent 0pt  
\LastLineJustifyLimit 0pt  
\LastLineQuadding relative  
\Layer 0  
\LeftMargin 0pt  
\Ligature ??  
\LineBreakingMethod 0 [#f]  
\LineCap butt  
\LineCompositionMethod 0 [#f]  
\LineJoin miter  
\LineNumberSep ??  
\LineNumberSide ??  
\LineRepeat 1  
\LineSep 1pt  
\LineSpacing 12pt  
\LineThickness 1pt  
\Lines wrap  
\MarginaliaKeepWithPrevious 0 [#f]  
\MarginaliaSep 0pt  
\MarginaliaSide start  
\MathDisplayMode ??  
\MinLeaderRepeat 1  
\NColumnsSpanned 1  
\NRowsSpanned 1  
\NumberedLines 1 [true]  
\OrphanCount 2  
\PageHeight sysdep  
\PageWidth sysdep  
\PositionPointShift 0pt  
\PrincipalModeSimultaneous 0 [#f]  
\Quadding start  
\RightMargin 0pt  
\ScoreSpaces 1 [true]  
\SidelineSep required  
\SidelineSide required  
\Span 1  
\SpanWeak 0 [#f]  
\StartIndent 0pt  
\StartMargin 0pt  
\TableAutoWidthMethod 0 [#f]  
\TableCornerRadius 0pt [note]
\TablePartOmitMiddleFooter 0 [#f]  
\TablePartOmitMiddleHeader 0 [#f]  
\TopMargin 0pt  
\WidowCount 2  
\WritingMode left-to-right  

 

Notes

  1. \BoxCornerRadius combines the box-corner-rounded and box-corner-radius characteristics (its value is 0pt if box-corner-rounded is #f).
  2. \TableCornerRadius combines the table-corner-rounded and table-corner-radius characteristics (its value is 0pt if table-corner-rounded is #f).

Non-Inherited Characteristics

The characteristics in the following table are not inherited -- you should set these to their default values at the beginning of every relevant flow-object, before evaluating the SETTINGS argument:

Characteristic Default Value DSSSL Equivalent
\AlignLeader 1 [true]  
\BreakAfter 0 [#f]  
\BreakAfterPriority 0  
\BreakBefore 0 [#f]  
\BreakBeforePriority 0  
\Ch no default  
\CoalesceId 0 [#f]  
\ColumnIndex contextual column-number [??]
\EntitySystemId required  
\EscapementDirection   writing-mode
\GlyphId no default  
\IdrefAddress ??  
\IsDisplay 0 [#f]  
\IsDropAfterLineBreak unspecified  
\IsDropUnlessBeforeLineBreak unspecified  
\IsPunct unspecified  
\IsInputTab unspecified  
\IsInputWhiteSpace unspecified  
\IsRecordEnd unspecified  
\IsSpace unspecified  
\Keep 0 [#f]  
\KeepWithNext 0 [#f]  
\KeepWithPrevious 0 [#f]  
\Length context  
\MathClass unspecified  
\MathFontPosture unspecified  
\MaxHeight contextual  
\MaxWidth contextual  
\MayViolateKeepAfter 0 [#f]  
\MayViolateKeepBefore 0 [#f]  
\NotationSystemId required  
\Orientation required  
\PositionPointX ??  
\PositionPointY ??  
\PositionPreference 0 [#f] position-preference
\ScaleType maxuniform scale [note]
\ScaleX n/a scale [note]
\ScaleY n/a scale [note]
\ScoreLength ??  
\ScoreType required type
\Script unspecified  
\SpaceAfterConditional 0 [#f] space-after
\SpaceAfterForce 0 [#f] space-after
\SpaceAfterMax 0pt space-after
\SpaceAfterMaxFactor 0 space-after
\SpaceAfterMin 0pt space-after
\SpaceAfterMinFactor 0 space-after
\SpaceAfterNominal 0pt space-after
\SpaceAfterNominalFactor 0 space-after
\SpaceAfterPriority 0 space-after
\SpaceBeforeConditional 0 [#f] space-before
\SpaceBeforeForce 0 [#f] space-before
\SpaceBeforeMax 0pt space-before
\SpaceBeforeMaxFactor 0 space-before
\SpaceBeforeMin 0pt space-before
\SpaceBeforeMinFactor 0 space-before
\SpaceBeforeNominal 0pt space-before
\SpaceBeforeNominalFactor 0 space-before
\SpaceBeforePriority 0 space-before
\StretchFactor 0  
\TableWidth contextual  
\TruncateLeader 0 [#f]  
\Width required [note]

Notes

  1. ScaleType, ScaleX, and ScaleY are all the equivalent of the scale characteristic: if ScaleType is 0 [#f], then ScaleX and ScaleY become relevant.
  2. The Width characteristic is not required if table-auto-width feature is present.
Sebastian Rahtz, s.rahtz@elsevier.co.uk

 

 

 

 

 

 

 

 

 

 

 

 

 

OpenJade-1.4devel/jadedoc/transform.htm0000644000021000000240000002661106765756324013673 The OpenJade SGML/XML backend

OpenJade

The OpenJade SGML/XML backend

Created by James Clark

OpenJade does not support the DSSSL Transformation Language. However, it provides some simple, non-standardized extensions to the DSSSL Style Language that allow it to be used for SGML transformations.

These extensions are used in conjunction with the SGML backend which is selected with the -t sgml or -t xml options. Unlike other backends, the SGML backend writes its output to the standard output.

The -t xml option makes empty elements and processing instructions use the XML syntax. Note that the XML declaration is not automatically emitted.

The extensions consist of a collection of flow object classes that are used instead of the standard DSSSL-defined flow object classes:

element
empty-element
Each of these flow objects results in an element in the output. The element flow object is a compound flow object (one that can have child flow objects). Both a start-tag and an end-tag are generated for this flow object. The empty-element is an atomic flow object (one that cannot have child flow objects). Only a start-tag is output for this. It should should be used for elements with a declared content of EMPTY or with a content reference attribute. Both of these flow objects support the following non-inherited characteristics:
gi
This is a string-valued characteristic that specifies the element's generic identifier. It defaults to the generic identifier of the current node.
attributes
This specifies the element's attributes as a list of lists each of which consists of exactly two strings, the first specifying the attribute name and the second the attribute value. It defaults to the empty list.
 
processing-instruction
This is an atomic flow object that results in a processing instruction. It supports the following non-inherited characteristics:
data
This is a string-valued characteristic that specifies the content of the processing instruction. It defaults to the empty string.
document-type
This is an atomic flow object that results in a DOCTYPE declaration. It supports the following non-inherited characteristics:
name
This is a string-valued characteristic that specifies the name of the document type (which must be the same as the name of the document element). It must not be omitted.
system-id
This is a string-valued characteristic that specifies the system identifier of the document type. If non-empty, this will be used as the system identifier in the doctype declaration. The default value is the empty string.
public-id
This is a string-valued characteristic that specifies the public identifier of the document type. If non-empty, this will be used as the public identifier in the doctype declaration. The default value is the empty string.
entity
This is an compound flow object that stores its content in a separate entity. It supports the following non-inherited characteristic:
system-id
The system identifier of the entity. For now this is treated as a filename not as an FSI.

Note that no entity reference or declaration is emitted.

entity-ref
This is an atomic flow object that results in an entity reference. It supports the following non-inherited characteristic:
name
The name of the entity.
formatting-instruction
This is an atomic flow object that inserts characters into the output without change. It supports the following non-inherited characteristic:
data
This is the string to be inserted.

It differs from normal data characters in the &, < and > will not be escaped.

There is also the following characteristic:

preserve-sdata?
This is an inherited boolean characteristic that applies to character flow objects. When true, if the current-node for the character flow object was an sdata node, then the character will be output as a reference to an entity with the same name. The initial value is #f.

Each of these flow object classes must be declared using declare-flow-object-class in any DSSSL specification that makes use of it. A suitable set of declarations is:


(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")
(declare-flow-object-class empty-element
  "UNREGISTERED::James Clark//Flow Object Class::empty-element")
(declare-flow-object-class document-type
  "UNREGISTERED::James Clark//Flow Object Class::document-type")
(declare-flow-object-class processing-instruction
  "UNREGISTERED::James Clark//Flow Object Class::processing-instruction")
(declare-flow-object-class entity
  "UNREGISTERED::James Clark//Flow Object Class::entity")
(declare-flow-object-class entity-ref
  "UNREGISTERED::James Clark//Flow Object Class::entity-ref")
(declare-flow-object-class formatting-instruction
  "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")
(declare-characteristic preserve-sdata?
  "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
  #f)

Here's a simple example that does the identity transformation:


<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")

(define (copy-attributes #!optional (nd (current-node)))
  (let loop ((atts (named-node-list-names (attributes nd))))
    (if (null? atts)
        '()
        (let* ((name (car atts))
               (value (attribute-string name nd)))
          (if value
              (cons (list name value)
                    (loop (cdr atts)))
              (loop (cdr atts)))))))

(default (make element
               attributes: (copy-attributes)))

Note that this does not deal with empty elements nor processing instructions, nor does it include a doctype declaration.

 

OpenJade-1.4devel/jadedoc/xmlfo.htm0000644000021000000240000000255206765756324013003 The OpenJade FOT backend

OpenJade

 

The OpenJade FOT backend

Backend

Created by James Clark

This backend creates an XML representation of the flow object tree. The DTD for the XML generated is in dsssl/fot.dtd.

Characteristics declared with declare-characteristic are not reported.

Flow objects of classes declared with declare-flow-object are not reported.

OpenJade-1.4devel/jadedoc/images/0000777000021000000240000000000007070410042012437 5OpenJade-1.4devel/jadedoc/images/Makefile.in0000644000021000000240000001341607070410042014425 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ imagedir = $(pkgdocdir)/images EXTRA_DIST = background.gif dsssltitle.gif space.gif top-of-page.gif image_DATA = background.gif dsssltitle.gif space.gif top-of-page.gif mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = DATA = $(image_DATA) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps jadedoc/images/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-imageDATA: $(image_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(imagedir) @list='$(image_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(imagedir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(imagedir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(imagedir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(imagedir)/$$p; \ fi; fi; \ done uninstall-imageDATA: @$(NORMAL_UNINSTALL) list='$(image_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(imagedir)/$$p; \ done tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = jadedoc/images distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-imageDATA install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-imageDATA uninstall: uninstall-am all-am: Makefile $(DATA) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(imagedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: uninstall-imageDATA install-imageDATA tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/jadedoc/images/Makefile.am0000644000021000000240000000043507013365661014426 ## Process this file with automake to produce Makefile.in docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ imagedir = $(pkgdocdir)/images EXTRA_DIST = background.gif dsssltitle.gif space.gif top-of-page.gif image_DATA = background.gif dsssltitle.gif space.gif top-of-page.gif OpenJade-1.4devel/jadedoc/images/background.gif0000644000021000000240000000330306765305125015177 GIF87a° ÷h™Àáÿhhh™hÀháhÿh™h™™™À™á™ÿ™ÀhÀ™ÀÀÀáÀÿÀáhá™áÀáááÿáÿhÿ™ÿÀÿáÿÿÿhhh™hÀháhÿhhhhhh™hhÀhháhhÿhh™hh™h™™hÀ™há™hÿ™hÀhhÀh™ÀhÀÀháÀhÿÀháhháh™áhÀáhááhÿáhÿhhÿh™ÿhÀÿháÿhÿÿh™h™™™À™á™ÿ™h™hh™™h™Àh™áh™ÿh™™™h™™™™™À™™á™™ÿ™™À™hÀ™™À™ÀÀ™áÀ™ÿÀ™á™há™™á™Àá™áá™ÿá™ÿ™hÿ™™ÿ™Àÿ™áÿ™ÿÿ™ÀhÀ™ÀÀÀáÀÿÀhÀhhÀ™hÀÀhÀáhÀÿhÀ™Àh™À™™ÀÀ™Àá™Àÿ™ÀÀÀhÀÀ™ÀÀÀÀÀáÀÀÿÀÀáÀháÀ™áÀÀáÀááÀÿáÀÿÀhÿÀ™ÿÀÀÿÀáÿÀÿÿÀáhá™áÀáááÿáháhhá™háÀhááháÿhá™áh™á™™áÀ™áá™áÿ™áÀáhÀá™ÀáÀÀááÀáÿÀáááháá™ááÀáááááÿááÿáhÿá™ÿáÀÿááÿáÿÿáÿhÿ™ÿÀÿáÿÿÿhÿhhÿ™hÿÀhÿáhÿÿhÿ™ÿh™ÿ™™ÿÀ™ÿá™ÿÿ™ÿÀÿhÀÿ™ÀÿÀÀÿáÀÿÿÀÿáÿháÿ™áÿÀáÿááÿÿáÿÿÿhÿÿ™ÿÿÀÿÿáÿÿÿÿÿ!ù,° @ÿç èd ’‚ "LȰáA…#>l¸°¢Ä‰-JÔè#ÆŒ ç\I²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´èJV *]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÃB}¢”MYƒf²Y˜v ¥oÑž}ØIÝ»sÕblËW©¼rš\–-[¹HD]̸±ãÇ#KžL¹²å˘a"˹³çÏ C‹Mºtפ_Ô;µîB»M ªn÷#ë·™þ}Zjo„O2 N¼¸ñãÈ“+_ny3ň9F‡Žû9Hë×¥W¿Î]{wê §cÿ÷>‘ƒö ”¨Ð¢H*5Ê4iÓ¥@)V1ZP C¥V4U©“CW ¥H–@V€†®2(–'Y³×Ъ=ØVçÛ³iy®Øuh…mìº÷æÂ¶… ²‚¡g` ½y­)´¶31CV* Äêe œÏrì ­âN͹¨}íïGÖ­Q‹6 Ãõ5k°36Ì;a•<[òTùó;øðâ‰OŽüørçÆ•Go.ùóêЭO¿N½;÷çRa8ÿQAE…Ë YßɳԵ¼âÙË^}æ‡õå; TÞI|Ûâß|ˆ d…x©F…@9(ÐT[Y\;…6j‡ì$Ù„í$Ø{9•& ¹%™@”-" µe[+:­…™ &”f®5È–†Ò(aNÂàÞŒQ¦d;IXÞ‰S¹6•Š¥åàm«”– ú¸bi:¹¶˜5¶hå‘’yÍNô8å•–¢“dF"©B0D£XNCVÈ ¨a†%‡Wþèš‘aòUžŽ…¸¢@m1©‚kbqVP[¡v ¥—òØš™ƒ=ÚÛ§ .ÔO%úf—yµ…åQì¨*{?µÿzت±jºbO`†ªë®¼öêë¯À{ÓTþz“埃˜ÍwPyT 8P³ A+í´÷)dmš|íT^NÎ2TTìE.’  äþ5î¹ävöG»ðB©$}ª;/¤äþqÛ¹ïÕ‹¯°lðÁ'¬ð 7ìðÃG,ñÄWlñÅg¬ñÆwìñÇ ‡,òÈ$—lòÉ(§œðT±"kÐQž ô™OS¶˜ÛÌ;Õ<Ð*%âsX¹ÁדÎgåTh[šµ—17¹sg2ÊãŒ{éâœ×Ì,sÌ9÷ˆ5‘ m›Öu)!×@#•fêiPA5Ö#jQh¤“Ò²†©Ÿr—ÿÇb¦*œè¢g±éltýµØÏ×t½)Öps;c¡g}+X€øäƒ©¶ÆXîÉ x‘•mý÷Ì¥Å%ãÎnGÍ6X~†––Фemt”;Á5íf@ÚŽ¥Ÿy€dgÎ8Ùy Ê9ÞrÃTÅóÐG/ýôÔWoýõØg¯ýöÕS4;ªU:”V±>uk¹Q|úFÞSé«>PíH|ý¡­rBT”z¿J˜Q¡ûþô!Ñ@ ¡IÅ^iqÙLăm5< t !èŸ F«‚|à5Á Z°ƒü CèA¬I„e§ÒßËüó“p%DhŒc ‰6¢ØfT:q¡ Ïõ®¬ ,ÿ˜fŒØE.k´`áÏÀ*×®{ÁK6盛HŃ9åŠPÉâS¶ˆE.j±‹W´D¸r±*éY•®Å±J).tc¬àxõõ'>N±Œ5ÎEœ&^c^åBË••‘kÑ€—ñõ®¤‹gä Éår…î\áY7ÉÉNzò“  ¥(GIÊRšò”¨ÿL¥*WÉÊVºò•°Œ¥,g2îÙò–¸Ì¥.»7/2… UQ!A¬C¡äA…ÄÜâ1'SÌ¡,³SGQ+¶BM@B˜CK¸ ÃôxH"«à BG“ÍmDR¦ÉÖA±…`~$/ºë Ф‘mD+è¤%‰E?ʤ+,üf§Ø£¿ùM‰en3ˆA‚Ðð)´s¼+yhø%gé¡tŒ²Âóò)!èqjh¼Ôó:Ê‘ây‚YÅó¬àª÷@5V„V6j–U0­6áš™³N ®­<ÏJ‡PÛyv=^ÍŸÚt§H«@Ìç­å¤!e”GS‡Î@5*=`¸ ¨Va EÒhÿT£dh$¦3­Š«XÑÎ*°¢<.ôVnJÊT±Þˆ«ekQ—j84q¡1\ÕÝ!¢·•> ©»R0YÁ…*ÔH¯J}ϺÐÌ‚‚F¡Ð“M8YÊÕ0qu\?5¬…¢êU@¬õ³ÀüPR9ú0~ñµ¾tmla+Û¨LnDQà?½µ>¼±p‰‰œ]º‰á’‡¸ å ͤy;+­Íi2Ó +&÷¶leˆ ³ˆ‹x,¬òˆe[Ðh;³ô¡äeÊ ØÌ ÖÌË6™Úævyù*ôh ÕÉONð¨f2dÂh‰½ŒýÍeãô#¬¹)pÊ[œ³¢¡“.• Gmµƒ`PÞÌBmêl.BJÿj)±Ô©À¬ L£§–dDv"°±¶“à$Ày¸l㲕¢µ˜Xjd’’@`¤ÎN9¡¥R}^’|—:誆©SùÐu»¥ÙƲL2Dì¨4âÌê3%ßc¡nw+”™(n]HN”0‹ùËeæøPåû…Uãʉr#–*"XÚÌ©ªP7:VOÞ tLÔ‰¢·lÙºR‘q d)i”,Ó*iÿV´rñE£j+’ÓŽ0©ð‡éž+]n.Iáõ":ë\¡y+ïÅ@ò«\z§ºâ9¹Í<Èß¼ñç‚ã«yÊK>ò“gæ+¯yÌ{Þò›¿<è?ßùÑ›¾ô['3ͧÅ.e©À̓±K©<¼¬Êž.c†è¥É3ûÜ;¨/Ãջᴲ«Dð®ñ{Ú襮¸À+tw¾¼áˆ=Ò=‘ñ|½\øk@`<|Oþò[lüÃln(2Íu‚›¥ðy\Šÿþ™Ëþî‡?6e‘º†<¸^¡! ~TÃ~Ä._áDöGäÒgýbHí’€ôHæWx˜¸Øø ‚"8‚$X‚&x‚(˜‚*¸‚,ÿØ‚.ø‚0ƒ28ƒ4Xƒ6xƒ8˜ƒ:¸ƒ<؃‡1]qÂw«P D8]è×áÄUhõK¸R2OXMx†c„EH„0§\àu½‚÷W_åv%a|VâXhá…û‘rWÖp÷†n‡7q*>á7æ-$Lo+ná‡qÄvcˆ&ˆ+óCC†£ö([Ál*jhŒå2iaUêTRIˆ":A†¡&žXl%;1dufãáBGpöd#R¬@„ia [!†bÇ)žäÛŒÚ1ŒÙQŒØqŒÀHŒÈøÂhŒÍAOÀvåávJ>9ÿôb«ÂTlÁ@ØÈÚ8)ÜØ93~Ûæò£EQØFã!F»² ãQ*nR3ì…Ñ€Qdž'ÑýÇ~ÒcqQ¼ˆä±:{‰éƒ*avà".è>¬! l&q/S(I> Aa±‘áˆ9&,dr&PÁ_Á¦ùrÓvo%9±k¾C<9çÁi&9`1kq7Ïc6Ð!BR"êÑ%…Ò% ø!jbkc;ôvŠ—B3°±8Ö0 æ˜5]‚“™a[ a\qü33=–"ÇÒaiBQ3mš/v§Bù3?œ”¸å%’–U h{;Á®ÿÒˆŽ•{! â/'%1?¶s$­€4‹)lNc åRd)ig1ˤ`[óG'hÅ2/'?2ÆVNYnÏó- ‰6ŸáV)Ùbyp™fù\Zb˜„˜ ùY÷›ÀœÔ³u_æ…–{fŠtÊÉÑœ:1q?15 шšq &t`¥uLÆ(ãñs‚Ö9e)O L©v"óãf±8*´ lg?€ž?DtX2"šDFU–×H|¢~N#/Wl\iBŽ!]·q9€Ã;®a’8æX a¡ÞÇ ˆfjKr &) í h¼÷ U2\ Öÿca—lÑ¡j&æÕo › †™c[™ ‘i‹ ª%¤‰`cXc Üõ„%ð(@ð(¤®srbŸxæ(ª¢,ªp$”¥ ´¥#Ä¥Ô¥`ú¥b*BcZBZ¦Ä塆߳âÆOë1ŠÝBrr:§xT§ B>º·@Ú#ûfðԇႠDé€áã:Ö ›R3ìf:v²¤9W–¥18–#…"æ6ŠÑé'áR<žcjö !q× Ÿ¡Ãöù/gN«%,äB\a[;Ú¨ Z©Nã1Š™V&‚#n:a@ƒaŸc¢ÙE@ ø[IÕ¥8¦:cö³8kÿÑ–;3k1;qÀÕ)£y ³0¾#jo¢&ŽQùÔˆÑVö5¥@Šú ÜT#­F¬4P>9 á7•4Eá7^wœx,Jø¯9áuvÉu4d ¨‹Ö‡¡-¡s%ªÕªªDXIUB5†D“å&æ%U“hãñžøh%4 "¦ ›òXQù$¡áOëÂ;{Qn…Õh!‰v_â1Dû:c³m‡Ú;Ö'<3­ùy7Y¡Ⱥ"‘Ù]ÏBõs»ÖjÞ•-@£f&nrh9’êVª# <ƒmv9ž.¦>rDfò« â%ÈPÒ¥~!ö®gŒ¢¡µÿǬe qL ˜_€ÚY)Òh5%a] ƒ­‡+÷Ç4?Q?"Qy*4>ñ‘¹™¡f繬•(˜‹\êwº›D(H « I1 °«~! ®b-d†Öà*FÔR»k…¯;{‰‘‹ÇWC¹ ›8M°{bÍ{ ´‹vº8-°Ûý—•ýÈ3®Âº—"e¤IØÇ{¾½g¡I*šG¨K¼/ö¼ç«¼(Ré;LÇWHÔÀ{Mé!e°1 ë§‹I¨¢* eÔ»;Ó»©c‘ú:#Ôkè©¥p"'â&cBvðûr‡sÈÁ¬EÞsˆ÷—eå#/‰t§árqÂ[rTiÂi‡Ž3& æTÄXo¢„kEòSq‰R£.áDüFLÄÊÑGœÄIlÄÆaEüÄOŒÄ¿¡ÄSÌÄUìÄÂÅ¡,Tq án 4%fF$·´Ó‚¯‡ÆiŒÂãѯVÒë#ÄYÇv,Bk,ÅLgÃA±*Cè¢ a—5È?RÃ}zÇŒ\2ÂùȬu·%‡ÖBC¡…¼>ËeqxøÂaÓÂ?#š¨BÇ-2.²ò}ÃÁßÇCšñVu´Ýº|}0+“tË2³}öÚȾÿlfê¥d:ÌÁ¦Ä|¦eŠÌdšzfdœ¼ÕŽ©û2nº§|<Í4„\Qay>xº3à^à~àžà ¾à Þà ;OpenJade-1.4devel/jadedoc/images/space.gif0000644000021000000240000000154206765305125014156 GIF89a‘ ÷h™Àáÿhhh™hÀháhÿh™h™™™À™á™ÿ™ÀhÀ™ÀÀÀáÀÿÀáhá™áÀáááÿáÿhÿ™ÿÀÿáÿÿÿhhh™hÀháhÿhhhhhh™hhÀhháhhÿhh™hh™h™™hÀ™há™hÿ™hÀhhÀh™ÀhÀÀháÀhÿÀháhháh™áhÀáhááhÿáhÿhhÿh™ÿhÀÿháÿhÿÿh™h™™™À™á™ÿ™h™hh™™h™Àh™áh™ÿh™™™h™™™™™À™™á™™ÿ™™À™hÀ™™À™ÀÀ™áÀ™ÿÀ™á™há™™á™Àá™áá™ÿá™ÿ™hÿ™™ÿ™Àÿ™áÿ™ÿÿ™ÀhÀ™ÀÀÀáÀÿÀhÀhhÀ™hÀÀhÀáhÀÿhÀ™Àh™À™™ÀÀ™Àá™Àÿ™ÀÀÀhÀÀ™ÀÀÀÀÀáÀÀÿÀÀáÀháÀ™áÀÀáÀááÀÿáÀÿÀhÿÀ™ÿÀÀÿÀáÿÀÿÿÀáhá™áÀáááÿáháhhá™háÀhááháÿhá™áh™á™™áÀ™áá™áÿ™áÀáhÀá™ÀáÀÀááÀáÿÀáááháá™ááÀáááááÿááÿáhÿá™ÿáÀÿááÿáÿÿáÿhÿ™ÿÀÿáÿÿÿhÿhhÿ™hÿÀhÿáhÿÿhÿ™ÿh™ÿ™™ÿÀ™ÿá™ÿÿ™ÿÀÿhÀÿ™ÀÿÀÀÿáÀÿÿÀÿáÿháÿ™áÿÀáÿááÿÿáÿÿÿhÿÿ™ÿÿÀÿÿáÿÿÿÿÿ!ù×,‘ @?¯ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³æÄ€;OpenJade-1.4devel/jadedoc/images/top-of-page.gif0000644000021000000240000000013706765305125015200 GIF89a ¢ÿÿÿÿ1cœÿ1cÿ, ,Hº @#ÊA8‹úǤe’h÷ ¬è¤êXÆïì~¶‰ƒô®sžƒáH;OpenJade-1.4devel/dsssl/0000777000021000000240000000000007070410046010735 5OpenJade-1.4devel/dsssl/Makefile.in0000644000021000000240000001511007070410046012714 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ pkgdata_DATA = builtins.dsl catalog dsssl.dtd style-sheet.dtd spec.dtd fot.dtd extensions.dsl docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = demo.dsl demo.sgm EXTRA_DIST = builtins.dsl catalog demo.dsl demo.sgm dsssl.dtd extensions.dsl fot.dtd spec.dtd style-sheet.dtd mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = DATA = $(pkgdata_DATA) $(pkgdoc_DATA) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps dsssl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \ fi; fi; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) list='$(pkgdata_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgdatadir)/$$p; \ done install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdocdir) @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdocdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/$$p; \ fi; fi; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) list='$(pkgdoc_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgdocdir)/$$p; \ done tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = dsssl distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-pkgdataDATA install-pkgdocDATA install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-pkgdataDATA uninstall-pkgdocDATA uninstall: uninstall-am all-am: Makefile $(DATA) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdocdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: uninstall-pkgdataDATA install-pkgdataDATA uninstall-pkgdocDATA \ install-pkgdocDATA tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/dsssl/Makefile.am0000644000021000000240000000055107017012527012711 ## Process this file with automake to produce Makefile.in pkgdata_DATA = builtins.dsl catalog dsssl.dtd \ style-sheet.dtd spec.dtd fot.dtd extensions.dsl docdir = $(prefix)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = demo.dsl demo.sgm EXTRA_DIST = builtins.dsl catalog demo.dsl demo.sgm dsssl.dtd \ extensions.dsl fot.dtd spec.dtd style-sheet.dtd OpenJade-1.4devel/dsssl/builtins.dsl0000644000021000000240000002412107067710764013226 ;; clause 8.5.3.5 (define (caar x) (car (car x)) ) (define (cadr x) (list-ref x 1) ) (define (cdar x) (cdr (car x)) ) (define (cddr x) (cdr (cdr x)) ) (define (caaar x) (car (car (car x))) ) (define (caadr x) (car (car (cdr x))) ) (define (cadar x) (car (cdr (car x))) ) (define (caddr x) (list-ref x 2) ) (define (cdaar x) (cdr (car (car x))) ) (define (cdadr x) (cdr (car (cdr x))) ) (define (cddar x) (cdr (cdr (car x))) ) (define (cdddr x) (cdr (cdr (cdr x))) ) (define (caaaar x) (car (car (car (car x)))) ) (define (caaadr x) (car (car (car (cdr x)))) ) (define (caadar x) (car (car (cdr (car x)))) ) (define (cadaar x) (car (cdr (car (car x)))) ) (define (cadadr x) (car (cdr (car (cdr x)))) ) (define (caddar x) (car (cdr (cdr (car x)))) ) (define (cadddr x) (list-ref x 3) ) (define (cdaaar x) (cdr (car (car (car x)))) ) (define (cdaadr x) (cdr (car (car (cdr x)))) ) (define (cdadar x) (cdr (car (cdr (car x)))) ) (define (cddaar x) (cdr (cdr (car (car x)))) ) (define (cddadr x) (cdr (cdr (car (cdr x)))) ) (define (cdddar x) (cdr (cdr (cdr (car x)))) ) (define (cddddr x) (cdr (cdr (cdr (cdr x)))) ) ;; clause 8.5.8.4 (define (char>? c1 c2) (char=? c1 c2) (char<=? c2 c1)) ;; clause 8.5.8.5 (define internal: (ci-equiv proc) (lambda (c1 c2) (proc (char-upcase c1) (char-upcase c2)) ) ) (define char-ci=? (ci-equiv char=?)) (define char-ci? (ci-equiv char>?)) (define char-ci<=? (ci-equiv char<=?)) (define char-ci>=? (ci-equiv char>=?)) ;; clause 8.5.9.6 (define internal: (upcase-string s) (list->string (map char-upcase (string->list s) ) ) ) (define internal: (ci-string-equiv proc) (lambda (s1 s2) (proc (upcase-string s1) (upcase-string s2)) ) ) (define (string>? s1 s2) (string=? s1 s2) (string<=? s2 s1)) (define string-ci=? (ci-string-equiv string=?)) (define string-ci? (ci-string-equiv string>?)) (define string-ci<=? (ci-string-equiv string<=?)) (define string-ci>=? (ci-string-equiv string>=?)) ;; clause 8.5.10.3 (define (map f #!rest xs) (let ((map1 (lambda (f xs) (let loop ((xs xs)) (if (null? xs) '() (cons (f (car xs)) (loop (cdr xs)))))))) (cond ((null? xs) '()) ((null? (cdr xs)) (map1 f (car xs))) (else (let loop ((xs xs)) (if (null? (car xs)) '() (cons (apply f (map1 car xs)) (loop (map1 cdr xs))))))))) ;; clause 10.1.1 (define (current-root) (node-property 'grove-root (current-node))) ;; clause 10.2.2 (define (node-list-reduce nl combine init) (if (node-list-empty? nl) init (node-list-reduce (node-list-rest nl) combine (combine init (node-list-first nl))))) (define (node-list-remove-duplicates nl) (node-list-reduce nl (lambda (result snl) (if (node-list-contains? result snl) result (node-list result snl))) (empty-node-list))) (define internal: (reduce list combine init) (let loop ((result init) (list list)) (if (null? list) result (loop (combine result (car list)) (cdr list))))) (define (node-list-union #!rest args) (reduce args (lambda (nl1 nl2) (node-list-reduce nl2 (lambda (result snl) (if (node-list-contains? result snl) result (node-list result snl))) nl1)) (empty-node-list))) (define (node-list-intersection #!rest args) (if (null? args) (empty-node-list) (reduce (cdr args) (lambda (nl1 nl2) (node-list-reduce nl1 (lambda (result snl) (if (node-list-contains? nl2 snl) (node-list result snl) result)) (empty-node-list))) (node-list-remove-duplicates (car args))))) (define (node-list-difference #!rest args) (if (null? args) (empty-node-list) (reduce (cdr args) (lambda (nl1 nl2) (node-list-reduce nl1 (lambda (result snl) (if (node-list-contains? nl2 snl) result (node-list result snl))) (empty-node-list))) (node-list-remove-duplicates (car args))))) (define (node-list-symmetric-difference #!rest args) (if (null? args) (empty-node-list) (reduce (cdr args) (lambda (nl1 nl2) (node-list-difference (node-list-union nl1 nl2) (node-list-intersection nl1 nl2))) (node-list-remove-duplicates (car args))))) (define (node-list-union-map proc nl) (node-list-reduce nl (lambda (result snl) (node-list-union (proc snl) result)) (empty-node-list))) (define (node-list-some? proc nl) (node-list-reduce nl (lambda (result snl) (if (or result (proc snl)) #t #f)) #f)) (define (node-list-every? proc nl) (node-list-reduce nl (lambda (result snl) (if (and result (proc snl)) #t #f)) #t)) (define (node-list->list nl) (reverse (node-list-reduce nl (lambda (result snl) (cons snl result)) '()))) (define (node-list-tail nl k) (cond ((< k 0) (empty-node-list)) ((zero? k) nl) (else (node-list-tail (node-list-rest nl) (- k 1))))) (define (node-list-head nl k) (if (zero? k) (empty-node-list) (node-list (node-list-first nl) (node-list-head (node-list-rest nl) (- k 1))))) ;; ^^^^^^^ ;; missing in standard (define (node-list-sublist nl i j) (node-list-head (node-list-tail nl i) (- j i))) (define (node-list-count nl) (node-list-length (node-list-remove-duplicates nl))) (define (node-list-last nl) (node-list-ref nl (- (node-list-length nl) 1))) ;; clause 10.2.3 (define (node-list-property prop nl) (node-list-map (lambda (snl) (node-property prop snl default: (empty-node-list))) nl)) (define (origin nl) (node-list-property 'origin nl)) (define (origin-to-subnode-rel snl) (node-property 'origin-to-subnode-rel-property-name snl default: #f)) (define (tree-root nl) (node-list-property 'tree-root nl)) (define (grove-root nl) (node-list-property 'grove-root nl)) (define (source nl) (node-list-property 'source nl)) (define (ancestors nl) (node-list-map (lambda (snl) (let loop ((cur (parent snl)) (result (empty-node-list))) (if (node-list-empty? cur) result (loop (parent cur) (node-list cur result))))) nl)) (define (grove-root-path nl) (node-list-map (lambda (snl) (let loop ((cur (origin snl)) (result (empty-node-list))) (if (node-list-empty? cur) result (loop (origin cur) (node-list cur result))))) nl)) (define (rsiblings nl) (node-list-map (lambda (snl) (let ((rel (origin-to-subnode-rel snl))) (if rel (node-property rel (origin snl) default: (empty-node-list)) snl))) nl)) (define (ipreced nl) (node-list-map (lambda (snl) (let loop ((prev (empty-node-list)) (rest (rsiblings snl))) (cond ((node-list-empty? rest) (empty-node-list)) ((node-list=? (node-list-first rest) snl) prev) (else (loop (node-list-first rest) (node-list-rest rest)))))) nl)) (define (ifollow nl) (node-list-map (lambda (snl) (let loop ((rest (rsiblings snl))) (cond ((node-list-empty? rest) (empty-node-list)) ((node-list=? (node-list-first rest) snl) (node-list-first (node-list-rest rest))) (else (loop (node-list-rest rest)))))) nl)) (define (grove-before? snl1 snl2) (let ((sorted (node-list-intersection (subgrove (grove-root snl1)) (node-list snl1 snl2)))) (and (= (node-list-length sorted) 2) (node-list=? (node-list-first sorted) snl1)))) (define (sort-in-tree-order nl) (node-list-intersection (subtree (tree-root nl)) nl)) (define (tree-before? snl1 snl2) (let ((sorted (sort-in-tree-order (node-list snl1 snl2)))) (and (= (node-list-length sorted) 2) (node-list=? (node-list-first sorted) snl1)))) (define (tree-before nl) (node-list-map (lambda (snl) (node-list-filter (lambda (x) (tree-before? x snl)) (subtree (tree-root snl)))) nl)) (define (property-lookup prop snl if-present if-not-present) (let ((val (node-property prop snl default: #f))) (cond (val (if-present val)) ((node-property prop snl default: #t) (if-not-present val)) (else (if-present val))))) (define (select-by-property nl prop proc) (node-list-filter (lambda (snl) (let ((val (node-property prop snl default: #f))) (and (not (node-list? val)) (proc val)))) nl)) (define (select-by-null-property nl prop) (node-list-filter (lambda (snl) (let ((val1 (node-property prop snl null: #f)) (val2 (node-property prop snl null: #t))) (and (not val1) val2))) nl)) (define (select-by-missing-property nl prop) (node-list-filter (lambda (snl) (let ((val1 (node-property prop snl default: #f null: #t)) (val2 (node-property prop snl default: #t null: #f))) (and (not val1) val2))) nl)) ;; clause 10.2.5 (define (attribute string nl) (node-list-map (lambda (snl) (named-node name (attributes snl))) nl)) (define (referent nl) (node-list-property 'referent nl)) (define (q-element pattern #!optional (nl (current-node))) (select-elements (subgrove nl) pattern)) (define (q-class sym #!optional (nl (current-node))) (node-list-filter (lambda (snl) (equal? (node-property 'class-name snl) sym)) (subgrove nl))) (define (q-sdata string #!optional (nl (current-node))) (node-list-filter (lambda (snl) (and (equal? (node-property 'class-name snl) 'sdata) (equal? (node-property 'system-data snl) string))) (subgrove nl))) OpenJade-1.4devel/dsssl/catalog0000644000021000000240000000045506771422066012226 PUBLIC "-//James Clark//DTD DSSSL Flow Object Tree//EN" "fot.dtd" PUBLIC "ISO/IEC 10179:1996//DTD DSSSL Architecture//EN" "dsssl.dtd" PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" "style-sheet.dtd" PUBLIC "-//OpenJade//DTD DSSSL Specification//EN" "spec.dtd" SYSTEM "builtins.dsl" "builtins.dsl" OpenJade-1.4devel/dsssl/demo.dsl0000644000021000000240000000025006771420576012316 (root (make simple-page-sequence)) (element p (make paragraph)) OpenJade-1.4devel/dsssl/demo.sgm0000644000021000000240000000017306713043551012314 ]>

The first paragraph.

The second paragraph. OpenJade-1.4devel/dsssl/dsssl.dtd0000644000021000000240000001332706764552367012532 OpenJade-1.4devel/dsssl/extensions.dsl0000644000021000000240000001236606755630653013605 (define debug (external-procedure "UNREGISTERED::James Clark//Procedure::debug")) (define if-first-page (external-procedure "UNREGISTERED::James Clark//Procedure::if-first-page")) (define if-front-page (external-procedure "UNREGISTERED::James Clark//Procedure::if-front-page")) (define all-element-number (external-procedure "UNREGISTERED::James Clark//Procedure::all-element-number")) (define read-entity (external-procedure "UNREGISTERED::James Clark//Procedure::read-entity")) (define language (external-procedure "UNREGISTERED::OpenJade//Procedure::language")) (define sgml-parse (external-procedure "UNREGISTERED::OpenJade//Procedure::sgml-parse")) (define expt (external-procedure "UNREGISTERED::OpenJade//Procedure::expt")) (declare-flow-object-class element "UNREGISTERED::James Clark//Flow Object Class::element") (declare-flow-object-class empty-element "UNREGISTERED::James Clark//Flow Object Class::empty-element") (declare-flow-object-class document-type "UNREGISTERED::James Clark//Flow Object Class::document-type") (declare-flow-object-class processing-instruction "UNREGISTERED::James Clark//Flow Object Class::processing-instruction") (declare-flow-object-class entity "UNREGISTERED::James Clark//Flow Object Class::entity") (declare-flow-object-class entity-ref "UNREGISTERED::James Clark//Flow Object Class::entity-ref") (declare-flow-object-class formatting-instruction "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") (declare-characteristic preserve-sdata? "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #f) (declare-characteristic heading-level "UNREGISTERED::James Clark//Characteristic::heading-level" 0) (declare-characteristic page-number-format "UNREGISTERED::James Clark//Characteristic::page-number-format" "1") (declare-characteristic page-number-restart "UNREGISTERED::James Clark//Characteristic::page-number-restart" #f) (declare-characteristic page-n-columns "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1) (declare-characteristic page-column-sep "UNREGISTERED::James Clark//Characteristic::page-column-sep" .5in) (declare-characteristic page-balance-columns? "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f) (declare-characteristic superscript-height "UNREGISTERED::James Clark//Characteristic::superscript-height" 0pt) (declare-characteristic subscript-depth "UNREGISTERED::James Clark//Characteristic::subscript-depth" 0pt) (declare-characteristic over-mark-height "UNREGISTERED::James Clark//Characteristic::over-mark-height" 0pt) (declare-characteristic under-mark-depth "UNREGISTERED::James Clark//Characteristic::under-mark-depth" 0pt) (declare-characteristic grid-row-sep "UNREGISTERED::James Clark//Characteristic::grid-row-sep" 0pt) (declare-characteristic grid-column-sep "UNREGISTERED::James Clark//Characteristic::grid-column-sep" 0pt) (declare-flow-object-class page-float "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-float") (declare-flow-object-class page-footnote "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-footnote") (declare-characteristic page-number-format "UNREGISTERED::James Clark//Characteristic::page-number-format" "1") (declare-characteristic page-number-restart "UNREGISTERED::James Clark//Characteristic::page-number-restart" #f) (declare-characteristic page-n-columns "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1) (declare-characteristic page-column-sep "UNREGISTERED::James Clark//Characteristic::page-column-sep" .5in) (declare-characteristic page-balance-columns? "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f) (declare-characteristic superscript-height "UNREGISTERED::James Clark//Characteristic::superscript-height" 0pt) (declare-characteristic subscript-depth "UNREGISTERED::James Clark//Characteristic::subscript-depth" 0pt) (declare-characteristic over-mark-height "UNREGISTERED::James Clark//Characteristic::over-mark-height" 0pt) (declare-characteristic under-mark-depth "UNREGISTERED::James Clark//Characteristic::under-mark-depth" 0pt) (declare-characteristic grid-row-sep "UNREGISTERED::James Clark//Characteristic::grid-row-sep" 0pt) (declare-characteristic grid-column-sep "UNREGISTERED::James Clark//Characteristic::grid-column-sep" 0pt) (declare-characteristic preserve-sdata? "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #f) (declare-flow-object-class index-entry "UNREGISTERED::ISOGEN//Flow Object Class::index-entry") (declare-characteristic page-n-columns "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1) (declare-characteristic page-column-sep "UNREGISTERED::James Clark//Characteristic::page-column-sep" .5in) (declare-characteristic page-balance-columns? "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f) (declare-characteristic scroll-title "UNREGISTERED::James Clark//Characteristic::scroll-title" #f) OpenJade-1.4devel/dsssl/fot.dtd0000644000021000000240000003542006765723231012157 OpenJade-1.4devel/dsssl/spec.dtd0000644000021000000240000000634606771422066012325 OpenJade-1.4devel/dsssl/style-sheet.dtd0000644000021000000240000000237106771422066013633 OpenJade-1.4devel/grove/0000777000021000000240000000000007070410053010725 5OpenJade-1.4devel/grove/Makefile.in0000644000021000000240000002320007070410053012703 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ lib_LTLIBRARIES = libogrove.la libogrove_la_LDFLAGS = -version-info 0:0:0 libogrove_la_SOURCES = Node.h Node.cxx LocNode.h LocNode.cxx # This is needed by ../style/FOTBuilder.h pkginclude_HEADERS = Node.h EXTRA_DIST = grove.dsp mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libogrove_la_LIBADD = libogrove_la_OBJECTS = Node.lo LocNode.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(pkginclude_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libogrove_la_SOURCES) OBJECTS = $(libogrove_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cxx .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps grove/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) distclean-libLTLIBRARIES: maintainer-clean-libLTLIBRARIES: install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: libogrove.la: $(libogrove_la_OBJECTS) $(libogrove_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libogrove_la_LDFLAGS) $(libogrove_la_OBJECTS) $(libogrove_la_LIBADD) $(LIBS) .cxx.o: $(CXXCOMPILE) -c $< .cxx.lo: $(LTCXXCOMPILE) -c $< install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) list='$(pkginclude_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = grove distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done LocNode.lo LocNode.o : LocNode.cxx ../config.h LocNode.h Node.h Node.lo Node.o : Node.cxx ../config.h Node.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-libLTLIBRARIES install-exec: install-exec-am install-data-am: install-pkgincludeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-libLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ distclean-compile clean-compile maintainer-clean-compile \ mostlyclean-libtool distclean-libtool clean-libtool \ maintainer-clean-libtool uninstall-pkgincludeHEADERS \ install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/grove/Makefile.am0000644000021000000240000000044307032661453012710 ## Process this file with automake to produce Makefile.in lib_LTLIBRARIES = libogrove.la libogrove_la_LDFLAGS = -version-info 0:0:0 libogrove_la_SOURCES = Node.h Node.cxx LocNode.h LocNode.cxx # This is needed by ../style/FOTBuilder.h pkginclude_HEADERS = Node.h EXTRA_DIST = grove.dsp OpenJade-1.4devel/grove/Node.h0000644000021000000240000006303707067706431011726 // Copyright (c) 1996 James Clark // See the file COPYING for copying permission. #ifndef Node_INCLUDED #define Node_INCLUDED 1 #ifdef __GNUG__ #pragma interface #endif #include #include #include #ifdef SP_USE_DLL #ifdef BUILD_LIBGROVE #define GROVE_API SP_DLLEXPORT #else #define GROVE_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define GROVE_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef GROVE_NAMESPACE #define GROVE_NAMESPACE_SCOPE GROVE_NAMESPACE:: #else #define GROVE_NAMESPACE_SCOPE #endif // Supports the following modules: // baseabs prlgabs0 prlgabs1 instabs basesds0 instsds0 subdcabs // rankabs fpiabs #ifdef GROVE_NAMESPACE namespace GROVE_NAMESPACE { #endif #ifdef SP_MULTI_BYTE #if UINT_MAX >= 0xffffffffL /* 2^32 - 1 */ typedef unsigned int GroveChar; #else typedef unsigned long GroveChar; #endif #else /* not SP_MULTI_BYTE */ typedef unsigned char GroveChar; #endif /* not SP_MULTI_BYTE */ class NodePtr; class NodeListPtr; class NamedNodeListPtr; class GroveString; class NodeVisitor; class SdataMapper; class GroveStringList; class GroveStringListPtr; enum AccessResult { accessOK, // success accessNull, // value is null accessTimeout, // timed out waiting for property accessNotInClass // property is not defined for class }; struct GROVE_API ComponentName { enum Id { noId = -1, idAllPropertyNames, idAnd, idAny, idApplicationInfo, idAttributeAssignment, idAttributeDef, idAttributeDefs, idAttributes, idAttributeValueToken, idCapacity, idCdata, idChar, idCharset, idChildrenPropertyName, idClassName, idConnector, idConref, idContent, idContentTokens, idContentType, idCurrent, idCurrentAttributeIndex, idCurrentGroup, idDataChar, idDataPropertyName, idDataSepPropertyName, idDeclValueType, idDefaulted, idDefaultedEntities, idDefaultEntity, idDefaultValue, idDefaultValueType, idDoctypesAndLinktypes, idDocument, idDocumentElement, idDocumentType, idDtd, idElement, idElements, idElementToken, idElementType, idElementTypes, idEmpty, idEntities, idEntity, idEntityName, idEntityType, idEpilog, idExclusions, idExternalData, idExternalId, idFixed, idFormalPublicId, idGeneralEntities, idGeneratedSystemId, idGi, idGoverning, idGoverningDoctype, idGroveRoot, idId, idIdref, idIdrefs, idImplied, idIncluded, idInclusions, idIso, idLpd, idModelGroup, idMustOmitEndTag, idName, idNames, idNdata, idNmtkgrp, idNmtoken, idNmtokens, idNonsgml, idNotation, idNotationName, idNotations, idNumber, idNumbers, idNutoken, idNutokens, idOccurenceIndicator, idOmitEndTag, idOmitStartTag, idOpt, idOr, idOrigin, idOriginToSubnodeRelPropertyName, idOwnerId, idOwnerType, idParameterEntities, idParent, idPcdataToken, idPi, idPlus, idProlog, idPublicId, idRankGroup, idRankStem, idRankSuffix, idRcdata, idReferent, idRegistered, idRep, idRequired, idSdata, idSeq, idSgmlConstants, idSgmlDocument, idShortref, idStem, idSubdoc, idSubdocument, idSubnodePropertyNames, idSyntax, idSystemData, idSystemId, idText, idTextClass, idTextDescription, idTextDesignatingSequence, idTextDisplayVersion, idTextLanguage, idToken, idTokens, idTokenSep, idTreeRoot, idUnavailable, idUnregistered, idValue }; enum { nIds = idValue + 1 }; static const char *rcsName(Id); static const char *sdqlName(Id); }; struct GROVE_API ClassDef { ComponentName::Id className; const ComponentName::Id *allPropertyNames; const ComponentName::Id *subnodePropertyNames; ComponentName::Id childrenPropertyName; ComponentName::Id dataPropertyName; ComponentName::Id dataSepPropertyName; static const ClassDef sgmlDocument; static const ClassDef sgmlConstants; static const ClassDef dataChar; static const ClassDef element; static const ClassDef attributeAssignment; static const ClassDef attributeDef; static const ClassDef attributeValueToken; static const ClassDef pi; static const ClassDef sdata; static const ClassDef documentType; static const ClassDef entity; static const ClassDef notation; static const ClassDef externalId; static const ClassDef externalData; static const ClassDef subdocument; static const ClassDef nonSgml; static const ClassDef message; static const ClassDef elementType; static const ClassDef modelGroup; static const ClassDef elementToken; static const ClassDef pcdataToken; static const ClassDef defaultEntity; static const ClassDef rankStem; static const ClassDef formalPublicId; }; class PropertyValue; class GROVE_API Node { public: // property values // data in GroveString valid till Node destroyed // default is accessNotInClass // Intrinsic properties. virtual AccessResult getOrigin(NodePtr &) const; virtual AccessResult getParent(NodePtr &) const; virtual AccessResult getGroveRoot(NodePtr &) const; virtual AccessResult getTreeRoot(NodePtr &) const; virtual AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &) const = 0; AccessResult getClassName(ComponentName::Id &) const; AccessResult getChildrenPropertyName(ComponentName::Id &) const; AccessResult getDataPropertyName(ComponentName::Id &) const; AccessResult getDataSepPropertyName(ComponentName::Id &) const; AccessResult getSubnodePropertyNames(const ComponentName::Id *&) const; AccessResult getAllPropertyNames(const ComponentName::Id *&) const; // this allows you to apply some operation to a node // according to its grove class virtual void accept(NodeVisitor &) = 0; virtual const ClassDef &classDef() const = 0; // not formally properties virtual AccessResult children(NodeListPtr &) const = 0; virtual AccessResult follow(NodeListPtr &) const = 0; // return accessNull if there isn't a first or next // result accessNotInClass if datatype of otsnr is not node-list or named-node-list virtual AccessResult nextSibling(NodePtr &) const; // works the same as nextSibling(), except that when charChunk() // returns accessOK, returns node following that chunk. virtual AccessResult nextChunkSibling(NodePtr &) const; // if result == accessOK, length must be > 0 virtual AccessResult nextChunkAfter(NodePtr &) const; virtual AccessResult charChunk(const SdataMapper &, GroveString &) const; // return accessNotInClass if class doesn't have children property // return accessNull if there isn't a first child virtual AccessResult firstChild(NodePtr &) const; // First of this node's siblings. // accessNotInClass if datatype of otsnr is not node-list or named-node-list virtual AccessResult firstSibling(NodePtr &) const; // The index of this node in the list of all its siblings. virtual AccessResult siblingsIndex(unsigned long &) const; // Has a default implementation in terms of getAttributes and NodeList::ref virtual AccessResult attributeRef(unsigned long, NodePtr &) const; // references the list of the following siblings // 0 is the next sibling // Has a default implementation in terms of nextSibling. virtual AccessResult followSiblingRef(unsigned long, NodePtr &) const; // For a tokenized attribute returns tokens separated by spaces; // null for a non-tokenized attribute. virtual AccessResult tokens(GroveString &) const; // For an element, the number of elements started before it, // that is its zero-based index in a pre-order traversal of // the all the elements in the document. virtual AccessResult elementIndex(unsigned long &) const; // Node identity. // if hash() returns different values for two nodes, // the operator==() must return false for those two nodes. virtual unsigned long hash() const; // Implementation will usually need to call sameGrove(). virtual bool operator==(const Node &node) const = 0; bool operator!=(const Node &node) const { return !(*this == node); } // Does this chunk contains nd? virtual bool chunkContains(const Node &nd) const; bool sameGrove(const Node &node) const; typedef const char *IID; virtual bool queryInterface(IID, const void *&) const; // Property on SGML document giving list of parser messages. virtual AccessResult getMessages(NodeListPtr &) const; // Property of message. enum Severity { info, warning, error }; virtual AccessResult getSeverity(Severity &) const; AccessResult property(ComponentName::Id, const SdataMapper &, PropertyValue &) const; virtual unsigned groveIndex() const = 0; public: virtual void addRef() = 0; // You must call release rather than use delete. // This is done automatically by NodePtr. virtual void release() = 0; protected: // This enforces this. #ifdef __GNUG__ virtual #endif ~Node() { } public: // This is special. // Implemented in terms of charChunk(). AccessResult getChar(const SdataMapper &, GroveChar &) const; // From here on derived algorithmically from property set. // Properties common to several node classes. virtual AccessResult getAttributes(NamedNodeListPtr &) const; virtual AccessResult getName(GroveString &) const; virtual AccessResult getSystemData(GroveString &) const; virtual AccessResult getEntity(NodePtr &) const; virtual AccessResult getEntityName(GroveString &) const; virtual AccessResult getExternalId(NodePtr &) const; virtual AccessResult getNotation(NodePtr &) const; virtual AccessResult getGi(GroveString &) const; struct OccurIndicator { enum Enum { opt, plus, rep }; }; virtual AccessResult getOccurIndicator(OccurIndicator::Enum &) const; virtual AccessResult getAttributeDefs(NamedNodeListPtr &) const; virtual AccessResult getText(GroveString &) const; virtual AccessResult getNotationName(GroveString &) const; struct EntityType { enum Enum { text, cdata, sdata, ndata, subdocument, pi }; }; virtual AccessResult getEntityType(EntityType::Enum &) const; // Properties only on entity virtual AccessResult getDefaulted(bool &) const; // Properties only on externalId virtual AccessResult getPublicId(GroveString &) const; virtual AccessResult getSystemId(GroveString &) const; virtual AccessResult getGeneratedSystemId(GroveString &) const; virtual AccessResult getFormalPublicId(NodePtr &) const; // Properties only on attributeAssignment virtual AccessResult getValue(NodeListPtr &) const; virtual AccessResult getTokenSep(GroveChar &) const; virtual AccessResult getImplied(bool &) const; virtual AccessResult getAttributeDef(NodePtr &) const; // Properties only on attributeDef virtual AccessResult getCurrentAttributeIndex(long &) const; virtual AccessResult getCurrentGroup(NodeListPtr &) const; struct DeclValueType { enum Enum { cdata, entity, entities, id, idref, idrefs, name, names, nmtoken, nmtokens, number, numbers, nutoken, nutokens, notation, nmtkgrp }; }; virtual AccessResult getDeclValueType(DeclValueType::Enum &) const; struct DefaultValueType { enum Enum { value, fixed, required, current, conref, implied }; }; virtual AccessResult getDefaultValueType(DefaultValueType::Enum &) const; virtual AccessResult getDefaultValue(NodeListPtr &) const; virtual AccessResult getTokens(GroveStringListPtr &) const; // Properties only on element. virtual bool hasGi(GroveString) const; virtual AccessResult getId(GroveString &) const; virtual AccessResult getContent(NodeListPtr &) const; virtual AccessResult getIncluded(bool &) const; virtual AccessResult getMustOmitEndTag(bool &) const; virtual AccessResult getElementType(NodePtr &) const; // Properties only on elementType. struct ContentType { enum Enum { cdata, rcdata, empty, any, modelgrp }; }; virtual AccessResult getContentType(ContentType::Enum &) const; virtual AccessResult getExclusions(GroveStringListPtr &) const; virtual AccessResult getInclusions(GroveStringListPtr &) const; virtual AccessResult getModelGroup(NodePtr &) const; virtual AccessResult getOmitEndTag(bool &) const; virtual AccessResult getOmitStartTag(bool &) const; virtual AccessResult getRankGroup(GroveStringListPtr &) const; virtual AccessResult getRankStem(GroveString &) const; virtual AccessResult getRankSuffix(GroveString &) const; // Properties only on rankStem virtual AccessResult getElementTypes(NodeListPtr &) const; virtual AccessResult getStem(GroveString &) const; // Properties only on modelGroup. struct Connector { enum Enum { and_, or_, seq }; // "and", "or" can be keywords }; virtual AccessResult getConnector(Connector::Enum &) const; virtual AccessResult getContentTokens(NodeListPtr &) const; // Properties only on attributeValueToken. virtual AccessResult getToken(GroveString &) const; virtual AccessResult getReferent(NodePtr &) const; // Properties only on doctype virtual AccessResult getGoverning(bool &) const; virtual AccessResult getGeneralEntities(NamedNodeListPtr &) const; virtual AccessResult getNotations(NamedNodeListPtr &) const; virtual AccessResult getElementTypes(NamedNodeListPtr &) const; virtual AccessResult getDefaultEntity(NodePtr &) const; virtual AccessResult getParameterEntities(NamedNodeListPtr &) const; // Properties only on sgmlDocument. virtual AccessResult getSgmlConstants(NodePtr &) const; virtual AccessResult getApplicationInfo(GroveString &) const; virtual AccessResult getProlog(NodeListPtr &) const; virtual AccessResult getEpilog(NodeListPtr &) const; virtual AccessResult getDocumentElement(NodePtr &) const; virtual AccessResult getElements(NamedNodeListPtr &) const; virtual AccessResult getEntities(NamedNodeListPtr &) const; virtual AccessResult getDefaultedEntities(NamedNodeListPtr &) const; virtual AccessResult getGoverningDoctype(NodePtr &) const; virtual AccessResult getDoctypesAndLinktypes(NamedNodeListPtr &) const; // Properties only on dataChar. // For a non-SGML data character (resulting from a numeric character reference). // Something like this is being added in the HyTime TC. virtual AccessResult getNonSgml(unsigned long &) const; // Properties only on formalPublicId struct OwnerType { enum Enum { iso, registered, unregistered }; }; virtual AccessResult getOwnerType(OwnerType::Enum &) const; virtual AccessResult getOwnerId(GroveString &) const; struct TextClass { enum Enum { capacity, charset, document, dtd, elements, entities, lpd, nonsgml, notation, shortref, subdoc, syntax, text, }; }; virtual AccessResult getTextClass(TextClass::Enum &) const; virtual AccessResult getUnavailable(bool &) const; virtual AccessResult getTextDescription(GroveString &) const; virtual AccessResult getTextLanguage(GroveString &) const; virtual AccessResult getTextDesignatingSequence(GroveString &) const; virtual AccessResult getTextDisplayVersion(GroveString &) const; }; class GROVE_API NodeList { public: virtual AccessResult first(NodePtr &) const = 0; virtual AccessResult rest(NodeListPtr &) const = 0; virtual AccessResult chunkRest(NodeListPtr &) const = 0; // i is a zero based index // This has a default implementation in terms of first and rest. virtual AccessResult ref(unsigned long i, NodePtr &) const; virtual void release() = 0; virtual void addRef() = 0; protected: #ifdef __GNUG__ virtual #endif ~NodeList() { } }; class GROVE_API NamedNodeList { public: // This must NOT assume that the string has been normalized. virtual AccessResult namedNode(GroveString, NodePtr &) const = 0; // Do name normalize appropriate for this NamedNodeList. // Returns new size (always <= old size). // This can be used even if list is empty virtual size_t normalize(GroveChar *, size_t) const = 0; // Could have used subtyping here, but accessing NamedNodeList // positionally typically requires different data structure. virtual NodeListPtr nodeList() const = 0; // Use this when you don't care about the order. // May be much more efficient than nodeList(). virtual NodeListPtr nodeListNoOrder() const; enum Type { elements, attributes, entities, notations, doctypesAndLinktypes, elementTypes, attributeDefs }; virtual Type type() const = 0; // If the node is of a class that occurs in the list, // return the value of the property that serves as the name // property for nodes of that class in the named node list. // Return accessNotInClass if the node is not of a class // that occurs in the list. AccessResult nodeName(const NodePtr &, GroveString &) const; virtual void release() = 0; virtual void addRef() = 0; protected: #ifdef __GNUG__ virtual #endif ~NamedNodeList() { } }; class GROVE_API NodePtr { public: NodePtr() : node_(0) { } NodePtr(Node *node) : node_(node) { addRef(); } ~NodePtr() { release(); } NodePtr(const NodePtr &ptr) : node_(ptr.node_) { addRef(); } NodePtr &operator=(const NodePtr &ptr) { ptr.addRef(); release(); node_ = ptr.node_; return *this; } Node *operator->() const { return node_; } Node &operator*() const { return *node_; } AccessResult assignOrigin() { return node_->getOrigin(*this); } AccessResult assignFirstChild() { return node_->firstChild(*this); } AccessResult assignNextSibling() { return node_->nextSibling(*this); } AccessResult assignNextChunkSibling() { return node_->nextChunkSibling(*this); } AccessResult assignNextChunkAfter() { return node_->nextChunkAfter(*this); } AccessResult assignFirstSibling() { return node_->firstSibling(*this); } void assign(Node *node) { if (node) node->addRef(); release(); node_ = node; } void clear() { release(); node_ = 0; } operator bool() const { return node_ != 0; } private: void addRef() const { if (node_) node_->addRef(); } void release() const { if (node_) node_->release(); } Node *node_; }; class GROVE_API NodeListPtr { public: NodeListPtr() : list_(0) { } NodeListPtr(NodeList *list) : list_(list) { addRef(); } ~NodeListPtr() { release(); } NodeListPtr(const NodeListPtr &ptr) : list_(ptr.list_) { addRef(); } NodeListPtr &operator=(const NodeListPtr &ptr) { ptr.addRef(); release(); list_ = ptr.list_; return *this; } AccessResult assignRest() { return list_->rest(*this); } AccessResult assignChunkRest() { return list_->chunkRest(*this); } NodeList *operator->() const { return list_; } NodeList &operator*() const { return *list_; } void assign(NodeList *list) { if (list) list->addRef(); release(); list_ = list; } void clear() { release(); list_ = 0; } operator bool() const { return list_ != 0; } private: void addRef() const { if (list_) list_->addRef(); } void release() const { if (list_) list_->release(); } NodeList *list_; }; class GROVE_API NamedNodeListPtr { public: NamedNodeListPtr() : list_(0) { } NamedNodeListPtr(NamedNodeList *list) : list_(list) { addRef(); } ~NamedNodeListPtr() { release(); } NamedNodeListPtr(const NamedNodeListPtr &ptr) : list_(ptr.list_) { addRef(); } NamedNodeListPtr &operator=(const NamedNodeListPtr &ptr) { ptr.addRef(); release(); list_ = ptr.list_; return *this; } NamedNodeList *operator->() const { return list_; } NamedNodeList &operator*() const { return *list_; } void assign(NamedNodeList *list) { if (list) list->addRef(); release(); list_ = list; } void clear() { release(); list_ = 0; } operator bool() const { return list_ != 0; } private: void addRef() const { if (list_) list_->addRef(); } void release() const { if (list_) list_->release(); } NamedNodeList *list_; }; class GROVE_API GroveString { public: typedef const GroveChar *const_iterator; GroveString() : data_(0), size_(0) { } GroveString(const GroveChar *data, size_t size) : data_(data), size_(size) { } size_t size() const { return size_; } const GroveChar *data() const { return data_; } void assign(const GroveChar *data, size_t size) { data_ = data; size_ = size; } bool operator==(const GroveString &str) const; bool operator!=(const GroveString &str) const { return !(*this == str); } GroveChar operator[](size_t i) const { return data_[i]; } const_iterator begin() const { return data_; } const_iterator end() const { return data_ + size_; } private: const GroveChar *data_; size_t size_; }; class GROVE_API GroveStringLink { public: GroveStringLink( const GroveString &gs ) : data_(gs), next_(0) { } friend class GroveStringList; friend class ConstGroveStringListIter; private: GroveString data_; GroveStringLink *next_; }; class GroveStringList; class GROVE_API ConstGroveStringListIter { public: friend class GroveStringList; ConstGroveStringListIter() : link_(0) { } ConstGroveStringListIter(const GroveStringList &list); int done() const { return link_ == 0; } const GroveString &cur() const { return link_->data_; } void next() { link_ = link_->next_; } protected: void attach(const GroveStringLink *link) { link_ = link; } const GroveStringLink *link_; }; class GROVE_API GroveStringList { public: friend class ConstGroveStringListIter; GroveStringList() : head_(0), refCount_(0) { } ~GroveStringList(); void append(const GroveString &gs); void release(); void addRef(); bool canReuse(GroveStringListPtr &ptr) const; AccessResult first(GroveString &) const; AccessResult rest(GroveStringListPtr &) const; const ConstGroveStringListIter &iter() { return iter_; } private: unsigned refCount_; GroveStringLink *head_; ConstGroveStringListIter iter_; }; class GROVE_API GroveStringListPtr { public: GroveStringListPtr() : list_(0) { } GroveStringListPtr(GroveStringList *list) : list_(list) { addRef(); } ~GroveStringListPtr() { release(); } GroveStringListPtr(const GroveStringListPtr &ptr) : list_(ptr.list_) { addRef(); } GroveStringListPtr &operator=(const GroveStringListPtr &ptr) { ptr.addRef(); release(); list_ = ptr.list_; return *this; } GroveStringList *operator->() const { return list_; } GroveStringList &operator*() const { return *list_; } void assign(GroveStringList *list) { if (list) list->addRef(); release(); list_ = list; } void clear() { release(); list_ = 0; } operator bool() const { return list_ != 0; } private: void addRef() const { if (list_) list_->addRef(); } void release() const { if (list_) list_->release(); } GroveStringList *list_; }; class GROVE_API SdataMapper { public: virtual ~SdataMapper(); // Returns a pointer to a single character or null virtual bool sdataMap(GroveString name, GroveString text, GroveChar &) const; }; // See Design Patterns. class GROVE_API NodeVisitor { public: virtual void sgmlDocument(Node &); virtual void sgmlConstants(Node &); virtual void dataChar(Node &); virtual void element(Node &); virtual void attributeAssignment(Node &); virtual void attributeDef(Node &); virtual void attributeValueToken(Node &); virtual void pi(Node &); virtual void sdata(Node &); virtual void documentType(Node &); virtual void entity(Node &); virtual void notation(Node &); virtual void externalId(Node &); virtual void externalData(Node &); virtual void subdocument(Node &); virtual void nonSgml(Node &); virtual void message(Node &); virtual void elementType(Node &); virtual void rankStem(Node &); virtual void modelGroup(Node &); virtual void elementToken(Node &); virtual void pcdataToken(Node &); virtual void defaultEntity(Node &); virtual void formalPublicId(Node &); }; class GROVE_API PropertyValue { public: virtual ~PropertyValue() { } virtual void set(const NodePtr &) = 0; virtual void set(const NodeListPtr &) = 0; virtual void set(const NamedNodeListPtr &) = 0; virtual void set(bool) = 0; virtual void set(GroveChar) = 0; virtual void set(GroveString) = 0; virtual void set(ComponentName::Id) = 0; virtual void set(const GroveStringListPtr &) = 0; virtual void set(const ComponentName::Id *) = 0; virtual void set(long) = 0; }; inline AccessResult Node::getChar(const SdataMapper &mapper, GroveChar &c) const { GroveString str; AccessResult ret = charChunk(mapper, str); if (ret == accessOK) c = str[0]; return ret; } inline bool Node::sameGrove(const Node &node) const { return groveIndex() == node.groveIndex(); } inline AccessResult Node::getClassName(ComponentName::Id &name) const { name = classDef().className; return accessOK; } inline AccessResult Node::getChildrenPropertyName(ComponentName::Id &name) const { const ClassDef &def = classDef(); if (def.childrenPropertyName == ComponentName::noId) return accessNull; name = def.childrenPropertyName; return accessOK; } inline AccessResult Node::getDataPropertyName(ComponentName::Id &name) const { const ClassDef &def = classDef(); if (def.dataPropertyName == ComponentName::noId) return accessNull; name = def.dataPropertyName; return accessOK; } inline AccessResult Node::getDataSepPropertyName(ComponentName::Id &name) const { const ClassDef &def = classDef(); if (def.dataSepPropertyName == ComponentName::noId) return accessNull; name = def.dataSepPropertyName; return accessOK; } inline AccessResult Node::getSubnodePropertyNames(const ComponentName::Id *&names) const { names = classDef().subnodePropertyNames; return accessOK; } inline AccessResult Node::getAllPropertyNames(const ComponentName::Id *&names) const { names = classDef().allPropertyNames; return accessOK; } #ifdef GROVE_NAMESPACE } #endif #endif /* not Node_INCLUDED */ OpenJade-1.4devel/grove/Node.cxx0000644000021000000240000011200107067706427012270 // Copyright (c) 1996 James Clark // See the file COPYING for copying permission. #ifdef __GNUG__ #pragma implementation #endif #include "config.h" #include #include "Node.h" #include #include #include #ifdef GROVE_NAMESPACE namespace GROVE_NAMESPACE { #endif bool Node::queryInterface(IID, const void *&) const { return 0; } AccessResult Node::getMessages(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getSeverity(Severity &) const { return accessNotInClass; } AccessResult Node::getOrigin(NodePtr &) const { return accessNull; } AccessResult Node::getParent(NodePtr &) const { return accessNull; } AccessResult Node::getGroveRoot(NodePtr &) const { return accessNull; } AccessResult Node::getTreeRoot(NodePtr &nd) const { // FIXME avoid cast -- need copy method nd.assign((Node *)this); for (;;) { AccessResult res = nd->getParent(nd); if (res != accessOK) { if (res == accessTimeout) return res; break; } } return accessOK; } AccessResult Node::getAttributes(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getName(GroveString &) const { return accessNotInClass; } AccessResult Node::getSystemData(GroveString &) const { return accessNotInClass; } AccessResult Node::getEntity(NodePtr &) const { return accessNotInClass; } AccessResult Node::getEntityName(GroveString &) const { return accessNotInClass; } AccessResult Node::getExternalId(NodePtr &) const { return accessNotInClass; } AccessResult Node::getNotation(NodePtr &) const { return accessNotInClass; } AccessResult Node::getText(GroveString &) const { return accessNotInClass; } AccessResult Node::getNotationName(GroveString &) const { return accessNotInClass; } AccessResult Node::getEntityType(EntityType::Enum &) const { return accessNotInClass; } AccessResult Node::getDefaulted(bool &) const { return accessNotInClass; } AccessResult Node::getPublicId(GroveString &) const { return accessNotInClass; } AccessResult Node::getFormalPublicId(NodePtr &) const { return accessNotInClass; } AccessResult Node::getSystemId(GroveString &) const { return accessNotInClass; } AccessResult Node::getGeneratedSystemId(GroveString &) const { return accessNotInClass; } AccessResult Node::getValue(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getTokenSep(GroveChar &) const { return accessNotInClass; } AccessResult Node::getImplied(bool &) const { return accessNotInClass; } AccessResult Node::getAttributeDef(NodePtr &) const { return accessNotInClass; } AccessResult Node::getCurrentAttributeIndex(long &) const { return accessNotInClass; } AccessResult Node::getCurrentGroup(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getDeclValueType(DeclValueType::Enum &) const { return accessNotInClass; } AccessResult Node::getDefaultValueType(DefaultValueType::Enum &) const { return accessNotInClass; } AccessResult Node::getDefaultValue(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getTokens(GroveStringListPtr &) const { return accessNotInClass; } AccessResult Node::getGi(GroveString &) const { return accessNotInClass; } bool Node::hasGi(GroveString) const { return 0; } AccessResult Node::getId(GroveString &) const { return accessNotInClass; } AccessResult Node::getContent(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getIncluded(bool &) const { return accessNotInClass; } AccessResult Node::getMustOmitEndTag(bool &) const { return accessNotInClass; } AccessResult Node::getAttributeDefs(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getContentType(ContentType::Enum &) const { return accessNotInClass; } AccessResult Node::getExclusions(GroveStringListPtr &) const { return accessNotInClass; } AccessResult Node::getInclusions(GroveStringListPtr &) const { return accessNotInClass; } AccessResult Node::getModelGroup(NodePtr &) const { return accessNotInClass; } AccessResult Node::getOmitEndTag(bool &) const { return accessNotInClass; } AccessResult Node::getOmitStartTag(bool &) const { return accessNotInClass; } AccessResult Node::getRankGroup(GroveStringListPtr &) const { return accessNotInClass; } AccessResult Node::getRankStem(GroveString &) const { return accessNotInClass; } AccessResult Node::getRankSuffix(GroveString &) const { return accessNotInClass; } AccessResult Node::getElementTypes(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getStem(GroveString &) const { return accessNotInClass; } AccessResult Node::getConnector(Connector::Enum &) const { return accessNotInClass; } AccessResult Node::getOccurIndicator(OccurIndicator::Enum &) const { return accessNotInClass; } AccessResult Node::getContentTokens(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getDefaultEntity(NodePtr &) const { return accessNotInClass; } AccessResult Node::getElementType(NodePtr &) const { return accessNotInClass; } AccessResult Node::getParameterEntities(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getToken(GroveString &) const { return accessNotInClass; } AccessResult Node::getReferent(NodePtr &) const { return accessNotInClass; } AccessResult Node::getGoverning(bool &) const { return accessNotInClass; } AccessResult Node::getGeneralEntities(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getNotations(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getElementTypes(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getSgmlConstants(NodePtr &) const { return accessNotInClass; } AccessResult Node::getApplicationInfo(GroveString &) const { return accessNotInClass; } AccessResult Node::getProlog(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getEpilog(NodeListPtr &) const { return accessNotInClass; } AccessResult Node::getDocumentElement(NodePtr &) const { return accessNotInClass; } AccessResult Node::getElements(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getEntities(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getDefaultedEntities(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getGoverningDoctype(NodePtr &) const { return accessNotInClass; } AccessResult Node::getDoctypesAndLinktypes(NamedNodeListPtr &) const { return accessNotInClass; } AccessResult Node::getNonSgml(unsigned long &) const { return accessNotInClass; } AccessResult Node::getOwnerType(OwnerType::Enum &) const { return accessNotInClass; } AccessResult Node::getOwnerId(GroveString &) const { return accessNotInClass; } AccessResult Node::getTextClass(TextClass::Enum &) const { return accessNotInClass; } AccessResult Node::getUnavailable(bool &) const { return accessNotInClass; } AccessResult Node::getTextDescription(GroveString &) const { return accessNotInClass; } AccessResult Node::getTextLanguage(GroveString &) const { return accessNotInClass; } AccessResult Node::getTextDesignatingSequence(GroveString &) const { return accessNotInClass; } AccessResult Node::getTextDisplayVersion(GroveString &) const { return accessNotInClass; } AccessResult Node::nextSibling(NodePtr &) const { return accessNotInClass; } AccessResult Node::nextChunkAfter(NodePtr &nd) const { AccessResult ret = firstChild(nd); switch (ret) { case accessOK: case accessTimeout: return ret; default: break; } for (;;) { ret = nextChunkSibling(nd); switch (ret) { case accessOK: case accessTimeout: return ret; default: break; } ret = getParent(nd); if (ret != accessOK) break; } return ret; } AccessResult Node::nextChunkSibling(NodePtr &) const { return accessNotInClass; } AccessResult Node::firstChild(NodePtr &) const { return accessNotInClass; } AccessResult Node::charChunk(const SdataMapper &, GroveString &) const { return accessNotInClass; } AccessResult Node::firstSibling(NodePtr &) const { return accessNotInClass; } AccessResult Node::siblingsIndex(unsigned long &) const { return accessNotInClass; } AccessResult Node::tokens(GroveString &) const { return accessNotInClass; } unsigned long Node::hash() const { // Hopefully implementations will do better. return 0; } AccessResult Node::elementIndex(unsigned long &) const { return accessNotInClass; } bool Node::chunkContains(const Node &nd) const { return *this == nd; } AccessResult Node::attributeRef(unsigned long n, NodePtr &ptr) const { NamedNodeListPtr atts; AccessResult ret = getAttributes(atts); if (ret != accessOK) return ret; return atts->nodeList()->ref(n, ptr); } AccessResult Node::followSiblingRef(unsigned long n, NodePtr &ptr) const { if (n == 0) return nextSibling(ptr); NodePtr tem; AccessResult ret = nextSibling(tem); if (ret != accessOK) return ret; while (--n > 0) { ret = tem.assignNextSibling(); if (ret != accessOK) return ret; } return tem->nextSibling(ptr); } AccessResult Node::property(ComponentName::Id id, const SdataMapper &mapper, PropertyValue &value) const { AccessResult ret; switch (id) { default: ret = accessNotInClass; break; case ComponentName::idEntityType: { EntityType::Enum type; ret = getEntityType(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case EntityType::##e: value.set(ComponentName::id##E); break; ENUM(text, Text) ENUM(cdata, Cdata) ENUM(sdata, Sdata) ENUM(ndata, Ndata) ENUM(pi, Pi) ENUM(subdocument, Subdocument) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idDeclValueType: { DeclValueType::Enum type; ret = getDeclValueType(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case DeclValueType::##e: value.set(ComponentName::id##E); break; ENUM(cdata, Cdata) ENUM(entity, Entity) ENUM(entities, Entities) ENUM(id, Id) ENUM(idref, Idref) ENUM(idrefs, Idrefs) ENUM(name, Name) ENUM(names, Names) ENUM(nmtoken, Nmtoken) ENUM(nmtokens, Nmtokens) ENUM(number, Number) ENUM(numbers, Numbers) ENUM(nutoken, Nutoken) ENUM(nutokens, Nutokens) ENUM(notation, Notation) ENUM(nmtkgrp, Nmtkgrp) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idDefaultValueType: { DefaultValueType::Enum type; ret = getDefaultValueType(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case DefaultValueType::##e: value.set(ComponentName::id##E); break; ENUM(value, Value) ENUM(fixed, Fixed) ENUM(required, Required) ENUM(current, Current) ENUM(conref, Conref) ENUM(implied, Implied) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idContentType: { ContentType::Enum type; ret = getContentType(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case ContentType::##e: value.set(ComponentName::id##E); break; ENUM(cdata, Cdata) ENUM(rcdata, Rcdata) ENUM(empty, Empty) ENUM(any, Any) ENUM(modelgrp, ModelGroup) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idConnector: { Connector::Enum type; ret = getConnector(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case Connector::##e: value.set(ComponentName::id##E); break; ENUM(and_, And) ENUM(or_, Or) ENUM(seq, Seq) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idOwnerType: { OwnerType::Enum type; ret = getOwnerType(type); if (ret == accessOK) { switch (type) { #define ENUM(e, E) case OwnerType::##e: value.set(ComponentName::id##E); break; ENUM(iso, Iso) ENUM(registered, Registered) ENUM(unregistered, Unregistered) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idTextClass: { TextClass::Enum tclass; ret = getTextClass(tclass); if (ret == accessOK) { switch (tclass) { #define ENUM(e, E) case TextClass::##e: value.set(ComponentName::id##E); break; ENUM(capacity, Capacity) ENUM(charset, Charset) ENUM(document, Document) ENUM(dtd, Dtd) ENUM(elements, Elements) ENUM(entities, Entities) ENUM(lpd, Lpd) ENUM(nonsgml, Nonsgml) ENUM(notation, Notation) ENUM(shortref, Shortref) ENUM(subdoc, Subdoc) ENUM(syntax, Syntax) ENUM(text, Text) #undef ENUM default: ret = accessNotInClass; } } break; } case ComponentName::idChar: { GroveChar tem; ret = getChar(mapper, tem); if (ret == accessOK) value.set(tem); break; } case ComponentName::idElementTypes: { // ElementTypes is special since it occurs as // named-node-list and as node-list. if (&classDef() == &ClassDef::documentType) { NamedNodeListPtr tem; ret = getElementTypes(tem); if (ret == accessOK) value.set(tem); } else if (&classDef() == &ClassDef::rankStem) { NodeListPtr tem; ret = getElementTypes(tem); if (ret == accessOK) value.set(tem); } else ret = accessNotInClass; break; } #define PROP(Name, Type) \ case ComponentName::id##Name: \ { \ Type tem; \ ret = get##Name(tem); \ if (ret == accessOK) \ value.set(tem); \ break; \ } #define PROP_BOOLEAN(name) PROP(name, bool) #define PROP_CHAR(name) PROP(name, GroveChar) #define PROP_COMPNAME(name) PROP(name, ComponentName::Id) #define PROP_CNMLIST(name) PROP(name, const ComponentName::Id *) #define PROP_STRING(name) PROP(name, GroveString) #define PROP_NODE(name) PROP(name, NodePtr) #define PROP_NODELIST(name) PROP(name, NodeListPtr) #define PROP_NMNDLIST(name) PROP(name, NamedNodeListPtr) #define PROP_STRINGLIST(name) PROP(name, GroveStringListPtr) #define PROP_INTEGER(name) PROP(name, long) PROP_COMPNAME(ClassName) PROP_COMPNAME(ChildrenPropertyName) PROP_COMPNAME(DataPropertyName) PROP_COMPNAME(DataSepPropertyName) PROP_COMPNAME(OriginToSubnodeRelPropertyName) PROP_CNMLIST(SubnodePropertyNames) PROP_CNMLIST(AllPropertyNames) PROP_BOOLEAN(Defaulted) PROP_BOOLEAN(Governing) PROP_BOOLEAN(Implied) PROP_BOOLEAN(Included) PROP_BOOLEAN(MustOmitEndTag) PROP_BOOLEAN(OmitEndTag) PROP_BOOLEAN(OmitStartTag) PROP_BOOLEAN(Unavailable) PROP_STRINGLIST(RankGroup) PROP_STRING(RankStem) PROP_STRING(RankSuffix) PROP_STRING(Stem) PROP_STRING(OwnerId) PROP_STRING(TextDescription) PROP_STRING(TextLanguage) PROP_STRING(TextDesignatingSequence) PROP_STRING(TextDisplayVersion) PROP_CHAR(TokenSep) PROP_NMNDLIST(Attributes) PROP_NMNDLIST(DefaultedEntities) PROP_NMNDLIST(DoctypesAndLinktypes) PROP_NMNDLIST(Elements) PROP_NMNDLIST(Entities) PROP_NMNDLIST(GeneralEntities) PROP_NMNDLIST(Notations) PROP_NMNDLIST(AttributeDefs) PROP_NMNDLIST(ParameterEntities) PROP_NODE(DocumentElement) PROP_NODE(Entity) PROP_NODE(ExternalId) PROP_NODE(GoverningDoctype) PROP_NODE(GroveRoot) PROP_NODE(Notation) PROP_NODE(Origin) PROP_NODE(Parent) PROP_NODE(Referent) PROP_NODE(SgmlConstants) PROP_NODE(TreeRoot) PROP_NODE(ModelGroup) PROP_NODE(DefaultEntity) PROP_NODE(ElementType) PROP_NODE(FormalPublicId) PROP_NODELIST(Content) PROP_NODELIST(Epilog) PROP_NODELIST(Prolog) PROP_NODELIST(Value) PROP_NODELIST(ContentTokens) PROP_NODELIST(DefaultValue) PROP_NODELIST(CurrentGroup) PROP_STRING(ApplicationInfo) PROP_STRING(EntityName) PROP_STRING(GeneratedSystemId) PROP_STRING(Gi) PROP_STRING(Id) PROP_STRING(Name) PROP_STRING(NotationName) PROP_STRING(PublicId) PROP_STRING(SystemData) PROP_STRING(SystemId) PROP_STRING(Text) PROP_STRING(Token) PROP_STRINGLIST(Exclusions) PROP_STRINGLIST(Inclusions) PROP_STRINGLIST(Tokens) PROP_INTEGER(CurrentAttributeIndex) } #undef PROP #undef PROP_BOOLEAN #undef PROP_CHAR #undef PROP_NMNDLIST #undef PROP_NODE #undef PROP_NODELIST #undef PROP_STRING return ret; } AccessResult NodeList::ref(unsigned long n, NodePtr &ptr) const { if (n == 0) return first(ptr); NodeListPtr tem; AccessResult ret = rest(tem); if (ret != accessOK) return ret; while (--n > 0) { ret = tem.assignRest(); if (ret != accessOK) return ret; } return tem->first(ptr); } NodeListPtr NamedNodeList::nodeListNoOrder() const { return nodeList(); } struct NodeNameNodeVisitor : public NodeVisitor { NodeNameNodeVisitor(NamedNodeList::Type t, GroveString &name) : ret(accessNotInClass), type(t), nameP(&name) { } AccessResult ret; GroveString *nameP; NamedNodeList::Type type; void element(Node &nd) { if (type == NamedNodeList::elements) ret = nd.getId(*nameP); } void attributeAssignment(Node &nd) { if (type == NamedNodeList::attributes) ret = nd.getName(*nameP); } void documentType(Node &nd) { if (type == NamedNodeList::doctypesAndLinktypes) ret = nd.getName(*nameP); } void entity(Node &nd) { if (type == NamedNodeList::entities) ret = nd.getName(*nameP); } void notation(Node &nd) { if (type == NamedNodeList::notations) ret = nd.getName(*nameP); } void elementType(Node &nd) { if (type == NamedNodeList::elementTypes) ret = nd.getGi(*nameP); } void attributeDef(Node &nd) { if (type == NamedNodeList::attributeDefs) ret = nd.getName(*nameP); } }; AccessResult NamedNodeList::nodeName(const NodePtr &node, GroveString &name) const { NodeNameNodeVisitor v(type(), name); node->accept(v); return v.ret; } void NodeVisitor::sgmlDocument(Node &) { } void NodeVisitor::sgmlConstants(Node &) { } void NodeVisitor::dataChar(Node &) { } void NodeVisitor::element(Node &) { } void NodeVisitor::attributeAssignment(Node &) { } void NodeVisitor::attributeDef(Node &) { } void NodeVisitor::attributeValueToken(Node &) { } void NodeVisitor::pi(Node &) { } void NodeVisitor::sdata(Node &) { } void NodeVisitor::documentType(Node &) { } void NodeVisitor::entity(Node &) { } void NodeVisitor::notation(Node &) { } void NodeVisitor::externalId(Node &) { } void NodeVisitor::externalData(Node &) { } void NodeVisitor::subdocument(Node &) { } void NodeVisitor::nonSgml(Node &) { } void NodeVisitor::message(Node &) { } void NodeVisitor::elementType(Node &) { } void NodeVisitor::rankStem(Node &) { } void NodeVisitor::modelGroup(Node &) { } void NodeVisitor::elementToken(Node &) { } void NodeVisitor::pcdataToken(Node &) { } void NodeVisitor::defaultEntity(Node &) { } void NodeVisitor::formalPublicId(Node &) { } bool GroveString::operator==(const GroveString &str) const { if (size() != str.size()) return 0; if (size() == 0) return 1; if (memcmp(data(), str.data(), size() * sizeof(GroveChar)) == 0) return 1; return 0; } void GroveStringList::append(const GroveString &gs) { GroveStringLink **pp; for (pp = &head_; *pp; pp = &(*pp)->next_) ; *pp = new GroveStringLink( gs ); if (iter_.done()) iter_.attach(head_); } AccessResult GroveStringList::first(GroveString &str) const { if (head_ == 0) return accessNull; str = head_->data_; return accessOK; } AccessResult GroveStringList::rest(GroveStringListPtr &ptr) const { if (canReuse(ptr)) { GroveStringList *list = (GroveStringList *)this; if (list->iter_.done()) return accessNull; list->iter_.next(); return accessOK; } ptr.assign(new GroveStringList()); ConstGroveStringListIter iter(iter_); if (iter.done()) return accessNull; iter.next(); while (!iter.done()) { ptr->append(iter.cur()); iter.next(); } return accessOK; } void GroveStringList::release() { assert(refCount_ != 0); if (--refCount_ == 0) delete this; } void GroveStringList::addRef() { ++refCount_; } bool GroveStringList::canReuse(GroveStringListPtr &ptr) const { const GroveStringList *tem = &*ptr; return tem == this && refCount_ == 1; } GroveStringList::~GroveStringList() { GroveStringLink *tmpPtr; GroveStringLink *ptr = head_; while (ptr) { tmpPtr = ptr; ptr = ptr->next_; delete tmpPtr; } } ConstGroveStringListIter::ConstGroveStringListIter(const GroveStringList &list) : link_(list.head_) { } SdataMapper::~SdataMapper() { } bool SdataMapper::sdataMap(GroveString name, GroveString text, GroveChar &) const { return 0; } const char *ComponentName::rcsName(Id id) { static const char *const names[] = { "allpns", "and", "any", "appinfo", "attasgn", "attdef", "attdefs", "atts", "attvaltk", "capacity", "cdata", "char", "charset", "childpn", "classnm", "connect", "conref", "content", "tokens", "contype", "current", "curattix", "curgrp", "datachar", "datapn", "dseppn", "dcltype", "dflted", "dfltents", "dfltent", "dfltval", "dflttype", "dtlts", "document", "docelem", "doctype", "dtd", "element", "elements", "elemtk", "elemtype", "elemtps", "empty", "entities", "entity", "entname", "enttype", "epilog", "excls", "extdata", "extid", "fixed", "fpi", "genents", "gensysid", "gi", "govrning", "govdt", "grovroot", "id", "idref", "idrefs", "implied", "included", "incls", "iso", "lpd", "modelgrp", "momitend", "name", "names", "ndata", "nmtkgrp", "nmtoken", "nmtokens", "nonsgml", "notation", "notname", "nots", "number", "numbers", "nutoken", "nutokens", "occur", "omitend", "omitstrt", "opt", "or", "origin", "otsrelpn", "ownerid", "ownertp", "parments", "parent", "pcdatatk", "pi", "plus", "prolog", "pubid", "rankgrp", "rankstem", "ranksuff", "rcdata", "referent", "regist", "rep", "required", "sdata", "seq", "sgmlcsts", "sgmldoc", "shortref", "stem", "subdoc", "subdoc", "subpns", "syntax", "sysdata", "sysid", "text", "textclas", "textdesc", "textdseq", "textdver", "textlang", "token", "tokens", "tokensep", "treeroot", "unavail", "unregist", "value" }; if (id < 0 || id >= SIZEOF(names)) return 0; return names[id]; } const char *ComponentName::sdqlName(Id id) { static const char *const names[] = { "all-property-names", "and", "any", "application-info", "attribute-assignment", "attribute-def", "attribute-defs", "attributes", "attribute-value-token", "capacity", "cdata", "char", "charset", "children-property-name", "class-name", "connector", "conref", "content", "content-tokens", "content-type", "current", "current-attribute-index", "current-group", "data-char", "data-property-name", "data-sep-property-name", "decl-value-type", "defaulted?", "defaulted-entities", "default-entity", "default-value", "default-value-type", "doctypes-and-linktypes", "document", "document-element", "document-type", "dtd", "element", "elements", "element-token", "element-type", "element-types", "empty", "entities", "entity", "entity-name", "entity-type", "epilog", "exclusions", "external-data", "external-id", "fixed", "formal-public-id", "general-entities", "generated-system-id", "gi", "governing?", "governing-doctype", "grove-root", "id", "idref", "idrefs", "implied?", "included?", "inclusions", "iso", "lpd", "model-group", "must-omit-end-tag?", "name", "names", "ndata", "name-token-group", "nmtoken", "nmtokens", "nonsgml", "notation", "notation-name", "notations", "number", "numbers", "nutoken", "nutokens", "occur-indicator", "omit-end-tag?", "omit-start-tag?", "opt", "or", "origin", "origin-to-subnode-rel-property-name", "owner-id", "owner-type", "parameter-entities", "parent", "pcdata-token", "pi", "plus", "prolog", "public-id", "rank-group", "rank-stem", "rank-suffix", "rcdata", "referent", "registered", "rep", "required", "sdata", "seq", "sgml-constants", "sgml-document", "shortref", "stem", "subdoc", "subdocument", "subnode-property-names", "syntax", "system-data", "system-id", "text", "text-class", "text-description", "text-designating-sequence", "text-display-version", "text-language", "token", "tokens", "token-sep", "tree-root", "unavailable", "unregistered", "value" }; if (id < 0 || id >= SIZEOF(names)) return 0; return names[id]; } #define INTRINSIC_PROPS \ ComponentName::idClassName, \ ComponentName::idGroveRoot, \ ComponentName::idSubnodePropertyNames, \ ComponentName::idAllPropertyNames, \ ComponentName::idChildrenPropertyName, \ ComponentName::idDataPropertyName, \ ComponentName::idDataSepPropertyName, \ ComponentName::idParent, \ ComponentName::idTreeRoot, \ ComponentName::idOrigin, \ ComponentName::idOriginToSubnodeRelPropertyName static const ComponentName::Id noProps[] = { ComponentName::noId }; static const ComponentName::Id allProps_externalId[] = { INTRINSIC_PROPS, ComponentName::idPublicId, ComponentName::idSystemId, ComponentName::idGeneratedSystemId, ComponentName::idFormalPublicId, ComponentName::noId }; static const ComponentName::Id subnodeProps_externalId[] = { ComponentName::idFormalPublicId, ComponentName::noId }; const ClassDef ClassDef::externalId = { ComponentName::idExternalId, allProps_externalId, subnodeProps_externalId, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_documentType[] = { INTRINSIC_PROPS, ComponentName::idName, ComponentName::idElementTypes, ComponentName::idGoverning, ComponentName::idGeneralEntities, ComponentName::idNotations, ComponentName::idDefaultEntity, ComponentName::idParameterEntities, ComponentName::noId }; static const ComponentName::Id subnodeProps_documentType[] = { ComponentName::idGeneralEntities, ComponentName::idNotations, ComponentName::idElementTypes, ComponentName::idDefaultEntity, ComponentName::idParameterEntities, ComponentName::noId }; const ClassDef ClassDef::documentType = { ComponentName::idDocumentType, allProps_documentType, subnodeProps_documentType, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_attributeValueToken[] = { INTRINSIC_PROPS, ComponentName::idToken, ComponentName::idEntity, ComponentName::idNotation, ComponentName::idReferent, ComponentName::noId }; const ClassDef ClassDef::attributeValueToken = { ComponentName::idAttributeValueToken, allProps_attributeValueToken, noProps, ComponentName::noId, ComponentName::idToken, ComponentName::noId }; static const ComponentName::Id allProps_sgmlDocument[] = { INTRINSIC_PROPS, ComponentName::idSgmlConstants, ComponentName::idApplicationInfo, ComponentName::idProlog, ComponentName::idEpilog, ComponentName::idGoverningDoctype, ComponentName::idDoctypesAndLinktypes, ComponentName::idDocumentElement, ComponentName::idElements, ComponentName::idEntities, ComponentName::idDefaultedEntities, ComponentName::noId }; static const ComponentName::Id subnodeProps_sgmlDocument[] = { ComponentName::idSgmlConstants, ComponentName::idProlog, ComponentName::idEpilog, ComponentName::idDoctypesAndLinktypes, ComponentName::idDocumentElement, ComponentName::idDefaultedEntities, ComponentName::noId }; const ClassDef ClassDef::sgmlDocument = { ComponentName::idSgmlDocument, allProps_sgmlDocument, subnodeProps_sgmlDocument, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_dataChar[] = { INTRINSIC_PROPS, ComponentName::idChar, ComponentName::noId }; const ClassDef ClassDef::dataChar = { ComponentName::idDataChar, allProps_dataChar, noProps, ComponentName::noId, ComponentName::idChar, ComponentName::noId }; static const ComponentName::Id allProps_subdocument[] = { INTRINSIC_PROPS, ComponentName::idEntityName, ComponentName::idEntity, ComponentName::noId }; const ClassDef ClassDef::subdocument = { ComponentName::idSubdocument, allProps_subdocument, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_pi[] = { INTRINSIC_PROPS, ComponentName::idSystemData, ComponentName::idEntityName, ComponentName::idEntity, ComponentName::noId }; const ClassDef ClassDef::pi = { ComponentName::idPi, allProps_pi, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_element[] = { INTRINSIC_PROPS, ComponentName::idGi, ComponentName::idId, ComponentName::idAttributes, ComponentName::idContent, ComponentName::idIncluded, ComponentName::idMustOmitEndTag, ComponentName::idElementType, ComponentName::noId }; static const ComponentName::Id subnodeProps_element[] = { ComponentName::idAttributes, ComponentName::idContent, ComponentName::noId }; const ClassDef ClassDef::element = { ComponentName::idElement, allProps_element, subnodeProps_element, ComponentName::idContent, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_notation[] = { INTRINSIC_PROPS, ComponentName::idName, ComponentName::idExternalId, ComponentName::idAttributeDefs, ComponentName::noId }; static const ComponentName::Id subnodeProps_notation[] = { ComponentName::idExternalId, ComponentName::idAttributeDefs, ComponentName::noId }; const ClassDef ClassDef::notation = { ComponentName::idNotation, allProps_notation, subnodeProps_notation, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_externalData[] = { INTRINSIC_PROPS, ComponentName::idEntityName, ComponentName::idEntity, ComponentName::noId }; const ClassDef ClassDef::externalData = { ComponentName::idExternalData, allProps_externalData, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_attributeAssignment[] = { INTRINSIC_PROPS, ComponentName::idAttributeDef, ComponentName::idValue, ComponentName::idName, ComponentName::idImplied, ComponentName::idTokenSep, ComponentName::noId }; static const ComponentName::Id subnodeProps_attributeAssignment[] = { ComponentName::idValue, ComponentName::noId }; const ClassDef ClassDef::attributeAssignment = { ComponentName::idAttributeAssignment, allProps_attributeAssignment, subnodeProps_attributeAssignment, ComponentName::idValue, ComponentName::noId, ComponentName::idTokenSep }; static const ComponentName::Id allProps_sdata[] = { INTRINSIC_PROPS, ComponentName::idSystemData, ComponentName::idChar, ComponentName::idEntityName, ComponentName::idEntity, ComponentName::noId }; const ClassDef ClassDef::sdata = { ComponentName::idSdata, allProps_sdata, noProps, ComponentName::noId, ComponentName::idChar, ComponentName::noId }; static const ComponentName::Id allProps_entity[] = { INTRINSIC_PROPS, ComponentName::idName, ComponentName::idEntityType, ComponentName::idText, ComponentName::idExternalId, ComponentName::idAttributes, ComponentName::idNotationName, ComponentName::idNotation, ComponentName::idDefaulted, ComponentName::noId }; static const ComponentName::Id subnodeProps_entity[] = { ComponentName::idExternalId, ComponentName::idAttributes, ComponentName::noId }; const ClassDef ClassDef::entity = { ComponentName::idEntity, allProps_entity, subnodeProps_entity, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_sgmlConstants[] = { INTRINSIC_PROPS, ComponentName::noId }; const ClassDef ClassDef::sgmlConstants = { ComponentName::idSgmlConstants, allProps_sgmlConstants, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; // FIXME const ClassDef ClassDef::nonSgml = { ComponentName::noId, noProps, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; // FIXME const ClassDef ClassDef::message = { ComponentName::noId, noProps, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_attributeDef[] = { INTRINSIC_PROPS, ComponentName::idCurrentAttributeIndex, ComponentName::idCurrentGroup, ComponentName::idDeclValueType, ComponentName::idDefaultValueType, ComponentName::idDefaultValue, ComponentName::idName, ComponentName::idTokens, ComponentName::noId }; static const ComponentName::Id subnodeProps_attributeDef[] = { ComponentName::idDefaultValue, ComponentName::noId }; const ClassDef ClassDef::attributeDef = { ComponentName::idAttributeDef, allProps_attributeDef, subnodeProps_attributeDef, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_elementType[] = { INTRINSIC_PROPS, ComponentName::idAttributeDefs, ComponentName::idContentType, ComponentName::idExclusions, ComponentName::idGi, ComponentName::idInclusions, ComponentName::idModelGroup, ComponentName::idOmitEndTag, ComponentName::idOmitStartTag, ComponentName::idRankGroup, ComponentName::idRankStem, ComponentName::idRankSuffix, ComponentName::noId }; static const ComponentName::Id subnodeProps_elementType[] = { ComponentName::idAttributeDefs, ComponentName::idModelGroup, ComponentName::noId }; const ClassDef ClassDef::elementType = { ComponentName::idElementType, allProps_elementType, subnodeProps_elementType, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_modelGroup[] = { INTRINSIC_PROPS, ComponentName::idConnector, ComponentName::idOccurenceIndicator, ComponentName::idContentTokens, ComponentName::noId }; static const ComponentName::Id subnodeProps_modelGroup[] = { ComponentName::idContentTokens, ComponentName::noId }; const ClassDef ClassDef::modelGroup = { ComponentName::idModelGroup, allProps_modelGroup, subnodeProps_modelGroup, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_elementToken[] = { INTRINSIC_PROPS, ComponentName::idGi, ComponentName::idOccurenceIndicator, ComponentName::noId }; const ClassDef ClassDef::elementToken = { ComponentName::idElementToken, allProps_elementToken, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_pcdataToken[] = { INTRINSIC_PROPS, ComponentName::noId }; const ClassDef ClassDef::pcdataToken = { ComponentName::idPcdataToken, allProps_pcdataToken, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_defaultEntity[] = { INTRINSIC_PROPS, ComponentName::idName, ComponentName::idEntityType, ComponentName::idText, ComponentName::idExternalId, ComponentName::idAttributes, ComponentName::idNotationName, ComponentName::idNotation, ComponentName::noId }; static const ComponentName::Id subnodeProps_defaultEntity[] = { ComponentName::idExternalId, ComponentName::idAttributes, ComponentName::noId }; const ClassDef ClassDef::defaultEntity = { ComponentName::idDefaultEntity, allProps_defaultEntity, subnodeProps_defaultEntity, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_rankStem[] = { INTRINSIC_PROPS, ComponentName::idStem, ComponentName::idElementType, ComponentName::noId }; const ClassDef ClassDef::rankStem = { ComponentName::idRankStem, allProps_rankStem, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; static const ComponentName::Id allProps_formalPublicId[] = { INTRINSIC_PROPS, ComponentName::idOwnerType, ComponentName::idOwnerId, ComponentName::idTextClass, ComponentName::idTextDescription, ComponentName::idTextDesignatingSequence, ComponentName::idTextDisplayVersion, ComponentName::idTextLanguage, ComponentName::noId }; const ClassDef ClassDef::formalPublicId = { ComponentName::idFormalPublicId, allProps_formalPublicId, noProps, ComponentName::noId, ComponentName::noId, ComponentName::noId }; #ifdef GROVE_NAMESPACE } #endif OpenJade-1.4devel/grove/LocNode.h0000644000021000000240000000147607025631162012353 // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #ifndef LocNode_INCLUDED #define LocNode_INCLUDED 1 #include #include "Node.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class Location; #ifdef GROVE_NAMESPACE #define GROVE_NAMESPACE_SCOPE GROVE_NAMESPACE:: #else #define GROVE_NAMESPACE_SCOPE #endif class GROVE_API LocNode { public: virtual GROVE_NAMESPACE_SCOPE AccessResult getLocation(Location &) const = 0; static const GROVE_NAMESPACE_SCOPE Node::IID iid; static const LocNode *convert(const GROVE_NAMESPACE_SCOPE NodePtr &nd) { const void *p; if (nd && nd->queryInterface(iid, p)) return (const LocNode *)p; else return 0; } }; #undef GROVE_NAMESPACE_SCOPE #ifdef SP_NAMESPACE } #endif #endif /* not LocNode_INCLUDED */ OpenJade-1.4devel/grove/LocNode.cxx0000644000021000000240000000047307025631162012722 // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #include "config.h" #include "LocNode.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif const Node::IID LocNode::iid = "LocNode"; #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/grove/grove.dsp0000644000021000000240000001055107025631162012503 # Microsoft Developer Studio Project File - Name="grove" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=grove - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "grove.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "grove.mak" CFG="grove - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "grove - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "grove - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "grove - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir ".\Release" # PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /D "BUILD_LIBGROVE" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20200000" /subsystem:windows /dll /machine:I386 /out:"..\bin\ogrove.dll" /base:0x24000000 # SUBTRACT LINK32 /profile /map !ELSEIF "$(CFG)" == "grove - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir ".\Debug" # PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /D "BUILD_LIBGROVE" /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20200000" /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\ogrove.dll" /base:0x24000000 # SUBTRACT LINK32 /incremental:no !ENDIF # Begin Target # Name "grove - Win32 Release" # Name "grove - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" # Begin Source File SOURCE=.\LocNode.cxx # End Source File # Begin Source File SOURCE=.\Node.cxx # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # Begin Source File SOURCE=.\LocNode.h # End Source File # Begin Source File SOURCE=.\Node.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" # End Group # End Target # End Project OpenJade-1.4devel/spgrove/0000777000021000000240000000000007070410055011272 5OpenJade-1.4devel/spgrove/Makefile.in0000644000021000000240000002422707070410055013262 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ lib_LTLIBRARIES = libospgrove.la libospgrove_la_LDFLAGS = -version-info 0:0:0 libospgrove_la_SOURCES = GroveApp.cxx GroveApp.h GroveBuilder.cxx GroveBuilder.h SdNode.cxx SdNode.h threads.h pkginclude_HEADERS = GroveApp.h GroveBuilder.h INCLUDES = -I$(top_srcdir)/grove EXTRA_DIST = grove_inst.m4 grove_inst.cxx spgrove.dsp BUILT_SOURCES = grove_inst.cxx SUFFIXES = .m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libospgrove_la_LIBADD = libospgrove_la_OBJECTS = GroveApp.lo GroveBuilder.lo SdNode.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(pkginclude_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libospgrove_la_SOURCES) OBJECTS = $(libospgrove_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cxx .lo .m4 .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps spgrove/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) distclean-libLTLIBRARIES: maintainer-clean-libLTLIBRARIES: install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: libospgrove.la: $(libospgrove_la_OBJECTS) $(libospgrove_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libospgrove_la_LDFLAGS) $(libospgrove_la_OBJECTS) $(libospgrove_la_LIBADD) $(LIBS) .cxx.o: $(CXXCOMPILE) -c $< .cxx.lo: $(LTCXXCOMPILE) -c $< install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) list='$(pkginclude_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = spgrove distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done GroveApp.lo GroveApp.o : GroveApp.cxx ../config.h GroveApp.h \ GroveBuilder.h ../grove/Node.h threads.h GroveBuilder.lo GroveBuilder.o : GroveBuilder.cxx ../config.h \ ../grove/Node.h GroveBuilder.h ../grove/LocNode.h SdNode.h \ threads.h grove_inst.cxx SdNode.lo SdNode.o : SdNode.cxx ../config.h SdNode.h ../grove/Node.h \ GroveBuilder.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-libLTLIBRARIES install-exec: install-exec-am install-data-am: install-pkgincludeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-libLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ distclean-compile clean-compile maintainer-clean-compile \ mostlyclean-libtool distclean-libtool clean-libtool \ maintainer-clean-libtool uninstall-pkgincludeHEADERS \ install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/spgrove/Makefile.am0000644000021000000240000000075207067706475013272 ## Process this file with automake to produce Makefile.in lib_LTLIBRARIES = libospgrove.la libospgrove_la_LDFLAGS = -version-info 0:0:0 libospgrove_la_SOURCES = GroveApp.cxx GroveApp.h GroveBuilder.cxx \ GroveBuilder.h SdNode.cxx SdNode.h threads.h pkginclude_HEADERS = GroveApp.h GroveBuilder.h INCLUDES = -I$(top_srcdir)/grove EXTRA_DIST = grove_inst.m4 grove_inst.cxx spgrove.dsp BUILT_SOURCES = grove_inst.cxx SUFFIXES = .m4 .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ OpenJade-1.4devel/spgrove/GroveApp.cxx0000644000021000000240000000206407031714461013464 // Copyright (c) 1996 James Clark // See the file COPYING for copying permission. #ifdef __GNUG__ #pragma implementation #endif #include "config.h" #include "GroveApp.h" #include "GroveBuilder.h" #include "threads.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif GroveApp::GroveApp(const char *requiredCodingSystem) : ParserApp(requiredCodingSystem) { } static int generateEventsThread(void *args) { return ((GroveApp::GenerateEventArgs *)args)->run(); } int GroveApp::generateEvents(ErrorCountEventHandler *eceh) { #if 0 int ret = ParserApp::generateEvents(eceh); processGrove(); return ret; #else GenerateEventArgs args(eceh, this); Thread thread(generateEventsThread, &args); processGrove(); rootNode_.clear(); return thread.wait(); #endif } ErrorCountEventHandler *GroveApp::makeEventHandler() { return GroveBuilder::make(0, this, this, 0, rootNode_); } void GroveApp::dispatchMessage(const Message &message) { static Mutex mutex; Mutex::Lock lock(&mutex); MessageReporter::dispatchMessage(message); } #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/spgrove/GroveApp.h0000644000021000000240000000252507025631167013117 // Copyright (c) 1996 James Clark // See the file COPYING for copying permission. #ifndef GroveApp_INCLUDED #define GroveApp_INCLUDED 1 #ifdef __GNUG__ #pragma interface #endif #include #include "GroveBuilder.h" #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class SPGROVE_API GroveApp : public ParserApp { public: GroveApp(const char *requiredCodingSystem = 0); ErrorCountEventHandler *makeEventHandler(); int generateEvents(ErrorCountEventHandler *eceh); virtual void processGrove() = 0; class GenerateEventArgs { public: int run() { return app_->inheritedGenerateEvents(eceh_); } private: GenerateEventArgs(ErrorCountEventHandler *eceh, GroveApp *app) : app_(app), eceh_(eceh) { } ErrorCountEventHandler *eceh_; GroveApp *app_; friend class GroveApp; }; friend class GenerateEventArgs; void dispatchMessage(const Message &); protected: GROVE_NAMESPACE_SCOPE NodePtr rootNode_; private: int inheritedGenerateEvents(ErrorCountEventHandler *eceh) { return ParserApp::generateEvents(eceh); } }; inline OutputCharStream &operator<<(OutputCharStream &os, #ifdef GROVE_NAMESPACE GROVE_NAMESPACE:: #endif GroveString &str) { return os.write(str.data(), str.size()); } #ifdef SP_NAMESPACE } #endif #endif /* not GroveApp_INCLUDED */ OpenJade-1.4devel/spgrove/GroveBuilder.cxx0000644000021000000240000056744007067706475014367 // Copyright (c) 1996, 1997 James Clark // See the file COPYING for copying permission. // FIXME location for SgmlDocument node. #include "config.h" #include #include "Node.h" #include #include #include #include #include "GroveBuilder.h" #include #include #include #include #include #include #include #include "LocNode.h" #include "SdNode.h" #include "threads.h" #include #ifdef _MSC_VER #pragma warning ( disable : 4250 ) // inherits via dominance #endif #include #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif static bool blockingAccess = 1; size_t initialBlockSize = 8192; unsigned maxBlocksPerSize = 20; struct Chunk; struct ParentChunk; class ElementChunk; struct SgmlDocumentChunk; class DataChunk; class GroveImpl; class BaseNode; class ChunkNode; class ElementNode; class DataNode; class CdataAttributeValueNode; class AttributeValueTokenNode; class AttributeAsgnNode; class AttributeDefNode; class EntityNode; class NotationNode; class ExternalIdNode; class FormalPublicIdNode; class DocumentTypeNode; class SgmlConstantsNode; class MessageNode; class ElementTypeNode; class RankStemNode; class ModelGroupNode; class ElementTokenNode; class PcdataTokenNode; class DefaultEntityNode; struct Chunk { // second arg never null // Set ptr to a node pointing to first Node in this. virtual AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *) const = 0; virtual AccessResult setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const; virtual AccessResult setNodePtrFirst(NodePtr &ptr, const DataNode *node) const; virtual const Chunk *after() const = 0; virtual AccessResult getFollowing(const GroveImpl *, const Chunk *&, unsigned long &nNodes) const; virtual AccessResult getFirstSibling(const GroveImpl *, const Chunk *&) const; virtual const StringC *id() const; virtual Boolean getLocOrigin(const Origin *&) const; ParentChunk *origin; }; struct LocChunk : public Chunk { Index locIndex; }; struct ParentChunk : public LocChunk { ParentChunk() : nextSibling(0) { } Chunk *nextSibling; }; class ElementChunk : public ParentChunk { public: virtual const AttributeValue * attributeValue(size_t attIndex, const GroveImpl &grove) const; virtual Boolean mustOmitEndTag() const; virtual Boolean included() const; const AttributeDefinitionList *attDefList() const; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; AccessResult setNodePtrFirst(NodePtr &ptr, const DataNode *node) const; AccessResult setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const; static const StringC &key(const ElementChunk &chunk) { return *chunk.id(); } const Chunk *after() const; AccessResult getFollowing(const GroveImpl *, const Chunk *&, unsigned long &nNodes) const; const ElementType *elementType() const { return type; } private: friend class ElementNode; const ElementType *type; public: unsigned long elementIndex; }; inline const AttributeDefinitionList *ElementChunk::attDefList() const { return type->attributeDefTemp(); } class LocOriginChunk : public Chunk { public: LocOriginChunk(const Origin *lo) : locOrigin(lo) { } AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *) const; AccessResult setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const; AccessResult setNodePtrFirst(NodePtr &ptr, const DataNode *node) const; const Chunk *after() const; AccessResult getFollowing(const GroveImpl *, const Chunk *&, unsigned long &nNodes) const; Boolean getLocOrigin(const Origin *&) const; private: const Origin *locOrigin; }; class MessageItem { public: MessageItem(Node::Severity severity, const StringC &text, const Location &loc) : severity_(severity), text_(text), loc_(loc), next_(0) { } Node::Severity severity() const { return severity_; } const Location &loc() const { return loc_; } const StringC &text() const { return text_; } const MessageItem *next() const { return next_; } MessageItem **nextP() { return &next_; } private: Node::Severity severity_; StringC text_; Location loc_; MessageItem *next_; }; // multiple threads using const interface. class GroveImpl { public: GroveImpl(unsigned groveIndex); // Const interface void addRef() const { ++(((GroveImpl *)this)->refCount_); } void release() const { if (!--(((GroveImpl *)this)->refCount_)) delete (GroveImpl *)this; } unsigned groveIndex() const { return groveIndex_; } const SgmlDocumentChunk *root() const { return root_; } const AttributeValue *impliedAttributeValue() const { return impliedAttributeValue_.pointer(); } // Return 0 if not yet available. Boolean getAppinfo(const StringC *&) const; const SubstTable *generalSubstTable() const { return instanceSyntax_.isNull() ? 0 : instanceSyntax_->generalSubstTable(); } const SubstTable *entitySubstTable() const { return instanceSyntax_.isNull() ? 0 : instanceSyntax_->entitySubstTable(); } // Be careful not to change ref counts while accessing DTD. const Dtd *governingDtd() const { return dtd_.pointer(); } const Dtd *lookupDtd(const StringC &) const; const Dtd *lookupDtd(const ElementType &) const; const Dtd *lookupDtd(const RankStem &) const; const Dtd *firstDtd() const { return allDtds_.size() == 0 ? 0 : allDtds_.begin()->pointer(); } const Dtd *nextDtd(const Dtd *) const; // must not be called till grove is complete Dtd::ConstEntityIter defaultedEntityIter() const; const Entity *lookupDefaultedEntity(const StringC &) const; const ElementChunk *lookupElement(const StringC &) const; typedef PointerTableIter ElementIter; // must not be called till grove is complete ElementIter elementIter() const; Boolean complete() const { return complete_; } const void *completeLimit() const { return completeLimit_; } const void *completeLimitWithLocChunkAfter() const { return completeLimitWithLocChunkAfter_; } const Origin *currentLocOrigin() const { return currentLocOrigin_; } Boolean hasDefaultEntity() const { return hasDefaultEntity_; } Boolean maybeMoreSiblings(const ParentChunk *chunk) const; // return zero for timeout Boolean waitForMoreNodes() const; AccessResult proxifyLocation(const Location &, Location &) const; const MessageItem *messageList() const { return messageList_; } // must not be called till grove is complete void getSd(ConstPtr &, ConstPtr &, ConstPtr &) const; // non-const interface void *allocChunk(size_t); void appendSibling(Chunk *); void appendSibling(DataChunk *); Boolean tryExtend(size_t n) { if (n <= nFree_) { nFree_ -= n; freePtr_ += n; return 1; } else return 0; } DataChunk *pendingData() { return pendingData_; } void push(ElementChunk *, Boolean hasId); void pop(); void setAppinfo(const StringC &); void setGoverningDtd(const ConstPtr &dtd); void addDtd(const ConstPtr &dtd); void setSd(const ConstPtr &, const ConstPtr &, const ConstPtr &); void storeAttributeValue(const ConstPtr &value) { values_.push_back(value); } void addDefaultedEntity(const ConstPtr &); void setComplete(); Boolean haveRootOrigin(); void setLocOrigin(const ConstPtr &); void appendMessage(MessageItem *); private: GroveImpl(const GroveImpl &); void operator=(const GroveImpl &); ~GroveImpl(); Boolean maybeMoreSiblings1(const ParentChunk *) const; void *allocFinish(size_t); void pulse(); void maybePulse(); void finishDocumentElement(); void finishProlog(); void addBarrier(); void storeLocOrigin(const ConstPtr &); struct BlockHeader { BlockHeader() : next(0) { } BlockHeader *next; }; unsigned groveIndex_; SgmlDocumentChunk *root_; ParentChunk *origin_; DataChunk *pendingData_; Chunk **tailPtr_; ConstPtr dtd_; Vector > allDtds_; ConstPtr sd_; ConstPtr prologSyntax_; ConstPtr instanceSyntax_; ConstPtr impliedAttributeValue_; Vector > values_; Vector > origins_; NamedResourceTable defaultedEntityTable_; PointerTable idTable_; Boolean hasDefaultEntity_; Boolean haveAppinfo_; StringC appinfo_; const Origin *currentLocOrigin_; Boolean complete_; const void *completeLimit_; const void *completeLimitWithLocChunkAfter_; // pointer to first free byte in current block char *freePtr_; // free bytes in current block // there's space for a forwarding chunk after this if freePtr_ != 0 size_t nFree_; // the head of the list of blocks BlockHeader *blocks_; // where to store pointer to next block BlockHeader **blockTailPtr_; // current normal size for a block size_t blockAllocSize_; // number of blocks allocated at this size size_t nBlocksThisSizeAlloced_; RefCount refCount_; Condition moreNodesCondition_; Mutex mutex_; Mutex *mutexPtr_; unsigned pulseStep_; unsigned long nEvents_; unsigned long nElements_; enum { maxChunksWithoutLocOrigin = 100 }; unsigned nChunksSinceLocOrigin_; MessageItem *messageList_; MessageItem **messageListTailP_; }; class GroveImplPtr { public: GroveImplPtr(const GroveImpl *grove) : grove_(grove) { grove_->addRef(); } ~GroveImplPtr() { grove_->release(); } const GroveImpl *operator->() const { return grove_; } operator const GroveImpl *() const { return grove_; } private: GroveImplPtr(const GroveImplPtr &); // undefined void operator=(const GroveImplPtr &); // undefined const GroveImpl *grove_; }; class GroveImplProxyOrigin : public ProxyOrigin { public: GroveImplProxyOrigin(const GroveImpl *grove, const Origin *origin) : grove_(grove), ProxyOrigin(origin) { } private: GroveImplPtr grove_; }; class GroveBuilderMessageEventHandler : public ErrorCountEventHandler { public: GroveBuilderMessageEventHandler(unsigned groveIndex, Messenger *mgr, MessageFormatter *msgFmt_); ~GroveBuilderMessageEventHandler(); void message(MessageEvent *); void sgmlDecl(SgmlDeclEvent *); void makeInitialRoot(NodePtr &); void setSd(const ConstPtr &, const ConstPtr &, const ConstPtr &); protected: GroveImpl *grove_; private: Messenger *mgr_; MessageFormatter *msgFmt_; }; class GroveBuilderEventHandler : public GroveBuilderMessageEventHandler { public: GroveBuilderEventHandler(unsigned groveIndex, Messenger *mgr, MessageFormatter *msgFmt_); void appinfo(AppinfoEvent *); void startElement(StartElementEvent *); void endElement(EndElementEvent *); void data(DataEvent *); void sdataEntity(SdataEntityEvent *); void nonSgmlChar(NonSgmlCharEvent *); void externalDataEntity(ExternalDataEntityEvent *); void subdocEntity(SubdocEntityEvent *); void pi(PiEvent *); void endProlog(EndPrologEvent *); void endDtd(EndDtdEvent *); void entityDefaulted(EntityDefaultedEvent *); }; inline void setString(GroveString &to, const StringC &from) { to.assign(from.data(), from.size()); } inline bool operator==(const StringC &str1, const GroveString &str2) { return (str1.size() == str2.size() && memcmp(str1.data(), str2.data(), str1.size()*sizeof(Char)) == 0); } inline bool operator!=(const StringC &str1, const GroveString &str2) { return !(str1 == str2); } inline size_t roundUp(size_t n) { return (n + (sizeof(void *) - 1)) & ~(sizeof(void *) - 1); } // All nodes in this grove must be derived from BaseNode. class BaseNode : public Node, public LocNode { public: BaseNode(const GroveImpl *grove); virtual ~BaseNode(); void addRef(); void release(); bool canReuse(NodePtr &ptr) const; unsigned groveIndex() const; bool operator==(const Node &node) const; // Implemented with double dispatching. virtual bool same(const BaseNode &) const = 0; // The second half of the dispatch. virtual bool same2(const ChunkNode *) const; virtual bool same2(const DataNode *) const; virtual bool same2(const AttributeAsgnNode *) const; virtual bool same2(const AttributeValueTokenNode *) const; virtual bool same2(const CdataAttributeValueNode *) const; virtual bool same2(const EntityNode *) const; virtual bool same2(const NotationNode *) const; virtual bool same2(const ExternalIdNode *) const; virtual bool same2(const FormalPublicIdNode *) const; virtual bool same2(const DocumentTypeNode *) const; virtual bool same2(const SgmlConstantsNode *) const; virtual bool same2(const MessageNode *) const; virtual bool same2(const ElementTypeNode *) const; virtual bool same2(const RankStemNode *) const; virtual bool same2(const ModelGroupNode *) const; virtual bool same2(const ElementTokenNode *) const; virtual bool same2(const PcdataTokenNode *) const; virtual bool same2(const AttributeDefNode *) const; virtual bool same2(const DefaultEntityNode *) const; const GroveImpl *grove() const { return grove_; } AccessResult nextSibling(NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult follow(NodeListPtr &ptr) const; AccessResult children(NodeListPtr &) const; AccessResult getOrigin(NodePtr &ptr) const; AccessResult getGroveRoot(NodePtr &ptr) const; AccessResult getLocation(Location &) const; bool queryInterface(IID, const void *&) const; bool chunkContains(const Node &) const; bool inChunk(const DataNode *node) const; bool inChunk(const CdataAttributeValueNode *) const; protected: static unsigned long secondHash(unsigned long n) { return n * 1001; } private: unsigned refCount_; GroveImplPtr grove_; }; inline BaseNode::BaseNode(const GroveImpl *grove) : grove_(grove), refCount_(0) { } inline bool BaseNode::canReuse(NodePtr &ptr) const { const Node *tem = &*ptr; return tem == this && refCount_ == 1; } struct ForwardingChunk : Chunk { ForwardingChunk(const Chunk *to, ParentChunk *p) : forwardTo(to) { origin = p; } AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; AccessResult getFollowing(const GroveImpl *, const Chunk *&, unsigned long &nNodes) const; const Chunk *after() const { return forwardTo; } const Chunk *forwardTo; }; class ChunkNode : public BaseNode { public: ChunkNode(const GroveImpl *grove, const LocChunk *chunk); const LocChunk *chunk() const { return chunk_; } bool same(const BaseNode &node) const; bool same2(const ChunkNode *node) const; unsigned long hash() const; AccessResult getParent(NodePtr &ptr) const; AccessResult getTreeRoot(NodePtr &ptr) const; AccessResult getOrigin(NodePtr &) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &) const; AccessResult nextChunkSibling(NodePtr &) const; AccessResult nextChunkAfter(NodePtr &) const; AccessResult firstSibling(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; AccessResult followSiblingRef(unsigned long, NodePtr &) const; AccessResult getLocation(Location &) const; protected: const LocChunk *chunk_; // never null }; inline ChunkNode::ChunkNode(const GroveImpl *grove, const LocChunk *chunk) : BaseNode(grove), chunk_(chunk) { } class SgmlDocumentNode; struct SgmlDocumentChunk : public ParentChunk { SgmlDocumentChunk() : prolog(0), documentElement(0), epilog(0) { } Chunk *prolog; Chunk *documentElement; Chunk *epilog; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; const Chunk *after() const { return this + 1; } }; class SgmlDocumentNode : public ChunkNode, public SdNode { public: SgmlDocumentNode(const GroveImpl *grove, const SgmlDocumentChunk *chunk); void accept(NodeVisitor &visitor); const ClassDef &classDef() const { return ClassDef::sgmlDocument; } AccessResult getDocumentElement(NodePtr &ptr) const; AccessResult getElements(NamedNodeListPtr &ptr) const; AccessResult getEntities(NamedNodeListPtr &ptr) const; AccessResult getDefaultedEntities(NamedNodeListPtr &ptr) const; AccessResult getGoverningDoctype(NodePtr &ptr) const; AccessResult getDoctypesAndLinktypes(NamedNodeListPtr &ptr) const; AccessResult getProlog(NodeListPtr &ptr) const; AccessResult getEpilog(NodeListPtr &ptr) const; AccessResult getSgmlConstants(NodePtr &) const; AccessResult getApplicationInfo(GroveString &str) const; AccessResult getMessages(NodeListPtr &ptr) const; AccessResult nextChunkSibling(NodePtr &) const { return accessNotInClass; } AccessResult firstSibling(NodePtr &) const { return accessNotInClass; } AccessResult siblingsIndex(unsigned long &) const { return accessNotInClass; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &) const { return accessNull; } AccessResult getSd(ConstPtr &sd, ConstPtr &prologSyntax, ConstPtr &instanceSyntax) const; private: const SgmlDocumentChunk *chunk() const { return (const SgmlDocumentChunk *)ChunkNode::chunk(); } }; inline SgmlDocumentNode::SgmlDocumentNode(const GroveImpl *grove, const SgmlDocumentChunk *chunk) : ChunkNode(grove, chunk) { } // array of pointers to attribute values stored after chunk class AttElementChunk : private ElementChunk { protected: AttElementChunk(size_t n) : nAtts(n) { } friend class ElementNode; private: const AttributeValue * attributeValue(size_t attIndex, const GroveImpl &) const; Boolean mustOmitEndTag() const; const Chunk *after() const; const StringC *id() const; size_t nAtts; }; class IncludedElementChunk : public ElementChunk { friend class ElementNode; Boolean included() const; }; class IncludedAttElementChunk : public AttElementChunk { IncludedAttElementChunk(size_t n) : AttElementChunk(n) { } friend class ElementNode; Boolean included() const; }; class ElementNode : public ChunkNode { public: friend class ElementChunk; ElementNode(const GroveImpl *grove, const ElementChunk *chunk) : ChunkNode(grove, chunk) { } AccessResult attributeRef(unsigned long i, NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult nextChunkAfter(NodePtr &) const; AccessResult firstChild(NodePtr &ptr) const; AccessResult getAttributes(NamedNodeListPtr &ptr) const; AccessResult getGi(GroveString &str) const; bool hasGi(GroveString) const; AccessResult getId(GroveString &str) const; AccessResult getContent(NodeListPtr &ptr) const; AccessResult getMustOmitEndTag(bool &) const; AccessResult getIncluded(bool &) const; AccessResult elementIndex(unsigned long &) const; AccessResult getElementType(NodePtr &) const; void accept(NodeVisitor &visitor); const ClassDef &classDef() const { return ClassDef::element; } static void add(GroveImpl &grove, const StartElementEvent &event); private: static ElementChunk *makeAttElementChunk(GroveImpl &grove, const StartElementEvent &, Boolean &hasId); const ElementChunk *chunk() const { return (const ElementChunk *)ChunkNode::chunk(); } void reuseFor(const ElementChunk *chunk) { chunk_ = chunk; } }; class CharsChunk : public LocChunk { public: const Chunk *after() const { return (const Chunk *)((char *)this + allocSize(size)); } const Char *data() const { return (const Char *)(this + 1); } size_t size; static size_t allocSize(size_t nChars) { return roundUp(sizeof(CharsChunk) + nChars*sizeof(Char)); } }; // The characters immediately follow the chunk class DataChunk : public CharsChunk { private: friend class DataNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; AccessResult setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const; AccessResult setNodePtrFirst(NodePtr &ptr, const DataNode *node) const; AccessResult getFollowing(const GroveImpl *, const Chunk *&, unsigned long &) const; }; class DataNode : public ChunkNode { public: friend class DataChunk; DataNode(const GroveImpl *, const DataChunk *chunk, size_t index); bool same(const BaseNode &node) const; bool same2(const DataNode *node) const; AccessResult nextSibling(NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult nextChunkAfter(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; AccessResult followSiblingRef(unsigned long, NodePtr &) const; AccessResult charChunk(const SdataMapper &, GroveString &) const; bool chunkContains(const Node &) const; bool inChunk(const DataNode *node) const; AccessResult getNonSgml(unsigned long &) const; AccessResult getLocation(Location &) const; void accept(NodeVisitor &visitor); const ClassDef &classDef() const { return ClassDef::dataChar; } unsigned long hash() const; static void add(GroveImpl &grove, const DataEvent &event); private: const DataChunk *chunk() const { return (const DataChunk *)ChunkNode::chunk(); } void reuseFor(const DataChunk *chunk, size_t index); size_t index_; }; inline DataNode::DataNode(const GroveImpl *grove, const DataChunk *chunk, size_t index) : ChunkNode(grove, chunk), index_(index) { } class PiChunk : private CharsChunk { friend class PiNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; }; class PrologPiChunk : public PiChunk { AccessResult getFirstSibling(const GroveImpl *, const Chunk *&) const; }; class EpilogPiChunk : public PiChunk { AccessResult getFirstSibling(const GroveImpl *, const Chunk *&) const; }; class PiNode : public ChunkNode { public: PiNode(const GroveImpl *grove, const PiChunk *chunk) : ChunkNode(grove, chunk) {} AccessResult getSystemData(GroveString &) const; AccessResult getEntityName(GroveString &) const{ return accessNull; } AccessResult getEntity(NodePtr &) const { return accessNull; } void accept(NodeVisitor &visitor) { visitor.pi(*this); } const ClassDef &classDef() const { return ClassDef::pi; } static void add(GroveImpl &grove, const PiEvent &); private: const PiChunk *chunk() const { return (const PiChunk *)ChunkNode::chunk(); } }; class EntityRefChunk : public LocChunk { public: const Entity *entity; const Chunk *after() const { return this + 1; } }; class EntityRefNode : public ChunkNode { public: EntityRefNode(const GroveImpl *grove, const EntityRefChunk *chunk) : ChunkNode(grove, chunk) { } AccessResult getEntity(NodePtr &) const; AccessResult getEntityName(GroveString &) const; protected: const EntityRefChunk *chunk() const { return (const EntityRefChunk *)ChunkNode::chunk(); } }; class SdataNode; class SdataChunk : private EntityRefChunk { friend class SdataNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; }; class SdataNode : public EntityRefNode { public: SdataNode(const GroveImpl *grove, const SdataChunk *chunk) : EntityRefNode(grove, chunk) { } AccessResult charChunk(const SdataMapper &, GroveString &) const; AccessResult getSystemData(GroveString &str) const; void accept(NodeVisitor &visitor) { visitor.sdata(*this); } const ClassDef &classDef() const { return ClassDef::sdata; } static void add(GroveImpl &grove, const SdataEntityEvent &event); private: Char c_; }; class NonSgmlNode; class NonSgmlChunk : public LocChunk { public: Char c; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; const Chunk *after() const { return this + 1; } }; class NonSgmlNode : public ChunkNode { public: NonSgmlNode(const GroveImpl *grove, const NonSgmlChunk *chunk) : ChunkNode(grove, chunk) { } AccessResult charChunk(const SdataMapper &, GroveString &) const; AccessResult getNonSgml(unsigned long &) const; void accept(NodeVisitor &visitor) { visitor.nonSgml(*this); } const ClassDef &classDef() const { return ClassDef::nonSgml; } static void add(GroveImpl &grove, const NonSgmlCharEvent &event); protected: const NonSgmlChunk *chunk() const { return (const NonSgmlChunk *)ChunkNode::chunk(); } }; class ExternalDataNode; class ExternalDataChunk : private EntityRefChunk { friend class ExternalDataNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; }; class ExternalDataNode : public EntityRefNode { public: ExternalDataNode(const GroveImpl *grove, const ExternalDataChunk *chunk) : EntityRefNode(grove, chunk) { } void accept(NodeVisitor &visitor) { visitor.externalData(*this); } const ClassDef &classDef() const { return ClassDef::externalData; } static void add(GroveImpl &grove, const ExternalDataEntityEvent &event); }; class SubdocChunk : private EntityRefChunk { friend class SubdocNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; }; class SubdocNode : public EntityRefNode { public: SubdocNode(const GroveImpl *grove, const SubdocChunk *chunk) : EntityRefNode(grove, chunk) { } void accept(NodeVisitor &visitor) { visitor.subdocument(*this); } const ClassDef &classDef() const { return ClassDef::subdocument; } static void add(GroveImpl &grove, const SubdocEntityEvent &event); }; class PiEntityChunk : private EntityRefChunk { friend class PiEntityNode; AccessResult setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const; }; class PiEntityNode : public EntityRefNode { public: PiEntityNode(const GroveImpl *grove, const PiEntityChunk *chunk) : EntityRefNode(grove, chunk) { } AccessResult getSystemData(GroveString &) const; void accept(NodeVisitor &visitor) { visitor.pi(*this); } const ClassDef &classDef() const { return ClassDef::pi; } static void add(GroveImpl &grove, const Entity *, const Location &); }; struct AttributeDefOrigin { AttributeDefOrigin(size_t attIndex = 0) : attIndex_(attIndex) { } virtual const AttributeDefinitionList *attDefList() const = 0; virtual Node *makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex = 0) const = 0; virtual Node *makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const = 0; virtual Node *makeOriginNode(const GroveImpl *grove, size_t attIndex) const = 0; virtual AccessResult makeAttributeValueNode(const GroveImpl *grove, NodePtr &ptr, const AttributeValue *value) const; virtual AccessResult makeAttributeValueNodeList(const GroveImpl *grove, NodeListPtr &ptr, const AttributeValue *value) const; virtual AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const = 0; virtual AccessResult makeAttributeDefList(const GroveImpl *, NodeListPtr &, size_t) const { return accessNull; } AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, const StringC &name) const; virtual const void *attributeOriginId() const = 0; const size_t attIndex() const { return attIndex_; } protected: size_t attIndex_; }; struct AttributeOrigin : public virtual AttributeDefOrigin { virtual const AttributeValue * attributeValue(size_t attIndex, const GroveImpl &grove) const = 0; virtual AccessResult setNodePtrAttributeOrigin(NodePtr &, const BaseNode *) const = 0; virtual Node *makeAttributeAsgnNode(const GroveImpl *grove, size_t attIndex) const = 0; }; class ElementAttributeOrigin : public virtual AttributeOrigin { public: ElementAttributeOrigin(const ElementChunk *); const AttributeDefinitionList *attDefList() const; const AttributeValue * attributeValue(size_t attIndex, const GroveImpl &grove) const; AccessResult setNodePtrAttributeOrigin(NodePtr &, const BaseNode *) const; Node *makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const; Node *makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const; Node *makeAttributeAsgnNode(const GroveImpl *grove, size_t attIndex) const; virtual Node *makeOriginNode(const GroveImpl *grove, size_t attIndex) const; virtual AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const; const void *attributeOriginId() const; private: const ElementChunk *chunk_; }; class EntityAttributeOrigin : public virtual AttributeOrigin { public: EntityAttributeOrigin(const ExternalDataEntity *); const AttributeDefinitionList *attDefList() const; const AttributeValue * attributeValue(size_t attIndex, const GroveImpl &grove) const; AccessResult setNodePtrAttributeOrigin(NodePtr &, const BaseNode *) const; Node *makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const; Node *makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const; Node *makeAttributeAsgnNode(const GroveImpl *grove, size_t attIndex) const; virtual AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const; virtual Node *makeOriginNode(const GroveImpl *grove, size_t attIndex) const; const void *attributeOriginId() const; private: const ExternalDataEntity *entity_; }; // CLASS DEF: ElementTypeAttributeDefOrigin class ElementTypeAttributeDefOrigin : public virtual AttributeDefOrigin { public: ElementTypeAttributeDefOrigin(const ElementType *); const AttributeDefinitionList *attDefList() const; Node *makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const; Node *makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const; virtual AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const; virtual AccessResult makeAttributeDefList(const GroveImpl *grove, NodeListPtr &ptr, size_t firstAttDefIdx) const; virtual Node *makeOriginNode(const GroveImpl *grove, size_t attIndex) const; virtual const void *attributeOriginId() const; protected: const ElementType *elementType_; }; // CLASS DEF: NotationAttributeDefOrigin class NotationAttributeDefOrigin : public virtual AttributeDefOrigin { public: NotationAttributeDefOrigin(const Notation *); virtual const AttributeDefinitionList *attDefList() const; Node *makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const; Node *makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const; virtual AccessResult makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const; virtual AccessResult makeAttributeDefList(const GroveImpl *grove, NodeListPtr &ptr, size_t firstAttDefIdx) const; virtual Node *makeOriginNode(const GroveImpl *grove, size_t attIndex) const; virtual const void *attributeOriginId() const; protected: const Notation *notation_; }; class AttributeAsgnNode : public BaseNode, public virtual AttributeOrigin { public: AttributeAsgnNode(const GroveImpl *grove, size_t attIndex); AccessResult getOrigin(NodePtr &ptr) const; AccessResult getName(GroveString &str) const; AccessResult getImplied(bool &implied) const; AccessResult getValue(NodeListPtr &ptr) const; AccessResult children(NodeListPtr &ptr) const; AccessResult firstChild(NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult followSiblingRef(unsigned long, NodePtr &) const; AccessResult firstSibling(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; AccessResult getTokenSep(Char &) const; AccessResult tokens(GroveString &) const; AccessResult getAttributeDef(NodePtr &) const; void accept(NodeVisitor &visitor); const ClassDef &classDef() const { return ClassDef::attributeAssignment; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idAttributes; return accessOK; } bool same(const BaseNode &node) const; bool same2(const AttributeAsgnNode *node) const; unsigned long hash() const; }; class ElementAttributeAsgnNode : public AttributeAsgnNode, public ElementAttributeOrigin { public: ElementAttributeAsgnNode(const GroveImpl *grove, size_t attIndex, const ElementChunk *); }; class EntityAttributeAsgnNode : public AttributeAsgnNode, public EntityAttributeOrigin { public: EntityAttributeAsgnNode(const GroveImpl *grove, size_t attIndex, const ExternalDataEntity *); }; class AttributeValueTokenNode : public BaseNode, public virtual AttributeDefOrigin { public: AttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex); AccessResult getParent(NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult followSiblingRef(unsigned long, NodePtr &ptr) const; AccessResult firstSibling(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; AccessResult getToken(GroveString &str) const; AccessResult getEntity(NodePtr &ptr) const; AccessResult getNotation(NodePtr &ptr) const; AccessResult getReferent(NodePtr &ptr) const; AccessResult getLocation(Location &) const; void accept(NodeVisitor &visitor); const ClassDef &classDef() const { return ClassDef::attributeValueToken; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idValue; return accessOK; } bool same(const BaseNode &node) const; bool same2(const AttributeValueTokenNode *node) const; unsigned long hash() const; private: const TokenizedAttributeValue *value_; size_t tokenIndex_; }; class ElementAttributeValueTokenNode : public AttributeValueTokenNode, public ElementAttributeOrigin { public: ElementAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ElementChunk *); }; class EntityAttributeValueTokenNode : public AttributeValueTokenNode, public EntityAttributeOrigin { public: EntityAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ExternalDataEntity *); }; class ElementTypeAttributeValueTokenNode : public AttributeValueTokenNode, public ElementTypeAttributeDefOrigin { public: ElementTypeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ElementType *); AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDefaultValue; return accessOK; } }; class NotationAttributeValueTokenNode : public AttributeValueTokenNode, public NotationAttributeDefOrigin { public: NotationAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const Notation *); AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDefaultValue; return accessOK; } }; class CdataAttributeValueNode : public BaseNode, public virtual AttributeDefOrigin { public: static bool skipBoring(TextIter &iter); CdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex); AccessResult getParent(NodePtr &ptr) const; AccessResult charChunk(const SdataMapper &, GroveString &) const; bool chunkContains(const Node &) const; bool inChunk(const CdataAttributeValueNode *) const; AccessResult getEntity(NodePtr &) const; AccessResult getEntityName(GroveString &) const; AccessResult getSystemData(GroveString &str) const; AccessResult nextSibling(NodePtr &ptr) const; AccessResult nextChunkSibling(NodePtr &ptr) const; AccessResult firstSibling(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; AccessResult getLocation(Location &) const; void accept(NodeVisitor &visitor); const ClassDef &classDef() const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idValue; return accessOK; } bool same(const BaseNode &node) const; bool same2(const CdataAttributeValueNode *node) const; unsigned long hash() const; private: const AttributeValue *value_; TextIter iter_; // must be valid size_t charIndex_; Char c_; }; class ElementCdataAttributeValueNode : public CdataAttributeValueNode, public ElementAttributeOrigin { public: ElementCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ElementChunk *); }; class EntityCdataAttributeValueNode : public CdataAttributeValueNode, public EntityAttributeOrigin { public: EntityCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ExternalDataEntity *); }; class ElementTypeCdataAttributeValueNode : public CdataAttributeValueNode, public ElementTypeAttributeDefOrigin { public: ElementTypeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ElementType *); AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDefaultValue; return accessOK; } }; class NotationCdataAttributeValueNode : public CdataAttributeValueNode, public NotationAttributeDefOrigin { public: NotationCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const Notation *); AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDefaultValue; return accessOK; } }; class EntityNodeBase : public BaseNode { public: EntityNodeBase(const GroveImpl *grove, const Entity *entity) : BaseNode(grove), entity_(entity) {} AccessResult getName(GroveString &str) const; AccessResult getExternalId(NodePtr &ptr) const; AccessResult getNotation(NodePtr &) const; AccessResult getNotationName(GroveString &) const; AccessResult getText(GroveString &) const; AccessResult getEntityType(Node::EntityType::Enum &) const; AccessResult getAttributes(NamedNodeListPtr &) const; AccessResult attributeRef(unsigned long i, NodePtr &ptr) const; AccessResult getLocation(Location &) const; unsigned long hash() const; protected: const Entity *entity_; }; class EntityNode : public EntityNodeBase { public: EntityNode(const GroveImpl *grove, const Entity *entity); AccessResult getOrigin(NodePtr &ptr) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &) const; AccessResult getDefaulted(bool &) const; bool same(const BaseNode &) const; bool same2(const EntityNode *) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::entity; } }; class DefaultEntityNode : public EntityNodeBase { public: DefaultEntityNode(const GroveImpl *grove, const Entity *entity); AccessResult getOrigin(NodePtr &ptr) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &) const; bool same(const BaseNode &) const; bool same2(const DefaultEntityNode *) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::defaultEntity; } }; class NotationNode : public BaseNode { public: NotationNode(const GroveImpl *grove, const Notation *notation); AccessResult getOrigin(NodePtr &ptr) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idNotations; return accessOK; } AccessResult getName(GroveString &str) const; AccessResult getExternalId(NodePtr &ptr) const; AccessResult getAttributeDefs(NamedNodeListPtr &) const; bool same(const BaseNode &) const; bool same2(const NotationNode *) const; AccessResult getLocation(Location &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::notation; } unsigned long hash() const; private: const Notation *notation_; }; class FormalPublicIdNode : public BaseNode { public: FormalPublicIdNode(const GroveImpl *, const PublicId *); AccessResult getOwnerType(OwnerType::Enum &) const; AccessResult getOwnerId(GroveString &) const; AccessResult getTextClass(TextClass::Enum &) const; AccessResult getUnavailable(bool &) const; AccessResult getTextDescription(GroveString &) const; AccessResult getTextLanguage(GroveString &) const; AccessResult getTextDesignatingSequence(GroveString &) const; AccessResult getTextDisplayVersion(GroveString &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::formalPublicId; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idFormalPublicId; return accessOK; } bool same(const BaseNode &) const; bool same2(const FormalPublicIdNode *) const; private: const PublicId *pubid_; mutable StringC owner_; mutable StringC desc_; mutable StringC lang_; mutable StringC dseq_; mutable StringC dver_; }; class ExternalIdNode : public BaseNode { public: ExternalIdNode(const GroveImpl *grove); virtual const ExternalId &externalId() const = 0; AccessResult getPublicId(GroveString &) const; AccessResult getFormalPublicId(NodePtr &) const; AccessResult getSystemId(GroveString &) const; AccessResult getGeneratedSystemId(GroveString &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::externalId; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idExternalId; return accessOK; } bool same(const BaseNode &) const; bool same2(const ExternalIdNode *) const; }; class EntityExternalIdNode : public ExternalIdNode { public: EntityExternalIdNode(const GroveImpl *grove, const ExternalEntity *entity); const ExternalId &externalId() const; AccessResult getOrigin(NodePtr &ptr) const; unsigned long hash() const; private: const ExternalEntity *entity_; }; class NotationExternalIdNode : public ExternalIdNode { public: NotationExternalIdNode(const GroveImpl *grove, const Notation *notation); const ExternalId &externalId() const; AccessResult getOrigin(NodePtr &ptr) const; unsigned long hash() const; private: const Notation *notation_; }; class DocumentTypeNode : public BaseNode { public: DocumentTypeNode(const GroveImpl *grove, const Dtd *); AccessResult getName(GroveString &) const; AccessResult getGoverning(bool &) const; AccessResult getGeneralEntities(NamedNodeListPtr &) const; AccessResult getNotations(NamedNodeListPtr &) const; AccessResult getElementTypes(NamedNodeListPtr &) const; AccessResult getDefaultEntity(NodePtr &) const; AccessResult getParameterEntities(NamedNodeListPtr &) const; AccessResult getOrigin(NodePtr &) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDoctypesAndLinktypes; return accessOK; } AccessResult nextChunkSibling(NodePtr &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::documentType; } bool same(const BaseNode &) const; bool same2(const DocumentTypeNode *) const; private: const Dtd *dtd_; }; class SgmlConstantsNode : public BaseNode { public: SgmlConstantsNode(const GroveImpl *); AccessResult getOrigin(NodePtr &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::sgmlConstants; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idSgmlConstants; return accessOK; } bool same(const BaseNode &) const; bool same2(const SgmlConstantsNode *) const; }; class MessageNode : public BaseNode { public: MessageNode(const GroveImpl *, const MessageItem *); AccessResult getOrigin(NodePtr &) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::noId; return accessOK; } AccessResult nextChunkSibling(NodePtr &) const; AccessResult firstSibling(NodePtr &) const; AccessResult siblingsIndex(unsigned long &) const; void accept(NodeVisitor &); const ClassDef &classDef() const { return ClassDef::message; } bool same(const BaseNode &) const; bool same2(const MessageNode *) const; AccessResult getLocation(Location &) const; AccessResult getText(GroveString &) const; AccessResult getSeverity(Severity &) const; private: const MessageItem *item_; }; // CLASS DEF: RankStemNode class RankStemNode : public BaseNode { public: RankStemNode(const GroveImpl *grove, const RankStem &rankStem, const Dtd::ConstElementTypeIter &iter) : BaseNode(grove), rankStem_(rankStem), iter_(iter) {}; AccessResult getOrigin(NodePtr &) const; const ClassDef &classDef() const { return ClassDef::rankStem; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idElementTypes; return accessOK; } AccessResult getStem(GroveString &) const; AccessResult getElementTypes(NodeListPtr &) const; bool same(const BaseNode &) const; bool same2(const RankStemNode *) const; void accept(NodeVisitor &); unsigned long hash() const; const RankStem &rankStem() const { return rankStem_; } protected: const RankStem &rankStem_; Dtd::ConstElementTypeIter iter_; }; // CLASS DEF: ElementTypeNode class ElementTypeNode : public BaseNode { public: ElementTypeNode(const GroveImpl *grove, const ElementType &elementType) : BaseNode(grove), elementType_(elementType) {}; AccessResult getOrigin(NodePtr &) const; const ClassDef &classDef() const { return ClassDef::elementType; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idElementTypes; return accessOK; } AccessResult getGi(GroveString &str) const; AccessResult getAttributeDefs(NamedNodeListPtr &) const; AccessResult getContentType(Node::ContentType::Enum &) const; AccessResult getExclusions(GroveStringListPtr &) const; AccessResult getInclusions(GroveStringListPtr &) const; AccessResult getModelGroup(NodePtr &) const; AccessResult getOmitEndTag(bool &) const; AccessResult getOmitStartTag(bool &) const; AccessResult getRankGroup(GroveStringListPtr &) const; AccessResult getRankStem(GroveString &) const; AccessResult getRankSuffix(GroveString &) const; AccessResult getLocation(Location &) const; bool same(const BaseNode &) const; bool same2(const ElementTypeNode *) const; void accept(NodeVisitor &); unsigned long hash() const; const ElementType &elementType() const { return elementType_; } protected: const ElementType &elementType_; }; // CLASS DEF: ContentTokenNodeBase class ModelGroupNode; class ContentTokenNodeBase : public BaseNode { public: ContentTokenNodeBase(const GroveImpl *grove, const ElementType &elementType, ModelGroupNode *parentModelGroupNode = 0); ~ContentTokenNodeBase(); AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idContentTokens; return accessOK; } AccessResult getOrigin(NodePtr &) const; AccessResult getLocation(Location &) const; const ElementType &elementType() const { return elementType_; } protected: ModelGroupNode *parentModelGroupNode_; const ElementType &elementType_; }; // CLASS DEF: ElementTokenNode class ElementTokenNode : public ContentTokenNodeBase { public: ElementTokenNode(const GroveImpl *grove, const ElementType &elementType, const ElementToken &elementToken, ModelGroupNode *parentModelGroupNode) : ContentTokenNodeBase(grove, elementType, parentModelGroupNode), elementToken_(elementToken) {} const ClassDef &classDef() const { return ClassDef::elementToken; } AccessResult getGi(GroveString &str) const; AccessResult getOccurIndicator(Node::OccurIndicator::Enum &) const; bool same(const BaseNode &) const; bool same2(const ElementTokenNode *) const; void accept(NodeVisitor &); unsigned long hash() const; const ElementToken &elementToken() const { return elementToken_; } protected: const ElementToken &elementToken_; }; // CLASS DEF: PcdataTokenNode class PcdataTokenNode : public ContentTokenNodeBase { public: PcdataTokenNode(const GroveImpl *grove, const ElementType &elementType, const PcdataToken &pcdataToken, ModelGroupNode *parentModelGroupNode) : ContentTokenNodeBase(grove, elementType, parentModelGroupNode), pcdataToken_(pcdataToken) {} const ClassDef &classDef() const { return ClassDef::pcdataToken; } bool same(const BaseNode &) const; bool same2(const PcdataTokenNode *) const; void accept(NodeVisitor &); unsigned long hash() const; const PcdataToken &pcdataToken() const { return pcdataToken_; } protected: const PcdataToken &pcdataToken_; }; // CLASS DEF: ModelGroupNode class ModelGroupNode : public ContentTokenNodeBase { public: ModelGroupNode(const GroveImpl *grove, const ElementType &elementType, const ModelGroup &modelGroup, ModelGroupNode *parentModelGroupNode = 0) : ContentTokenNodeBase(grove, elementType, parentModelGroupNode), modelGroup_(modelGroup) {} const ClassDef &classDef() const { return ClassDef::modelGroup; } AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const; AccessResult getConnector(Node::Connector::Enum &con) const; AccessResult getOccurIndicator(Node::OccurIndicator::Enum &occur) const; AccessResult getContentTokens(NodeListPtr &) const; bool same(const BaseNode &) const; bool same2(const ModelGroupNode *) const; void accept(NodeVisitor &); unsigned long hash() const; void makeNode(NodePtr &ptr, unsigned contentTokenIdx); const ModelGroup &modelGroup() const { return modelGroup_; } private: const ModelGroup &modelGroup_; }; // class DEF: AttributeDefNode class AttributeDefNode : public BaseNode, public virtual AttributeDefOrigin { public: AttributeDefNode(const GroveImpl *grove, size_t attIndex) : BaseNode(grove), AttributeDefOrigin(attIndex) {} const ClassDef &classDef() const { return ClassDef::attributeDef; } AccessResult getName(GroveString &) const; AccessResult getDeclValueType(Node::DeclValueType::Enum &) const; AccessResult getDefaultValueType(Node::DefaultValueType::Enum &) const; AccessResult getTokens(GroveStringListPtr &) const; AccessResult getCurrentAttributeIndex(long &) const; void accept(NodeVisitor &visitor); bool same(const BaseNode &node) const; bool same2(const AttributeDefNode *node) const; unsigned long hash() const; protected: }; // class DEF: ElementTypeAttributeDefNode class ElementTypeAttributeDefNode : public AttributeDefNode, public ElementTypeAttributeDefOrigin { public: ElementTypeAttributeDefNode(const GroveImpl *grove, const ElementType &elementType, size_t attributeDefIdx) : AttributeDefNode(grove, attributeDefIdx), ElementTypeAttributeDefOrigin(&elementType), AttributeDefOrigin(attributeDefIdx) {} AccessResult getOrigin(NodePtr &ptr) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idAttributeDefs; return accessOK; } AccessResult getCurrentGroup(NodeListPtr &) const; AccessResult getLocation(Location &) const; AccessResult getDefaultValue(NodeListPtr &) const; }; // class DEF: NotationAttributeDefNode class NotationAttributeDefNode : public AttributeDefNode, public NotationAttributeDefOrigin { public: NotationAttributeDefNode(const GroveImpl *grove, const Notation ¬ation, size_t attributeDefIdx) : AttributeDefNode(grove, attributeDefIdx), NotationAttributeDefOrigin(¬ation), AttributeDefOrigin(attributeDefIdx) {}; AccessResult getOrigin(NodePtr &ptr) const; AccessResult getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idAttributeDefs; return accessOK; } AccessResult getCurrentGroup(NodeListPtr &) const; AccessResult getLocation(Location &) const; AccessResult getDefaultValue(NodeListPtr &) const; }; class BaseNodeList : public NodeList { public: BaseNodeList() : refCount_(0) { } virtual ~BaseNodeList() { } void addRef() { ++refCount_; } bool canReuse(NodeListPtr &ptr) const { const NodeList *tem = &*ptr; return tem == this && refCount_ == 1; } void release() { ASSERT(refCount_ != 0); if (--refCount_ == 0) delete this; } AccessResult first(NodePtr &) const { return accessNull; } AccessResult rest(NodeListPtr &ptr) const { return chunkRest(ptr); } AccessResult chunkRest(NodeListPtr &) const { return accessNull; } private: unsigned refCount_; }; class SiblingNodeList : public BaseNodeList { public: SiblingNodeList(const NodePtr &first) : first_(first) { } AccessResult first(NodePtr &ptr) const { ptr = first_; return accessOK; } AccessResult rest(NodeListPtr &ptr) const { AccessResult ret; if (canReuse(ptr)) { ret = ((SiblingNodeList *)this)->first_.assignNextSibling(); if (ret == accessOK) return ret; } else { NodePtr next; ret = first_->nextSibling(next); if (ret == accessOK) { ptr.assign(new SiblingNodeList(next)); return ret; } } if (ret == accessNull) { ptr.assign(new BaseNodeList); return accessOK; } return ret; } AccessResult chunkRest(NodeListPtr &ptr) const { AccessResult ret; if (canReuse(ptr)) { ret = ((SiblingNodeList *)this)->first_.assignNextChunkSibling(); if (ret == accessOK) return ret; } else { NodePtr next; ret = first_->nextChunkSibling(next); if (ret == accessOK) { ptr.assign(new SiblingNodeList(next)); return ret; } } if (ret == accessNull) { ptr.assign(new BaseNodeList); return accessOK; } return ret; } AccessResult ref(unsigned long i, NodePtr &ptr) const { if (i == 0) { ptr = first_; return accessOK; } return first_->followSiblingRef(i - 1, ptr); } private: NodePtr first_; // never null }; class BaseNamedNodeList : public NamedNodeList { public: BaseNamedNodeList(const GroveImpl *grove, const SubstTable *substTable) : grove_(grove), substTable_(substTable), refCount_(0) { } virtual ~BaseNamedNodeList() { } void addRef() { ++refCount_; } bool canReuse(NamedNodeListPtr &ptr) const { const NamedNodeList *tem = &*ptr; return tem == this && refCount_ == 1; } void release() { ASSERT(refCount_ != 0); if (--refCount_ == 0) delete this; } size_t normalize(GroveChar *s, size_t n) const { if (substTable_) { for (size_t i = 0; i < n; i++) substTable_->subst(s[i]); } return n; } const GroveImpl *grove() const { return grove_; } AccessResult namedNode(GroveString str, NodePtr &node) const { StringC tem(str.data(), str.size()); normalize(&tem[0], tem.size()); return namedNodeU(tem, node); } virtual AccessResult namedNodeU(const StringC &, NodePtr &) const = 0; private: GroveImplPtr grove_; const SubstTable *substTable_; unsigned refCount_; }; class AttributesNamedNodeList : public BaseNamedNodeList, public virtual AttributeOrigin { public: AttributesNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->generalSubstTable()) { } NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return attributes; } }; class ElementAttributesNamedNodeList : public AttributesNamedNodeList, public ElementAttributeOrigin { public: ElementAttributesNamedNodeList(const GroveImpl *grove, const ElementChunk *chunk) : AttributesNamedNodeList(grove), ElementAttributeOrigin(chunk) { } }; class EntityAttributesNamedNodeList : public AttributesNamedNodeList, public EntityAttributeOrigin { public: EntityAttributesNamedNodeList(const GroveImpl *grove, const ExternalDataEntity *entity) : AttributesNamedNodeList(grove), EntityAttributeOrigin(entity) { } }; class ElementsNamedNodeList : public BaseNamedNodeList { public: ElementsNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->generalSubstTable()) { } NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return elements; } }; class DocEntitiesNamedNodeList : public BaseNamedNodeList { public: DocEntitiesNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->entitySubstTable()) { } NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return entities; } }; class DefaultedEntitiesNamedNodeList : public BaseNamedNodeList { public: DefaultedEntitiesNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->entitySubstTable()) { } NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return entities; } }; class GeneralEntitiesNamedNodeList : public BaseNamedNodeList { public: GeneralEntitiesNamedNodeList(const GroveImpl *, const Dtd *); NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return entities; } private: const Dtd *dtd_; }; class ParameterEntitiesNamedNodeList : public BaseNamedNodeList { public: ParameterEntitiesNamedNodeList(const GroveImpl *, const Dtd *); NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return entities; } private: const Dtd *dtd_; }; class NotationsNamedNodeList : public BaseNamedNodeList { public: NotationsNamedNodeList(const GroveImpl *, const Dtd *); NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return notations; } private: const Dtd *dtd_; }; class DoctypesAndLinktypesNamedNodeList : public BaseNamedNodeList { public: DoctypesAndLinktypesNamedNodeList(const GroveImpl *); NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return doctypesAndLinktypes; } }; class ElementsNodeList : public BaseNodeList { public: ElementsNodeList(const GroveImpl *grove, const Chunk *head); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; public: GroveImplPtr grove_; const Chunk *first_; }; class EntitiesNodeList : public BaseNodeList { public: EntitiesNodeList(const GroveImpl *grove, const Dtd::ConstEntityIter &iter); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; protected: const GroveImpl *grove() const { return grove_; } public: GroveImplPtr grove_; Dtd::ConstEntityIter iter_; }; class DocEntitiesNodeList : public EntitiesNodeList { public: DocEntitiesNodeList(const GroveImpl *grove); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; }; class NotationsNodeList : public BaseNodeList { public: NotationsNodeList(const GroveImpl *grove, const Dtd::ConstNotationIter &iter); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; public: GroveImplPtr grove_; Dtd::ConstNotationIter iter_; }; // -- CLASS DEF: RankStemElementTypesNodeList class RankStemElementTypesNodeList : public BaseNodeList { public: RankStemElementTypesNodeList(const GroveImpl *, const RankStem &, const Dtd::ConstElementTypeIter &); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; protected: GroveImplPtr grove_; const RankStem &rankStem_; Dtd::ConstElementTypeIter iter_; }; // -- CLASS DEF: ElementTypesNodeList class ElementTypesNodeList : public BaseNodeList { public: ElementTypesNodeList( const GroveImpl *, const Dtd *, const Dtd::ConstElementTypeIter &, const Dtd::ConstRankStemIter &); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; protected: GroveImplPtr grove_; const Dtd *dtd_; Dtd::ConstElementTypeIter elementTypeIter_; Dtd::ConstRankStemIter rankStemIter_; }; // -- CLASS DEF: ElementTypesNamedNodeList class ElementTypesNamedNodeList : public BaseNamedNodeList { public: ElementTypesNamedNodeList(const GroveImpl *, const Dtd *); NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return elementTypes; } protected: const Dtd *dtd_; }; // -- CLASS DEF: ContentTokenNodeList class ContentTokenNodeList : public BaseNodeList { public: ContentTokenNodeList(const GroveImpl *grove, ModelGroupNode &modelGroupNode, unsigned firstTokenIdx = 0); AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; unsigned firstTokenIdx() const { return firstTokenIdx_; } AccessResult next(); protected: GroveImplPtr grove_; ModelGroupNode &modelGroupNode_; unsigned firstTokenIdx_; }; // -- CLASS DEF: AttributeDefsNodeList class AttributeDefsNodeList : public BaseNodeList, public virtual AttributeDefOrigin { public: AttributeDefsNodeList(const GroveImpl *grove, size_t firstAttIndex) : grove_(grove), AttributeDefOrigin(firstAttIndex) {} AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; bool inList(size_t attIndex) const; protected: GroveImplPtr grove_; }; // -- CLASS DEF: ElementTypeAttributeDefsNodeList class ElementTypeAttributeDefsNodeList : public AttributeDefsNodeList, public ElementTypeAttributeDefOrigin { public: ElementTypeAttributeDefsNodeList(const GroveImpl *grove, const ElementType &elementType, size_t firstAttIndex) : AttributeDefsNodeList(grove, firstAttIndex), ElementTypeAttributeDefOrigin(&elementType), AttributeDefOrigin(firstAttIndex) {} }; // -- CLASS DEF: NotationAttributeDefsNodeList class NotationAttributeDefsNodeList : public AttributeDefsNodeList, public NotationAttributeDefOrigin { public: NotationAttributeDefsNodeList(const GroveImpl *grove, const Notation ¬ation, size_t firstAttIndex) : AttributeDefsNodeList(grove, firstAttIndex), NotationAttributeDefOrigin(¬ation), AttributeDefOrigin(firstAttIndex) {} }; // -- CLASS DEF: AttributeDefsNamedNodeList class AttributeDefsNamedNodeList : public BaseNamedNodeList, public virtual AttributeDefOrigin { public: AttributeDefsNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->generalSubstTable()) { } NodeListPtr nodeList() const; AccessResult namedNodeU(const StringC &, NodePtr &) const; Type type() const { return attributeDefs; } }; // -- CLASS DEF: ElementTypeAttributeDefsNamedNodeList class ElementTypeAttributeDefsNamedNodeList : public AttributeDefsNamedNodeList, public ElementTypeAttributeDefOrigin { public: ElementTypeAttributeDefsNamedNodeList(const GroveImpl *grove, const ElementType &elementType) : AttributeDefsNamedNodeList(grove), ElementTypeAttributeDefOrigin(&elementType) { } }; // -- CLASS DEF: NotationAttributeDefsNamedNodeList class NotationAttributeDefsNamedNodeList : public AttributeDefsNamedNodeList, public NotationAttributeDefOrigin { public: NotationAttributeDefsNamedNodeList(const GroveImpl *grove, const Notation ¬ation) : AttributeDefsNamedNodeList(grove), NotationAttributeDefOrigin(¬ation) { } }; // -- CLASS DEF: ElementTypeCurrentGroupAttributeDefsNodeList // elementType_ is first list element, iter.next() represents rest class ElementTypeCurrentGroupAttributeDefsNodeList : public BaseNodeList { public: ElementTypeCurrentGroupAttributeDefsNodeList(const GroveImpl *grove, const Dtd::ConstElementTypeIter &iter, size_t currentGroupIndex); ElementTypeCurrentGroupAttributeDefsNodeList(const GroveImpl *grove, const Dtd::ConstElementTypeIter &iter, const ElementType *elementType, size_t firstAttIndex, size_t currentGroupIndex) : grove_(grove), iter_(iter), elementType_(elementType), attIndex_(firstAttIndex), currentGroupIndex_(currentGroupIndex) {} AccessResult first(NodePtr &) const; AccessResult chunkRest(NodeListPtr &) const; bool next(Dtd::ConstElementTypeIter &iter, const ElementType *&elementType, size_t &attIndex, bool incrementFirst = true) const; bool next(bool incrementFirst = true) { return next(iter_, elementType_, attIndex_, incrementFirst); } protected: GroveImplPtr grove_; Dtd::ConstElementTypeIter iter_; const ElementType *elementType_; size_t currentGroupIndex_; size_t attIndex_; }; inline Boolean GroveImpl::waitForMoreNodes() const { if (blockingAccess) return moreNodesCondition_.wait(); else return 0; } inline void GroveImpl::pulse() { moreNodesCondition_.pulse(); } inline void GroveImpl::maybePulse() { // Once we've had (2^n)*(2^10) events, only pulse every (2^n)th event. // Up to a limit of n == 8. // This reduces the overhead of pulsing to negligible levels on WinNT. if ((++nEvents_ & ~(~unsigned(0) << pulseStep_)) == 0) { pulse(); if (pulseStep_ < 8 && nEvents_ > (1 << (pulseStep_ + 10))) pulseStep_++; } } inline void GroveImpl::appendSibling(Chunk *chunk) { if (pendingData_) { if (tailPtr_) { // Must set completeLimit_ before setting tailPtr_. completeLimit_ = pendingData_->after(); *tailPtr_ = pendingData_; tailPtr_ = 0; } pendingData_ = 0; } // Must set origin before advancing completeLimit_. chunk->origin = origin_; // Must advance completeLimit_ before setting tailPtr_. completeLimit_ = freePtr_; if (tailPtr_) { *tailPtr_ = chunk; tailPtr_ = 0; } pendingData_ = 0; maybePulse(); } inline void GroveImpl::appendSibling(DataChunk *chunk) { // Since we might extend this DataChunk, it's // not safe to set completeLimit_ to after this chunk yet. // This means we can't yet set tailPtr_. if (pendingData_) { // Must set completeLimit_ before setting tailPtr_. completeLimit_ = pendingData_->after(); if (tailPtr_) { *tailPtr_ = pendingData_; tailPtr_ = 0; } } chunk->origin = origin_; pendingData_ = chunk; maybePulse(); } inline void GroveImpl::push(ElementChunk *chunk, Boolean hasId) { if (pendingData_) { if (tailPtr_) { // Must set completeLimit_ before setting tailPtr_. completeLimit_ = pendingData_->after(); *tailPtr_ = pendingData_; tailPtr_ = 0; } pendingData_ = 0; } chunk->elementIndex = nElements_++; chunk->origin = origin_; // Must set origin_ to chunk before advancing completeLimit_ // otherwise thread would look at element and // maybeMoreSiblings() would return false. // Must advance completeLimit_ before setting tailPtr_, // otherwise tailPtr_ would be beyond completeLimit_. origin_ = chunk; completeLimit_ = freePtr_; // Allow for the possibility of invalid documents with elements // after the document element. if ((const Chunk *)chunk->origin == root_ && root_->documentElement == 0) root_->documentElement = chunk; else if (tailPtr_) { *tailPtr_ = chunk; tailPtr_ = 0; } if (hasId) { Mutex::Lock lock(mutexPtr_); idTable_.insert(chunk); } maybePulse(); } inline void GroveImpl::pop() { if (pendingData_) { // Must set completeLimit_ before setting tailPtr_. completeLimit_ = pendingData_->after(); if (tailPtr_) { *tailPtr_ = pendingData_; tailPtr_ = 0; } pendingData_ = 0; } tailPtr_ = &origin_->nextSibling; origin_ = origin_->origin; if ((const Chunk *)origin_ == root_) finishDocumentElement(); maybePulse(); } inline Boolean GroveImpl::haveRootOrigin() { return (const Chunk *)origin_ == root_; } inline void GroveImpl::setGoverningDtd(const ConstPtr &dtd) { dtd_ = dtd; hasDefaultEntity_ = !dtd_->defaultEntity().isNull(); finishProlog(); pulse(); } inline void GroveImpl::addDtd(const ConstPtr &dtd) { allDtds_.push_back(dtd); } const Dtd *GroveImpl::lookupDtd(const StringC &name) const { for (size_t i = 0; i < allDtds_.size(); i++) if (allDtds_[i]->name() == name) return allDtds_[i].pointer(); return 0; } const Dtd *GroveImpl::lookupDtd(const ElementType &et) const { for (size_t i = 0; i < allDtds_.size(); i++) if (allDtds_[i]->lookupElementType(et.name()) == &et) return allDtds_[i].pointer(); return 0; } const Dtd *GroveImpl::lookupDtd(const RankStem &rs) const { for (size_t i = 0; i < allDtds_.size(); i++) if (allDtds_[i]->lookupRankStem(rs.name()) == &rs) return allDtds_[i].pointer(); return 0; } const Dtd *GroveImpl::nextDtd(const Dtd *dtd) const { for (size_t i = 0; i < allDtds_.size() - 1; i++) if (allDtds_[i].pointer() == dtd) return allDtds_[i+1].pointer(); return 0; } inline const ElementChunk *GroveImpl::lookupElement(const StringC &id) const { Mutex::Lock lock(mutexPtr_); return idTable_.lookup(id); } inline GroveImpl::ElementIter GroveImpl::elementIter() const { ASSERT(complete()); return ElementIter(idTable_); } inline Boolean GroveImpl::maybeMoreSiblings(const ParentChunk *chunk) const { return (complete_ ? chunk->nextSibling != 0 : (origin_ == chunk || &chunk->nextSibling == tailPtr_ || maybeMoreSiblings1(chunk))); } inline void *GroveImpl::allocChunk(size_t n) { nChunksSinceLocOrigin_++; if (n <= nFree_) { void *p = freePtr_; freePtr_ += n; nFree_ -= n; return p; } else return allocFinish(n); } inline void GroveImpl::setLocOrigin(const ConstPtr &locOrigin) { if (locOrigin.pointer() != currentLocOrigin_ || nChunksSinceLocOrigin_ >= maxChunksWithoutLocOrigin) storeLocOrigin(locOrigin); } inline void GroveImpl::appendMessage(MessageItem *item) { *messageListTailP_ = item; messageListTailP_ = item->nextP(); pulse(); } inline void ElementNode::add(GroveImpl &grove, const StartElementEvent &event) { grove.setLocOrigin(event.location().origin()); ElementChunk *chunk; const AttributeList &atts = event.attributes(); Boolean hasId; if (atts.nSpec() == 0 && !atts.anyCurrent()) { void *mem = grove.allocChunk(sizeof(ElementChunk)); if (event.included()) chunk = new (mem) IncludedElementChunk; else chunk = new (mem) ElementChunk; hasId = 0; } else chunk = makeAttElementChunk(grove, event, hasId); chunk->type = event.elementType(); chunk->locIndex = event.location().index(); grove.push(chunk, hasId); } // We duplicate ChunkNode::nextChunkSibling to take advantage // of Node reuse (via setNodePtrFirst(NodePtr &, const DataNode *). inline AccessResult DataNode::nextChunkSibling(NodePtr &ptr) const { // The forwarding chunk has origin = 0, so it will stop // the iteration before after() can return 0. const Chunk *p = chunk_->after(); while (p == grove()->completeLimit()) if (!grove()->waitForMoreNodes()) return accessTimeout; if (p->origin != chunk_->origin) return accessNull; return p->setNodePtrFirst(ptr, this); } inline void DataNode::reuseFor(const DataChunk *chunk, size_t index) { chunk_ = chunk; index_ = index; } inline void DataNode::add(GroveImpl &grove, const DataEvent &event) { size_t dataLen = event.dataLength(); if (dataLen) { DataChunk *chunk = grove.pendingData(); if (chunk && event.location().origin().pointer() == grove.currentLocOrigin() && event.location().index() == chunk->locIndex + chunk->size && grove.tryExtend(CharsChunk::allocSize(chunk->size + dataLen) - CharsChunk::allocSize(chunk->size))) { memcpy((Char *)(chunk + 1) + chunk->size, event.data(), dataLen * sizeof(Char)); chunk->size += dataLen; } else { grove.setLocOrigin(event.location().origin()); chunk = new (grove.allocChunk(CharsChunk::allocSize(dataLen))) DataChunk; chunk->size = dataLen; chunk->locIndex = event.location().index(); memcpy(chunk + 1, event.data(), dataLen * sizeof(Char)); grove.appendSibling(chunk); } } } GroveBuilderMessageEventHandler::GroveBuilderMessageEventHandler(unsigned groveIndex, Messenger *mgr, MessageFormatter *msgFmt) : mgr_(mgr), grove_(new GroveImpl(groveIndex)), msgFmt_(msgFmt) { grove_->addRef(); } GroveBuilderMessageEventHandler::~GroveBuilderMessageEventHandler() { grove_->setComplete(); grove_->release(); } void GroveBuilderMessageEventHandler::makeInitialRoot(NodePtr &root) { root.assign(new SgmlDocumentNode(grove_, grove_->root())); } void GroveBuilderMessageEventHandler::message(MessageEvent *event) { mgr_->dispatchMessage(event->message()); const Message &msg = event->message(); StrOutputCharStream os; msgFmt_->formatMessage(*msg.type, msg.args, os); StringC tem; os.extractString(tem); Node::Severity severity; switch (msg.type->severity()) { case MessageType::info: severity = Node::info; break; case MessageType::warning: severity = Node::warning; break; default: severity = Node::error; break; } grove_->appendMessage(new MessageItem(severity, tem, msg.loc)); if (!msg.auxLoc.origin().isNull()) { msgFmt_->formatMessage(msg.type->auxFragment(), msg.args, os); os.extractString(tem); grove_->appendMessage(new MessageItem(Node::info, tem, msg.auxLoc)); } ErrorCountEventHandler::message(event); } void GroveBuilderMessageEventHandler::sgmlDecl(SgmlDeclEvent *event) { grove_->setSd(event->sdPointer(), event->prologSyntaxPointer(), event->instanceSyntaxPointer()); delete event; } void GroveBuilderMessageEventHandler::setSd(const ConstPtr &sd, const ConstPtr &prologSyntax, const ConstPtr &instanceSyntax) { grove_->setSd(sd, prologSyntax, instanceSyntax); } GroveBuilderEventHandler::GroveBuilderEventHandler(unsigned groveIndex, Messenger *mgr, MessageFormatter *msgFmt) : GroveBuilderMessageEventHandler(groveIndex, mgr, msgFmt) { } void GroveBuilderEventHandler::appinfo(AppinfoEvent *event) { const StringC *appinfo; if (event->literal(appinfo)) grove_->setAppinfo(*appinfo); delete event; } void GroveBuilderEventHandler::endProlog(EndPrologEvent *event) { grove_->setGoverningDtd(event->dtdPointer()); delete event; } void GroveBuilderEventHandler::endDtd(EndDtdEvent *event) { grove_->addDtd(event->dtdPointer()); delete event; } void GroveBuilderEventHandler::startElement(StartElementEvent *event) { ElementNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::endElement(EndElementEvent *event) { grove_->pop(); delete event; } void GroveBuilderEventHandler::data(DataEvent *event) { DataNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::sdataEntity(SdataEntityEvent *event) { SdataNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::nonSgmlChar(NonSgmlCharEvent *event) { NonSgmlNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::externalDataEntity(ExternalDataEntityEvent *event) { ExternalDataNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::subdocEntity(SubdocEntityEvent *event) { SubdocNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::pi(PiEvent *event) { PiNode::add(*grove_, *event); delete event; } void GroveBuilderEventHandler::entityDefaulted(EntityDefaultedEvent *event) { grove_->addDefaultedEntity(event->entityPointer()); delete event; } ErrorCountEventHandler *GroveBuilder::make(unsigned index, Messenger *mgr, MessageFormatter *msgFmt, bool validateOnly, NodePtr &root) { GroveBuilderMessageEventHandler *eh; if (validateOnly) eh = new GroveBuilderMessageEventHandler(index, mgr, msgFmt); else eh = new GroveBuilderEventHandler(index, mgr, msgFmt); eh->makeInitialRoot(root); return eh; } ErrorCountEventHandler *GroveBuilder::make(unsigned index, Messenger *mgr, MessageFormatter *msgFmt, bool validateOnly, const ConstPtr &sd, const ConstPtr &prologSyntax, const ConstPtr &instanceSyntax, NodePtr &root) { GroveBuilderMessageEventHandler *eh; if (validateOnly) eh = new GroveBuilderMessageEventHandler(index, mgr, msgFmt); else eh = new GroveBuilderEventHandler(index, mgr, msgFmt); eh->makeInitialRoot(root); eh->setSd(sd, prologSyntax, instanceSyntax); return eh; } bool GroveBuilder::setBlocking(bool b) { bool prev = blockingAccess; blockingAccess = b; return prev; } GroveImpl::GroveImpl(unsigned groveIndex) : groveIndex_(groveIndex), root_(0), impliedAttributeValue_(new ImpliedAttributeValue), tailPtr_(0), freePtr_(0), nFree_(0), blocks_(0), blockTailPtr_(&blocks_), blockAllocSize_(initialBlockSize), nBlocksThisSizeAlloced_(0), complete_(0), mutexPtr_(&mutex_), pulseStep_(0), nEvents_(0), haveAppinfo_(0), pendingData_(0), nElements_(0), currentLocOrigin_(0), completeLimitWithLocChunkAfter_(0), nChunksSinceLocOrigin_(0), messageList_(0), messageListTailP_(&messageList_) { root_ = new (allocChunk(sizeof(SgmlDocumentChunk))) SgmlDocumentChunk; root_->origin = 0; root_->locIndex = 0; completeLimit_ = freePtr_; origin_ = root_; tailPtr_ = &root_->prolog; } GroveImpl::~GroveImpl() { while (blocks_) { BlockHeader *tem = blocks_; blocks_ = blocks_->next; ::operator delete(tem); } while (messageList_) { MessageItem *tem = messageList_; messageList_ = *messageList_->nextP(); delete tem; } } void GroveImpl::setAppinfo(const StringC &appinfo) { appinfo_ = appinfo; haveAppinfo_ = 1; } Boolean GroveImpl::getAppinfo(const StringC *&appinfo) const { if (!haveAppinfo_) { if (!complete_ && sd_.isNull()) return 0; // not available yet appinfo = 0; } else appinfo = &appinfo_; return 1; } void GroveImpl::setSd(const ConstPtr &sd, const ConstPtr &prologSyntax, const ConstPtr &instanceSyntax) { instanceSyntax_ = instanceSyntax; prologSyntax_ = prologSyntax; sd_ = sd; } void GroveImpl::getSd(ConstPtr &sd, ConstPtr &prologSyntax, ConstPtr &instanceSyntax) const { instanceSyntax = instanceSyntax_; prologSyntax = prologSyntax_; sd = sd_; } void GroveImpl::finishProlog() { if (root_->prolog) addBarrier(); tailPtr_ = 0; } void GroveImpl::finishDocumentElement() { // Be robust in the case of erroneous documents. if (root_->epilog == 0) { addBarrier(); tailPtr_ = &root_->epilog; } } void GroveImpl::addBarrier() { if (freePtr_) { (void) new (freePtr_) ForwardingChunk(0, 0); if (nFree_ <= sizeof(ForwardingChunk)) { nFree_ = 0; freePtr_ = 0; } else { nFree_ -= sizeof(ForwardingChunk); freePtr_ += sizeof(ForwardingChunk); } } } void GroveImpl::setComplete() { addBarrier(); mutexPtr_ = 0; completeLimit_ = 0; completeLimitWithLocChunkAfter_ = 0; if (pendingData_ && tailPtr_) *tailPtr_ = pendingData_; tailPtr_ = 0; pendingData_ = 0; complete_ = 1; moreNodesCondition_.set(); } void GroveImpl::addDefaultedEntity(const ConstPtr &entity) { Mutex::Lock lock(mutexPtr_); // We need a table of ConstPtr but we don't have one. defaultedEntityTable_.insert((Entity *)entity.pointer()); } const Entity *GroveImpl::lookupDefaultedEntity(const StringC &name) const { Mutex::Lock lock(mutexPtr_); return defaultedEntityTable_.lookupTemp(name); } Dtd::ConstEntityIter GroveImpl::defaultedEntityIter() const { ASSERT(complete()); return Dtd::ConstEntityIter(defaultedEntityTable_); } Boolean GroveImpl::maybeMoreSiblings1(const ParentChunk *chunk) const { for (const ParentChunk *open = origin_; open; open = open->origin) if (open == chunk) return 1; // for multi-thread case return tailPtr_ == &chunk->nextSibling || chunk->nextSibling != 0; } void *GroveImpl::allocFinish(size_t n) { if (++nBlocksThisSizeAlloced_ >= maxBlocksPerSize) { blockAllocSize_ *= 2; nBlocksThisSizeAlloced_ = 0; } size_t allocSize = n + (sizeof(ForwardingChunk) + sizeof(BlockHeader)); if (allocSize < blockAllocSize_) { nFree_ = blockAllocSize_ - allocSize; allocSize = blockAllocSize_; } else nFree_ = 0; *blockTailPtr_ = new (::operator new(allocSize)) BlockHeader; char *chunkStart = (char *)(*blockTailPtr_ + 1); blockTailPtr_ = &(*blockTailPtr_)->next; if (freePtr_) (void)new (freePtr_) ForwardingChunk((const Chunk *)chunkStart, origin_); freePtr_ = chunkStart + n; return chunkStart; } AccessResult ChunkNode::getLocation(Location &loc) const { const Origin *origin = grove()->currentLocOrigin(); for (const Chunk *p = chunk_->after(); p; p = p->after()) { if (p == grove()->completeLimitWithLocChunkAfter()) { while (!p->getLocOrigin(origin)) { p = p->after(); ASSERT(p != 0); } break; } if (p == grove()->completeLimit() || p->getLocOrigin(origin)) break; } if (!origin) return accessNull; loc = Location(new GroveImplProxyOrigin(grove(), origin), chunk_->locIndex); return accessOK; } void GroveImpl::storeLocOrigin(const ConstPtr &locOrigin) { LocOriginChunk *chunk = new (allocChunk(sizeof(LocOriginChunk))) LocOriginChunk(currentLocOrigin_); chunk->origin = origin_; completeLimitWithLocChunkAfter_ = completeLimit_; nChunksSinceLocOrigin_ = 0; if (locOrigin.pointer() == currentLocOrigin_) return; if (currentLocOrigin_ && locOrigin == currentLocOrigin_->parent().origin()) { // Don't need to store it. currentLocOrigin_ = locOrigin.pointer(); return; } currentLocOrigin_ = locOrigin.pointer(); if (locOrigin.isNull()) return; origins_.push_back(locOrigin); } AccessResult GroveImpl::proxifyLocation(const Location &loc, Location &ret) const { if (loc.origin().isNull()) return accessNull; ret = Location(new GroveImplProxyOrigin(this, loc.origin().pointer()), loc.index()); return accessOK; } NodeListPtr AttributesNamedNodeList::nodeList() const { const AttributeDefinitionList *defList = attDefList(); if (!defList || defList->size() == 0) return new BaseNodeList; else return new SiblingNodeList(makeAttributeAsgnNode(grove(), 0)); } AccessResult AttributesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const AttributeDefinitionList *defList = attDefList(); if (defList) { for (size_t i = 0; i < defList->size(); i++) if (defList->def(i)->name() == str) { ptr.assign(makeAttributeAsgnNode(grove(), i)); return accessOK; } } return accessNull; } void SgmlDocumentNode::accept(NodeVisitor &visitor) { visitor.sgmlDocument(*this); } AccessResult SgmlDocumentNode::getSgmlConstants(NodePtr &ptr) const { ptr.assign(new SgmlConstantsNode(grove())); return accessOK; } AccessResult SgmlDocumentNode::getApplicationInfo(GroveString &str) const { const StringC *appinfo; while (!grove()->getAppinfo(appinfo)) if (!grove()->waitForMoreNodes()) return accessTimeout; if (!appinfo) return accessNull; setString(str, *appinfo); return accessOK; } AccessResult SgmlDocumentNode::getDocumentElement(NodePtr &ptr) const { while (chunk()->documentElement == 0) { if (grove()->complete()) { // Just in case another thread crept if (chunk()->documentElement) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } return chunk()->documentElement->setNodePtrFirst(ptr, this); } AccessResult SgmlDocumentNode::getProlog(NodeListPtr &ptr) const { while (chunk()->prolog == 0) { if (chunk()->documentElement || grove()->complete()) break; if (!grove()->waitForMoreNodes()) return accessTimeout; } if (chunk()->prolog == 0) ptr.assign(new BaseNodeList); else { NodePtr tem; chunk()->prolog->setNodePtrFirst(tem, this); ptr.assign(new SiblingNodeList(tem)); } return accessOK; } AccessResult SgmlDocumentNode::getEpilog(NodeListPtr &ptr) const { while (chunk()->epilog == 0) { if (grove()->complete()) break; if (!grove()->waitForMoreNodes()) return accessTimeout; } if (chunk()->epilog == 0) ptr.assign(new BaseNodeList); else { NodePtr tem; chunk()->epilog->setNodePtrFirst(tem, this); ptr.assign(new SiblingNodeList(tem)); } return accessOK; } AccessResult SgmlDocumentNode::getElements(NamedNodeListPtr &ptr) const { while (!grove()->root()->documentElement) { if (grove()->complete()) { if (grove()->root()->documentElement) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } if (!grove()->generalSubstTable()) return accessNull; ptr.assign(new ElementsNamedNodeList(grove())); return accessOK; } AccessResult SgmlDocumentNode::getEntities(NamedNodeListPtr &ptr) const { while (!grove()->governingDtd()) { if (grove()->complete()) { if (grove()->governingDtd()) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } ptr.assign(new DocEntitiesNamedNodeList(grove())); return accessOK; } AccessResult SgmlDocumentNode::getDefaultedEntities(NamedNodeListPtr &ptr) const { while (!grove()->complete()) if (!grove()->waitForMoreNodes()) return accessTimeout; ptr.assign(new DefaultedEntitiesNamedNodeList(grove())); return accessOK; } AccessResult SgmlDocumentNode::getGoverningDoctype(NodePtr &ptr) const { while (!grove()->governingDtd()) { if (grove()->complete()) { if (grove()->governingDtd()) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } ptr.assign(new DocumentTypeNode(grove(), grove()->governingDtd())); return accessOK; } AccessResult SgmlDocumentNode::getDoctypesAndLinktypes(NamedNodeListPtr &ptr) const { while (!grove()->governingDtd()) { if (grove()->complete()) { if (grove()->governingDtd()) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } ptr.assign(new DoctypesAndLinktypesNamedNodeList(grove())); return accessOK; } AccessResult SgmlDocumentNode::getMessages(NodeListPtr &ptr) const { while (grove()->messageList() == 0) { if (grove()->complete()) break; if (!grove()->waitForMoreNodes()) return accessTimeout; } if (grove()->messageList()) { NodePtr tem(new MessageNode(grove(), grove()->messageList())); ptr.assign(new SiblingNodeList(tem)); } else ptr.assign(new BaseNodeList); return accessOK; } AccessResult SgmlDocumentNode::getSd(ConstPtr &sd, ConstPtr &prologSyntax, ConstPtr &instanceSyntax) const { while (!grove()->complete()) { if (!grove()->waitForMoreNodes()) return accessTimeout; } grove()->getSd(sd, prologSyntax, instanceSyntax); if (!sd.isNull() && !prologSyntax.isNull() && !instanceSyntax.isNull()) return accessOK; return accessNull; } AccessResult SgmlDocumentChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new SgmlDocumentNode(node->grove(), this)); return accessOK; } DocumentTypeNode::DocumentTypeNode(const GroveImpl *grove, const Dtd *dtd) : BaseNode(grove), dtd_(dtd) { } AccessResult DocumentTypeNode::nextChunkSibling(NodePtr &ptr) const { const Dtd *next = grove()->nextDtd(dtd_); if (!next) return accessNull; ptr.assign(new DocumentTypeNode(grove(), next)); return accessOK; } AccessResult DocumentTypeNode::getName(GroveString &str) const { setString(str, dtd_->name()); return accessOK; } AccessResult DocumentTypeNode::getGoverning(bool &governing) const { governing = dtd_->isBase(); return accessOK; } AccessResult DocumentTypeNode::getGeneralEntities(NamedNodeListPtr &ptr) const { ptr.assign(new GeneralEntitiesNamedNodeList(grove(), dtd_)); return accessOK; } AccessResult DocumentTypeNode::getParameterEntities(NamedNodeListPtr &ptr) const { ptr.assign(new ParameterEntitiesNamedNodeList(grove(), dtd_)); return accessOK; } AccessResult DocumentTypeNode::getNotations(NamedNodeListPtr &ptr) const { ptr.assign(new NotationsNamedNodeList(grove(), dtd_)); return accessOK; } AccessResult DocumentTypeNode::getElementTypes(NamedNodeListPtr &ptr) const { ptr.assign(new ElementTypesNamedNodeList(grove(), dtd_)); return accessOK; } AccessResult DocumentTypeNode::getDefaultEntity(NodePtr &ptr) const { const Entity *entity = dtd_->defaultEntityTemp(); if (entity == 0) return accessNull; ptr.assign(new DefaultEntityNode(grove(), entity)); return accessOK; } AccessResult DocumentTypeNode::getOrigin(NodePtr &ptr) const { ptr.assign(new SgmlDocumentNode(grove(), grove()->root())); return accessOK; } void DocumentTypeNode::accept(NodeVisitor &visitor) { visitor.documentType(*this); } bool DocumentTypeNode::same(const BaseNode &node) const { return node.same2(this); } bool DocumentTypeNode::same2(const DocumentTypeNode *node) const { return dtd_ == node->dtd_; } SgmlConstantsNode::SgmlConstantsNode(const GroveImpl *grove) : BaseNode(grove) { } AccessResult SgmlConstantsNode::getOrigin(NodePtr &ptr) const { ptr.assign(new SgmlDocumentNode(grove(), grove()->root())); return accessOK; } void SgmlConstantsNode::accept(NodeVisitor &visitor) { visitor.sgmlConstants(*this); } bool SgmlConstantsNode::same(const BaseNode &node) const { return node.same2(this); } bool SgmlConstantsNode::same2(const SgmlConstantsNode *) const { return 1; } MessageNode::MessageNode(const GroveImpl *grove, const MessageItem *item) : BaseNode(grove), item_(item) { } AccessResult MessageNode::getOrigin(NodePtr &ptr) const { ptr.assign(new SgmlDocumentNode(grove(), grove()->root())); return accessOK; } AccessResult MessageNode::nextChunkSibling(NodePtr &ptr) const { while (!item_->next()) { if (grove()->complete()) { if (item_->next()) break; return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } const MessageItem *p = item_->next(); if (!p) return accessNull; ptr.assign(new MessageNode(grove(), p)); return accessOK; } AccessResult MessageNode::firstSibling(NodePtr &ptr) const { ptr.assign(new MessageNode(grove(), grove()->messageList())); return accessOK; } AccessResult MessageNode::siblingsIndex(unsigned long &n) const { n = 0; for (const MessageItem *p = grove()->messageList(); p != item_; p = p->next()) n++; return accessOK; } void MessageNode::accept(NodeVisitor &visitor) { visitor.message(*this); } bool MessageNode::same(const BaseNode &node) const { return node.same2(this); } bool MessageNode::same2(const MessageNode *node) const { return item_ == node->item_; } AccessResult MessageNode::getLocation(Location &loc) const { return grove()->proxifyLocation(item_->loc(), loc); } AccessResult MessageNode::getText(GroveString &str) const { setString(str, item_->text()); return accessOK; } AccessResult MessageNode::getSeverity(Severity &severity) const { severity = item_->severity(); return accessOK; } AccessResult ElementNode::nextChunkSibling(NodePtr &ptr) const { while (!chunk()->nextSibling) { if (!grove()->maybeMoreSiblings(chunk())) { // Allow for the possibility of invalid documents with elements in the epilog. if ((const Chunk *)chunk() == grove()->root()->documentElement) return accessNotInClass; else return accessNull; } if (!grove()->waitForMoreNodes()) return accessTimeout; } return chunk()->nextSibling->setNodePtrFirst(ptr, this); } // This is a duplicate of ChunkNode::nextChunkAfter // to take advantage of overloaded setNodePtrFirst. AccessResult ElementNode::nextChunkAfter(NodePtr &nd) const { const Chunk *p = chunk_->after(); while (p == grove()->completeLimit()) if (!grove()->waitForMoreNodes()) return accessTimeout; return p->setNodePtrFirst(nd, this); } AccessResult ElementChunk::getFollowing(const GroveImpl *grove, const Chunk *&f, unsigned long &n) const { while (!nextSibling) { if (!grove->maybeMoreSiblings(this)) { if ((const Chunk *)origin == grove->root()) return accessNotInClass; else return accessNull; } if (!grove->waitForMoreNodes()) return accessTimeout; } f = nextSibling; n = 1; return accessOK; } AccessResult ElementNode::firstChild(NodePtr &ptr) const { const Chunk *p = chunk()->after(); while (p == grove()->completeLimit()) { if (!grove()->waitForMoreNodes()) return accessTimeout; } if ((const Chunk *)(p->origin) == chunk()) return p->setNodePtrFirst(ptr, this); return accessNull; } AccessResult ElementNode::attributeRef(unsigned long n, NodePtr &ptr) const { const AttributeDefinitionList *defList = chunk()->attDefList(); if (!defList || n >= defList->size()) return accessNull; ptr.assign(new ElementAttributeAsgnNode(grove(), size_t(n), chunk())); return accessOK; } AccessResult ElementNode::getAttributes(NamedNodeListPtr &ptr) const { ptr.assign(new ElementAttributesNamedNodeList(grove(), chunk())); return accessOK; } AccessResult ElementNode::getGi(GroveString &str) const { setString(str, chunk()->type->name()); return accessOK; } bool ElementNode::hasGi(GroveString str) const { const StringC &gi = chunk()->type->name(); size_t len = gi.size(); if (len != str.size()) return 0; const SubstTable *subst = grove()->generalSubstTable(); if (!subst) return 0; for (size_t i = 0; i < len; i++) if ((*subst)[str[i]] != gi[i]) return 0; return 1; } AccessResult ElementNode::getId(GroveString &str) const { const StringC *id = chunk()->id(); if (!id) return accessNull; setString(str, *id); return accessOK; } AccessResult ElementNode::elementIndex(unsigned long &i) const { i = chunk()->elementIndex; return accessOK; } AccessResult ElementNode::getElementType(NodePtr &ptr) const { if (chunk()->elementType() == 0) return accessNull; ptr.assign(new ElementTypeNode(grove(), *(chunk()->elementType()))); return accessOK; } AccessResult ElementNode::getContent(NodeListPtr &ptr) const { return children(ptr); } AccessResult ElementNode::getMustOmitEndTag(bool &b) const { b = chunk()->mustOmitEndTag(); return accessOK; } AccessResult ElementNode::getIncluded(bool &b) const { b = chunk()->included(); return accessOK; } void ElementNode::accept(NodeVisitor &visitor) { visitor.element(*this); } ElementChunk * ElementNode::makeAttElementChunk(GroveImpl &grove, const StartElementEvent &event, Boolean &hasId) { const AttributeList &atts = event.attributes(); size_t nAtts = atts.size(); while (nAtts > 0 && !atts.specified(nAtts - 1) && !atts.current(nAtts - 1)) nAtts--; ElementChunk *chunk; void *mem = grove.allocChunk(sizeof(AttElementChunk) + nAtts * sizeof(AttributeValue *)); if (event.included()) { // Workaround VC++ 4.1 bug. AttElementChunk *tem = new (mem) IncludedAttElementChunk(nAtts); chunk = tem; } else chunk = new (mem) AttElementChunk(nAtts); const AttributeValue **values = (const AttributeValue **)(((AttElementChunk *)chunk) + 1); const AttributeDefinitionList *defList = event.elementType()->attributeDef().pointer(); unsigned idIndex; if (atts.idIndex(idIndex) && atts.specified(idIndex) && atts.value(idIndex)) hasId = 1; else hasId = 0; for (size_t i = 0; i < nAtts; i++) { if (atts.specified(i) || atts.current(i)) { grove.storeAttributeValue(atts.valuePointer(i)); values[i] = atts.value(i); } else { // If we stored a reference to the implied attribute value in the // Dtd then it would be safe just to use atts.value(i) here. // But that would mean we couldn't conveniently tell whether it // was specified or implied. values[i] = defList->def(i)->defaultValue(grove.impliedAttributeValue()); } } return chunk; } const Chunk *AttElementChunk::after() const { return (const Chunk *)((char *)(this + 1) + (sizeof(const AttributeValue *) * nAtts)); } const AttributeValue * AttElementChunk::attributeValue(size_t attIndex, const GroveImpl &grove) const { if (attIndex < nAtts) return ((const AttributeValue **)(this + 1))[attIndex]; else return ElementChunk::attributeValue(attIndex, grove); } const StringC *AttElementChunk::id() const { size_t i = ElementChunk::attDefList()->idIndex(); if (i == size_t(-1) || i >= nAtts) return 0; const AttributeValue *av = ((const AttributeValue **)(this + 1))[i]; if (!av) return 0; const Text *t = av->text(); if (!t) return 0; return &t->string(); } Boolean AttElementChunk::mustOmitEndTag() const { if (ElementChunk::mustOmitEndTag()) return 1; const AttributeDefinitionList *adl = ElementChunk::attDefList(); size_t nAtts = adl->size(); const AttributeValue **atts = (const AttributeValue **)(this + 1); for (size_t i = 0; i < nAtts; i++) if (adl->def(i)->isConref() && atts[i] && atts[i]->text()) return 1; return 0; } const Chunk *ElementChunk::after() const { return this + 1; } const AttributeValue * ElementChunk::attributeValue(size_t attIndex, const GroveImpl &grove) const { return attDefList()->def(attIndex)->defaultValue(grove.impliedAttributeValue()); } Boolean ElementChunk::mustOmitEndTag() const { return type->definition()->declaredContent() == ElementDefinition::empty; } Boolean IncludedElementChunk::included() const { return 1; } Boolean IncludedAttElementChunk::included() const { return 1; } Boolean ElementChunk::included() const { return 0; } AccessResult ElementChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new ElementNode(node->grove(), this)); return accessOK; } AccessResult ElementChunk::setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const { if (node->canReuse(ptr)) ((ElementNode *)node)->reuseFor(this); else ptr.assign(new ElementNode(node->grove(), this)); return accessOK; } AccessResult ElementChunk::setNodePtrFirst(NodePtr &ptr, const DataNode *node) const { ptr.assign(new ElementNode(node->grove(), this)); return accessOK; } ElementAttributeOrigin::ElementAttributeOrigin(const ElementChunk *chunk) : chunk_(chunk) { } const AttributeDefinitionList *ElementAttributeOrigin::attDefList() const { return chunk_->attDefList(); } const AttributeValue * ElementAttributeOrigin::attributeValue(size_t attIndex, const GroveImpl &grove) const { return chunk_->attributeValue(attIndex, grove); } AccessResult ElementAttributeOrigin::setNodePtrAttributeOrigin(NodePtr &ptr, const BaseNode *node) const { return chunk_->setNodePtrFirst(ptr, node); } Node *ElementAttributeOrigin ::makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const { return new ElementCdataAttributeValueNode(grove, value, attIndex, iter, charIndex, chunk_); } Node *ElementAttributeOrigin ::makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const { return new ElementAttributeValueTokenNode(grove, value, attIndex, tokenIndex, chunk_); } Node *ElementAttributeOrigin ::makeAttributeAsgnNode(const GroveImpl *grove, size_t attIndex) const { return new ElementAttributeAsgnNode(grove, attIndex, chunk_); } AccessResult ElementAttributeOrigin ::makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const { if (chunk_->elementType() == 0) return accessNull; ptr.assign(new ElementTypeAttributeDefNode(grove, *(chunk_->elementType()), attributeDefIdx)); return accessOK; } Node *ElementAttributeOrigin::makeOriginNode(const GroveImpl *grove, size_t attIndex) const { return makeAttributeAsgnNode(grove, attIndex); } const void *ElementAttributeOrigin::attributeOriginId() const { return chunk_; } bool DataNode::same(const BaseNode &node) const { return node.same2(this); } bool DataNode::same2(const DataNode *node) const { return chunk_ == node->chunk_ && index_ == node->index_; } bool DataNode::chunkContains(const Node &node) const { if (!sameGrove(node)) return 0; return ((const BaseNode &)node).inChunk(this); } bool DataNode::inChunk(const DataNode *node) const { return chunk_ == node->chunk_ && index_ >= node->index_; } AccessResult DataNode::charChunk(const SdataMapper &, GroveString &str) const { str.assign(chunk()->data() + index_, chunk()->size - index_); return accessOK; } void DataNode::accept(NodeVisitor &visitor) { visitor.dataChar(*this); } unsigned long DataNode::hash() const { return secondHash(ChunkNode::hash() + index_); } AccessResult DataNode::getNonSgml(unsigned long &) const { return accessNull; } AccessResult DataNode::nextSibling(NodePtr &ptr) const { if (index_ + 1 < chunk()->size) { if (canReuse(ptr)) ((DataNode *)this)->index_ += 1; else ptr.assign(new DataNode(grove(), chunk(), index_ + 1)); return accessOK; } return DataNode::nextChunkSibling(ptr); } AccessResult DataNode::nextChunkAfter(NodePtr &nd) const { const Chunk *p = chunk_->after(); while (p == grove()->completeLimit()) if (!grove()->waitForMoreNodes()) return accessTimeout; return p->setNodePtrFirst(nd, this); } AccessResult DataNode::followSiblingRef(unsigned long i, NodePtr &ptr) const { if (i < chunk()->size - index_ - 1) { if (canReuse(ptr)) ((DataNode *)this)->index_ += 1 + size_t(i); else ptr.assign(new DataNode(grove(), chunk(), index_ + size_t(i) + 1)); return accessOK; } return ChunkNode::followSiblingRef(i - (chunk()->size - index_ - 1), ptr); } AccessResult DataNode::siblingsIndex(unsigned long &i) const { AccessResult ret = ChunkNode::siblingsIndex(i); if (ret == accessOK) i += index_; return ret; } AccessResult DataNode::getLocation(Location &loc) const { AccessResult ret = ChunkNode::getLocation(loc); if (ret == accessOK) loc += index_; return ret; } AccessResult DataChunk::getFollowing(const GroveImpl *grove, const Chunk *&f, unsigned long &i) const { // We could call Chunk::getFollowing to do most of // the work, but that would cost us a couple of extra // virtual function calls. const Chunk *p = CharsChunk::after(); while (p == grove->completeLimit()) if (!grove->waitForMoreNodes()) return accessTimeout; if (p->origin != origin) return accessNull; i = size; f = p; return accessOK; } AccessResult DataChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new DataNode(node->grove(), this, 0)); return accessOK; } // This just saves us a virtual function call in a common case AccessResult DataChunk::setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const { ptr.assign(new DataNode(node->grove(), this, 0)); return accessOK; } AccessResult DataChunk::setNodePtrFirst(NodePtr &ptr, const DataNode *node) const { if (node->canReuse(ptr)) ((DataNode *)node)->reuseFor(this, 0); else ptr.assign(new DataNode(node->grove(), this, 0)); return accessOK; } AccessResult PiNode::getSystemData(GroveString &str) const { str.assign(chunk()->data(), chunk()->size); return accessOK; } void PiNode::add(GroveImpl &grove, const PiEvent &event) { const Entity *entity = event.entity(); if (entity) PiEntityNode::add(grove, entity, event.location()); else { grove.setLocOrigin(event.location().origin()); size_t dataLen = event.dataLength(); void *mem = grove.allocChunk(CharsChunk::allocSize(dataLen)); PiChunk *chunk; if (grove.haveRootOrigin()) { if (grove.root()->documentElement) chunk = new (mem) EpilogPiChunk; else chunk = new (mem) PrologPiChunk; } else chunk = new (mem) PiChunk; chunk->size = dataLen; chunk->locIndex = event.location().index(); memcpy(chunk + 1, event.data(), dataLen * sizeof(Char)); grove.appendSibling(chunk); } } AccessResult PiChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new PiNode(node->grove(), this)); return accessOK; } AccessResult PrologPiChunk::getFirstSibling(const GroveImpl *grove, const Chunk *&p) const { p = grove->root()->prolog; return accessOK; } AccessResult EpilogPiChunk::getFirstSibling(const GroveImpl *grove, const Chunk *&p) const { p = grove->root()->epilog; return accessOK; } AccessResult SdataNode::charChunk(const SdataMapper &mapper, GroveString &str) const { const StringC &name = chunk()->entity->name(); const StringC &text = chunk()->entity->asInternalEntity()->string(); Char *cp = (Char *)&c_; if (mapper.sdataMap(GroveString(name.data(), name.size()), GroveString(text.data(), text.size()), *cp)) { str.assign(&c_, 1); return accessOK; } else return accessNull; } AccessResult SdataNode::getSystemData(GroveString &str) const { setString(str, chunk()->entity->asInternalEntity()->string()); return accessOK; } void SdataNode::add(GroveImpl &grove, const SdataEntityEvent &event) { const Location &loc = event.location().origin()->parent(); grove.setLocOrigin(loc.origin()); SdataChunk *chunk = new (grove.allocChunk(sizeof(SdataChunk))) SdataChunk; chunk->entity = event.entity(); chunk->locIndex = loc.index(); grove.appendSibling(chunk); } AccessResult SdataChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new SdataNode(node->grove(), this)); return accessOK; } AccessResult NonSgmlChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new NonSgmlNode(node->grove(), this)); return accessOK; } AccessResult NonSgmlNode::getNonSgml(unsigned long &n) const { n = chunk()->c; return accessOK; } AccessResult NonSgmlNode::charChunk(const SdataMapper &, GroveString &) const { return accessNull; } void NonSgmlNode::add(GroveImpl &grove, const NonSgmlCharEvent &event) { grove.setLocOrigin(event.location().origin()); NonSgmlChunk *chunk = new (grove.allocChunk(sizeof(NonSgmlChunk))) NonSgmlChunk; chunk->c = event.character(); chunk->locIndex = event.location().index(); grove.appendSibling(chunk); } void ExternalDataNode::add(GroveImpl &grove, const ExternalDataEntityEvent &event) { grove.setLocOrigin(event.location().origin()); ExternalDataChunk *chunk = new (grove.allocChunk(sizeof(ExternalDataChunk))) ExternalDataChunk; chunk->entity = event.entity(); chunk->locIndex = event.location().index(); grove.appendSibling(chunk); } AccessResult ExternalDataChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new ExternalDataNode(node->grove(), this)); return accessOK; } void SubdocNode::add(GroveImpl &grove, const SubdocEntityEvent &event) { grove.setLocOrigin(event.location().origin()); SubdocChunk *chunk = new (grove.allocChunk(sizeof(SubdocChunk))) SubdocChunk; chunk->entity = event.entity(); chunk->locIndex = event.location().index(); grove.appendSibling(chunk); } AccessResult SubdocChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new SubdocNode(node->grove(), this)); return accessOK; } AccessResult PiEntityNode::getSystemData(GroveString &str) const { setString(str, chunk()->entity->asInternalEntity()->string()); return accessOK; } void PiEntityNode::add(GroveImpl &grove, const Entity *entity, const Location &loc) { // FIXME use parent? grove.setLocOrigin(loc.origin()); PiEntityChunk *chunk = new (grove.allocChunk(sizeof(PiEntityChunk))) PiEntityChunk; chunk->entity = entity; chunk->locIndex = loc.index(); grove.appendSibling(chunk); } AccessResult PiEntityChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new PiEntityNode(node->grove(), this)); return accessOK; } AccessResult EntityRefNode::getEntity(NodePtr &ptr) const { ptr.assign(new EntityNode(grove(), chunk()->entity)); return accessOK; } AccessResult EntityRefNode::getEntityName(GroveString &str) const { setString(str, chunk()->entity->name()); return accessOK; } AttributeAsgnNode::AttributeAsgnNode(const GroveImpl *grove, size_t attIndex) : BaseNode(grove), AttributeDefOrigin(attIndex) { } AccessResult ChunkNode::nextChunkSibling(NodePtr &ptr) const { // The forwarding chunk has origin = 0, so it will stop // the iteration before after() can return 0. const Chunk *p = chunk_->after(); while (p == grove()->completeLimit()) if (!grove()->waitForMoreNodes()) return accessTimeout; if (p->origin != chunk_->origin) return accessNull; return p->setNodePtrFirst(ptr, this); } AccessResult ChunkNode::nextChunkAfter(NodePtr &nd) const { const Chunk *p = chunk_->after(); while (p == grove()->completeLimit()) if (!grove()->waitForMoreNodes()) return accessTimeout; return p->setNodePtrFirst(nd, this); } AccessResult ChunkNode::firstSibling(NodePtr &ptr) const { const Chunk *first; AccessResult ret = chunk_->getFirstSibling(grove(), first); if (ret != accessOK) return ret; return first->setNodePtrFirst(ptr, this); } AccessResult ChunkNode::siblingsIndex(unsigned long &i) const { const Chunk *p; AccessResult ret = chunk_->getFirstSibling(grove(), p); if (ret != accessOK) return ret; i = 0; while (p != chunk_) { unsigned long tem; if (p->getFollowing(grove(), p, tem) != accessOK) CANNOT_HAPPEN(); i += tem; } return accessOK; } AccessResult ChunkNode::followSiblingRef(unsigned long i, NodePtr &ptr) const { const Chunk *p; unsigned long count; AccessResult ret = chunk()->getFollowing(grove(), p, count); if (ret != accessOK) return ret; while (i > 0) { const Chunk *lastP = p; ret = p->getFollowing(grove(), p, count); if (ret == accessOK && count <= i) i -= count; else if (ret == accessOK || ret == accessNull) { lastP->setNodePtrFirst(ptr, this); return ptr->followSiblingRef(i - 1, ptr); } else return ret; } return p->setNodePtrFirst(ptr, this); } AccessResult AttributeAsgnNode::getOrigin(NodePtr &ptr) const { return setNodePtrAttributeOrigin(ptr, this); } AccessResult AttributeAsgnNode::getName(GroveString &str) const { setString(str, attDefList()->def(attIndex_)->name()); return accessOK; } AccessResult AttributeAsgnNode::getImplied(bool &implied) const { const AttributeValue *value = attributeValue(attIndex_, *grove()); implied = (value != 0 && value->text() == 0); return accessOK; } AccessResult AttributeAsgnNode::getValue(NodeListPtr &ptr) const { return children(ptr); } AccessResult AttributeAsgnNode::nextChunkSibling(NodePtr &ptr) const { return followSiblingRef(0, ptr); } AccessResult AttributeAsgnNode::followSiblingRef(unsigned long i, NodePtr &ptr) const { // Do it like this to avoid overflow. if (i >= attDefList()->size() - attIndex_ - 1) return accessNull; if (canReuse(ptr)) ((AttributeAsgnNode *)this)->attIndex_ += size_t(i) + 1; else ptr.assign(makeAttributeAsgnNode(grove(), attIndex_ + 1 + size_t(i))); return accessOK; } AccessResult AttributeAsgnNode::firstSibling(NodePtr &ptr) const { if (canReuse(ptr)) ((AttributeAsgnNode *)this)->attIndex_ = 0; else ptr.assign(makeAttributeAsgnNode(grove(), 0)); return accessOK; } AccessResult AttributeAsgnNode::siblingsIndex(unsigned long &i) const { i = attIndex_; return accessOK; } void AttributeAsgnNode::accept(NodeVisitor &visitor) { visitor.attributeAssignment(*this); } AccessResult AttributeAsgnNode::firstChild(NodePtr &ptr) const { const AttributeValue *value = attributeValue(attIndex_, *grove()); return makeAttributeValueNode(grove(), ptr, value); } AccessResult AttributeAsgnNode::children(NodeListPtr &ptr) const { const AttributeValue *value = attributeValue(attIndex_, *grove()); return makeAttributeValueNodeList(grove(), ptr, value); } AccessResult AttributeAsgnNode::getTokenSep(Char &ch) const { const AttributeValue *value = attributeValue(attIndex_, *grove()); if (!value) return accessNull; const Text *text; const StringC *str; if (value->info(text, str) != AttributeValue::tokenized) return accessNull; const TokenizedAttributeValue *tValue = (const TokenizedAttributeValue *)value; if (tValue->nTokens() <= 1) return accessNull; const Char *ptr; size_t len; tValue->token(0, ptr, len); // the character following the token is a space ch = ptr[len]; return accessOK; } AccessResult AttributeAsgnNode::tokens(GroveString &s) const { const AttributeValue *value = attributeValue(attIndex_, *grove()); if (!value) return accessNull; const Text *text; const StringC *str; if (value->info(text, str) != AttributeValue::tokenized) return accessNull; setString(s, *str); return accessOK; } AccessResult AttributeAsgnNode::getAttributeDef(NodePtr &ptr) const { return makeAttributeDefNode(grove(), ptr, attIndex_); } bool AttributeAsgnNode::same(const BaseNode &node) const { return node.same2(this); } bool AttributeAsgnNode::same2(const AttributeAsgnNode *node) const { return (attributeOriginId() == node->attributeOriginId() && attIndex_ == node->attIndex_); } unsigned long AttributeAsgnNode::hash() const { unsigned long n = (unsigned long)attributeOriginId(); return secondHash(n + attIndex_); } ElementAttributeAsgnNode ::ElementAttributeAsgnNode(const GroveImpl *grove, size_t attIndex, const ElementChunk *chunk) : AttributeAsgnNode(grove, attIndex), ElementAttributeOrigin(chunk), AttributeDefOrigin(attIndex) { } EntityAttributeAsgnNode ::EntityAttributeAsgnNode(const GroveImpl *grove, size_t attIndex, const ExternalDataEntity *entity) : AttributeAsgnNode(grove, attIndex), EntityAttributeOrigin(entity), AttributeDefOrigin(attIndex) { } CdataAttributeValueNode ::CdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) : BaseNode(grove), AttributeDefOrigin(attIndex), value_(value), iter_(iter), charIndex_(charIndex) { } bool CdataAttributeValueNode::skipBoring(TextIter &iter) { while (iter.valid()) { switch (iter.type()) { case TextItem::data: case TextItem::cdata: case TextItem::sdata: { size_t length; iter.chars(length); if (length > 0) return 1; } // fall through default: iter.advance(); break; } } return 0; } AccessResult CdataAttributeValueNode::getParent(NodePtr &ptr) const { ptr.assign(makeOriginNode(grove(), attIndex_)); return accessOK; } AccessResult CdataAttributeValueNode::charChunk(const SdataMapper &mapper, GroveString &str) const { if (iter_.type() == TextItem::sdata) { const Entity *entity = iter_.location().origin()->asEntityOrigin()->entity(); const StringC &name = entity->name(); const StringC &text = entity->asInternalEntity()->string(); Char *cp = (Char *)&c_; if (mapper.sdataMap(GroveString(name.data(), name.size()), GroveString(text.data(), text.size()), *cp)) { str.assign(&c_, 1); return accessOK; } else return accessNull; } size_t len; const Char *s = iter_.chars(len); str.assign(s + charIndex_, len - charIndex_); return accessOK; } AccessResult CdataAttributeValueNode::siblingsIndex(unsigned long &n) const { TextIter copy(iter_); size_t tem; const Char *iterChars = iter_.chars(tem); copy.rewind(); skipBoring(copy); n = 0; while (copy.chars(tem) != iterChars) { if (copy.type() == TextItem::sdata) n += 1; else n += tem; copy.advance(); skipBoring(copy); } n += charIndex_; return accessOK; } AccessResult CdataAttributeValueNode::getEntity(NodePtr &ptr) const { if (iter_.type() != TextItem::sdata) return accessNotInClass; const Entity *entity = iter_.location().origin()->asEntityOrigin()->entity(); ptr.assign(new EntityNode(grove(), entity)); return accessOK; } AccessResult CdataAttributeValueNode::getEntityName(GroveString &str) const { if (iter_.type() != TextItem::sdata) return accessNotInClass; const Entity *entity = iter_.location().origin()->asEntityOrigin()->entity(); setString(str, entity->name()); return accessOK; } AccessResult CdataAttributeValueNode::getSystemData(GroveString &str) const { if (iter_.type() != TextItem::sdata) return accessNotInClass; size_t len; const Char *ptr = iter_.chars(len); str.assign(ptr, len); return accessOK; } AccessResult CdataAttributeValueNode::firstSibling(NodePtr &ptr) const { TextIter copy(iter_); copy.rewind(); skipBoring(copy); if (canReuse(ptr)) { CdataAttributeValueNode *node = (CdataAttributeValueNode *)this; node->iter_ = copy; node->charIndex_ = 0; } else ptr.assign(makeCdataAttributeValueNode(grove(), value_, attIndex_, copy)); return accessOK; } AccessResult CdataAttributeValueNode::nextChunkSibling(NodePtr &ptr) const { TextIter copy(iter_); copy.advance(); if (!skipBoring(copy)) return accessNull; if (canReuse(ptr)) { CdataAttributeValueNode *node = (CdataAttributeValueNode *)this; node->iter_ = copy; node->charIndex_ = 0; } else ptr.assign(makeCdataAttributeValueNode(grove(), value_, attIndex_, copy)); return accessOK; } AccessResult CdataAttributeValueNode::nextSibling(NodePtr &ptr) const { if (iter_.type() != TextItem::sdata) { size_t length; iter_.chars(length); if (charIndex_ + 1 < length) { if (canReuse(ptr)) ((CdataAttributeValueNode *)this)->charIndex_ += 1; else ptr.assign(makeCdataAttributeValueNode(grove(), value_, attIndex_, iter_, charIndex_ + 1)); return accessOK; } } return CdataAttributeValueNode::nextChunkSibling(ptr); } AccessResult CdataAttributeValueNode::getLocation(Location &loc) const { if (iter_.type() == TextItem::sdata) return grove()->proxifyLocation(iter_.location().origin()->parent(), loc); else return grove()->proxifyLocation(iter_.location(), loc); } void CdataAttributeValueNode::accept(NodeVisitor &visitor) { if (iter_.type() == TextItem::sdata) visitor.sdata(*this); else visitor.dataChar(*this); } unsigned long CdataAttributeValueNode::hash() const { unsigned long n; CdataAttributeValueNode::siblingsIndex(n); return secondHash(secondHash((unsigned long)attributeOriginId() + attIndex_) + n); } const ClassDef &CdataAttributeValueNode::classDef() const { if (iter_.type() == TextItem::sdata) return ClassDef::sdata; else return ClassDef::dataChar; } bool CdataAttributeValueNode::same(const BaseNode &node) const { return node.same2(this); } bool CdataAttributeValueNode::same2(const CdataAttributeValueNode *node) const { size_t tem; return (attributeOriginId() == node->attributeOriginId() && attIndex_ == node->attIndex_ && charIndex_ == node->charIndex_ && iter_.chars(tem) == node->iter_.chars(tem)); } bool CdataAttributeValueNode::chunkContains(const Node &node) const { if (!sameGrove(node)) return 0; return ((const BaseNode &)node).inChunk(this); } bool CdataAttributeValueNode::inChunk(const CdataAttributeValueNode *node) const { size_t tem; return (attributeOriginId() == node->attributeOriginId() && attIndex_ == node->attIndex_ && iter_.chars(tem) == node->iter_.chars(tem) && charIndex_ >= node->charIndex_); } ElementCdataAttributeValueNode ::ElementCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ElementChunk *chunk) : CdataAttributeValueNode(grove, value, attIndex, iter, charIndex), ElementAttributeOrigin(chunk), AttributeDefOrigin(attIndex) { } EntityCdataAttributeValueNode ::EntityCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ExternalDataEntity *entity) : CdataAttributeValueNode(grove, value, attIndex, iter, charIndex), EntityAttributeOrigin(entity), AttributeDefOrigin(attIndex) { } ElementTypeCdataAttributeValueNode ::ElementTypeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const ElementType *elementType) : CdataAttributeValueNode(grove, value, attIndex, iter, charIndex), ElementTypeAttributeDefOrigin(elementType), AttributeDefOrigin(attIndex) { } NotationCdataAttributeValueNode ::NotationCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex, const Notation *notation) : CdataAttributeValueNode(grove, value, attIndex, iter, charIndex), NotationAttributeDefOrigin(notation), AttributeDefOrigin(attIndex) { } AttributeValueTokenNode ::AttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) : BaseNode(grove), AttributeDefOrigin(attIndex), value_(value), tokenIndex_(tokenIndex) { } AccessResult AttributeValueTokenNode::getParent(NodePtr &ptr) const { ptr.assign(makeOriginNode(grove(), attIndex_)); return accessOK; } AccessResult AttributeValueTokenNode::nextChunkSibling(NodePtr &ptr) const { return followSiblingRef(0, ptr); } AccessResult AttributeValueTokenNode::followSiblingRef(unsigned long i, NodePtr &ptr) const { // Do it like this to avoid possibility of overflow if (i >= value_->nTokens() - tokenIndex_ - 1) return accessNull; if (canReuse(ptr)) { AttributeValueTokenNode *node = (AttributeValueTokenNode *)this; node->tokenIndex_ += size_t(i) + 1; } else ptr.assign(makeAttributeValueTokenNode(grove(), value_, attIndex_, tokenIndex_ + size_t(i) + 1)); return accessOK; } AccessResult AttributeValueTokenNode::firstSibling(NodePtr &ptr) const { if (canReuse(ptr)) ((AttributeValueTokenNode *)this)->tokenIndex_ = 0; else ptr.assign(makeAttributeValueTokenNode(grove(), value_, attIndex_, 0)); return accessOK; } AccessResult AttributeValueTokenNode::siblingsIndex(unsigned long &i) const { i = tokenIndex_; return accessOK; } AccessResult AttributeValueTokenNode::getToken(GroveString &str) const { const Char *ptr; size_t len; value_->token(tokenIndex_, ptr, len); str.assign(ptr, len); return accessOK; } AccessResult AttributeValueTokenNode::getEntity(NodePtr &ptr) const { if (!attDefList()->def(attIndex_)->isEntity()) return accessNull; StringC token(value_->token(tokenIndex_)); const Entity *entity = grove()->governingDtd()->lookupEntityTemp(0, token); if (!entity) { entity = grove()->lookupDefaultedEntity(token); if (!entity) return accessNull; } ptr.assign(new EntityNode(grove(), entity)); return accessOK; } AccessResult AttributeValueTokenNode::getNotation(NodePtr &ptr) const { if (!attDefList()->def(attIndex_)->isNotation()) return accessNull; StringC token(value_->token(tokenIndex_)); const Notation *notation = grove()->governingDtd()->lookupNotationTemp(token); if (!notation) return accessNull; ptr.assign(new NotationNode(grove(), notation)); return accessOK; } AccessResult AttributeValueTokenNode::getReferent(NodePtr &ptr) const { if (!attDefList()->def(attIndex_)->isIdref()) return accessNull; StringC token(value_->token(tokenIndex_)); for (;;) { Boolean complete = grove()->complete(); const ElementChunk *element = grove()->lookupElement(token); if (element) { ptr.assign(new ElementNode(grove(), element)); break; } if (complete) return accessNull; if (!grove()->waitForMoreNodes()) return accessTimeout; } return accessOK; } void AttributeValueTokenNode::accept(NodeVisitor &visitor) { visitor.attributeValueToken(*this); } unsigned long AttributeValueTokenNode::hash() const { return secondHash(secondHash((unsigned long)attributeOriginId() + attIndex_) + tokenIndex_); } bool AttributeValueTokenNode::same(const BaseNode &node) const { return node.same2(this); } bool AttributeValueTokenNode::same2(const AttributeValueTokenNode *node) const { return (attributeOriginId() == node->attributeOriginId() && attIndex_ == node->attIndex_ && tokenIndex_ == node->tokenIndex_); } AccessResult AttributeValueTokenNode::getLocation(Location &loc) const { const ConstPtr *originP; Index index; if (!value_->tokenLocation(tokenIndex_, originP, index) && originP->pointer()) { loc = Location(new GroveImplProxyOrigin(grove(), originP->pointer()), index); return accessOK; } return accessNull; } ElementAttributeValueTokenNode ::ElementAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ElementChunk *chunk) : AttributeValueTokenNode(grove, value, attIndex, tokenIndex), ElementAttributeOrigin(chunk), AttributeDefOrigin(attIndex) { } EntityAttributeValueTokenNode ::EntityAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ExternalDataEntity *entity) : AttributeValueTokenNode(grove, value, attIndex, tokenIndex), EntityAttributeOrigin(entity), AttributeDefOrigin(attIndex) { } ElementTypeAttributeValueTokenNode ::ElementTypeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const ElementType *elementType) : AttributeValueTokenNode(grove, value, attIndex, tokenIndex), ElementTypeAttributeDefOrigin(elementType), AttributeDefOrigin(attIndex) { } NotationAttributeValueTokenNode ::NotationAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex, const Notation *notation) : AttributeValueTokenNode(grove, value, attIndex, tokenIndex), NotationAttributeDefOrigin(notation), AttributeDefOrigin(attIndex) { } EntityNode::EntityNode(const GroveImpl *grove, const Entity *entity) : EntityNodeBase(grove, entity) { } DefaultEntityNode::DefaultEntityNode(const GroveImpl *grove, const Entity *entity) : EntityNodeBase(grove, entity) { } AccessResult EntityNode::getOrigin(NodePtr &ptr) const { if (entity_->defaulted() && grove()->lookupDefaultedEntity(entity_->name())) ptr.assign(new SgmlDocumentNode(grove(), grove()->root())); else ptr.assign(new DocumentTypeNode(grove(), grove()->lookupDtd(*(entity_->declInDtdNamePointer())))); return accessOK; } AccessResult DefaultEntityNode::getOrigin(NodePtr &ptr) const { ptr.assign(new DocumentTypeNode(grove(), grove()->lookupDtd(*(entity_->declInDtdNamePointer())))); return accessOK; } AccessResult EntityNode::getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { if (entity_->defaulted() && grove()->lookupDefaultedEntity(entity_->name())) name = ComponentName::idDefaultedEntities; else if (entity_->declType() == EntityDecl::parameterEntity) name = ComponentName::idParameterEntities; else name = ComponentName::idGeneralEntities; return accessOK; } AccessResult DefaultEntityNode::getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = ComponentName::idDefaultEntity; return accessOK; } AccessResult EntityNodeBase::getName(GroveString &str) const { setString(str, entity_->name()); return accessOK; } AccessResult EntityNodeBase::getExternalId(NodePtr &ptr) const { const ExternalEntity *x = entity_->asExternalEntity(); if (!x) return accessNull; ptr.assign(new EntityExternalIdNode(grove(), x)); return accessOK; } AccessResult EntityNodeBase::getNotation(NodePtr &ptr) const { const ExternalDataEntity *x = entity_->asExternalDataEntity(); if (!x || !x->notation()) return accessNull; ptr.assign(new NotationNode(grove(), x->notation())); return accessOK; } AccessResult EntityNodeBase::getNotationName(GroveString &str) const { const ExternalDataEntity *x = entity_->asExternalDataEntity(); if (!x || !x->notation()) return accessNull; setString(str, x->notation()->name()); return accessOK; } AccessResult EntityNodeBase::getText(GroveString &str) const { const InternalEntity *i = entity_->asInternalEntity(); if (!i) return accessNull; setString(str, i->string()); return accessOK; } AccessResult EntityNodeBase::getEntityType(Node::EntityType::Enum &entityType) const { switch (entity_->dataType()) { case EntityDecl::sgmlText: entityType = EntityType::text; break; case EntityDecl::pi: entityType = EntityType::pi; break; case EntityDecl::cdata: entityType = EntityType::cdata; break; case EntityDecl::sdata: entityType = EntityType::sdata; break; case EntityDecl::ndata: entityType = EntityType::ndata; break; case EntityDecl::subdoc: entityType = EntityType::subdocument; break; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult EntityNode::getDefaulted(bool &dflted) const { dflted = entity_->defaulted(); return accessOK; } AccessResult EntityNodeBase::getAttributes(NamedNodeListPtr &ptr) const { const ExternalDataEntity *x = entity_->asExternalDataEntity(); if (!x) return accessNull; ptr.assign(new EntityAttributesNamedNodeList(grove(), x)); return accessOK; } AccessResult EntityNodeBase::attributeRef(unsigned long i, NodePtr &ptr) const { const ExternalDataEntity *x = entity_->asExternalDataEntity(); if (!x || i >= x->attributes().size()) return accessNull; ptr.assign(new EntityAttributeAsgnNode(grove(), size_t(i), x)); return accessOK; } AccessResult EntityNodeBase::getLocation(Location &loc) const { return grove()->proxifyLocation(entity_->defLocation(), loc); } bool EntityNode::same(const BaseNode &node) const { return node.same2(this); } bool DefaultEntityNode::same(const BaseNode &node) const { return node.same2(this); } bool EntityNode::same2(const EntityNode *node) const { return entity_ == node->entity_; } bool DefaultEntityNode::same2(const DefaultEntityNode *node) const { return entity_ == node->entity_; } void EntityNode::accept(NodeVisitor &visitor) { visitor.entity(*this); } void DefaultEntityNode::accept(NodeVisitor &visitor) { visitor.defaultEntity(*this); } unsigned long EntityNodeBase::hash() const { return (unsigned long)entity_; } EntityAttributeOrigin ::EntityAttributeOrigin(const ExternalDataEntity *entity) : entity_(entity) { } const AttributeDefinitionList * EntityAttributeOrigin::attDefList() const { return entity_->notation()->attributeDefTemp(); } const AttributeValue * EntityAttributeOrigin::attributeValue(size_t attIndex, const GroveImpl &) const { return entity_->attributes().value(attIndex); } AccessResult EntityAttributeOrigin::setNodePtrAttributeOrigin(NodePtr &ptr, const BaseNode *node) const { ptr.assign(new EntityNode(node->grove(), entity_)); return accessOK; } Node *EntityAttributeOrigin ::makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const { return new EntityCdataAttributeValueNode(grove, value, attIndex, iter, charIndex, entity_); } Node *EntityAttributeOrigin ::makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const { return new EntityAttributeValueTokenNode(grove, value, attIndex, tokenIndex, entity_); } Node *EntityAttributeOrigin ::makeAttributeAsgnNode(const GroveImpl *grove, size_t attIndex) const { return new EntityAttributeAsgnNode(grove, attIndex, entity_); } AccessResult EntityAttributeOrigin ::makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const { if (entity_->notation() == 0) return accessNull; ptr.assign(new NotationAttributeDefNode(grove, *(entity_->notation()), attributeDefIdx)); return accessOK; } Node *EntityAttributeOrigin::makeOriginNode(const GroveImpl *grove, size_t attIndex) const { return makeAttributeAsgnNode(grove, attIndex); } const void *EntityAttributeOrigin::attributeOriginId() const { return entity_; } DoctypesAndLinktypesNamedNodeList ::DoctypesAndLinktypesNamedNodeList(const GroveImpl *grove) : BaseNamedNodeList(grove, grove->generalSubstTable()) { } NodeListPtr DoctypesAndLinktypesNamedNodeList::nodeList() const { NodePtr tem(new DocumentTypeNode(grove(), grove()->firstDtd())); return new SiblingNodeList(tem); } AccessResult DoctypesAndLinktypesNamedNodeList ::namedNodeU(const StringC &str, NodePtr &ptr) const { const Dtd *dtd = grove()->lookupDtd(str); if (!dtd) return accessNull; ptr.assign(new DocumentTypeNode(grove(), dtd)); return accessOK; } GeneralEntitiesNamedNodeList ::GeneralEntitiesNamedNodeList(const GroveImpl *grove, const Dtd *dtd) : BaseNamedNodeList(grove, grove->entitySubstTable()), dtd_(dtd) { } NodeListPtr GeneralEntitiesNamedNodeList::nodeList() const { return new EntitiesNodeList(grove(), dtd_->generalEntityIter()); } AccessResult GeneralEntitiesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const Entity *entity = dtd_->lookupEntityTemp(0, str); if (!entity) return accessNull; ptr.assign(new EntityNode(grove(), entity)); return accessOK; } ParameterEntitiesNamedNodeList ::ParameterEntitiesNamedNodeList(const GroveImpl *grove, const Dtd *dtd) : BaseNamedNodeList(grove, grove->entitySubstTable()), dtd_(dtd) { } NodeListPtr ParameterEntitiesNamedNodeList::nodeList() const { return new EntitiesNodeList(grove(), dtd_->parameterEntityIter()); } AccessResult ParameterEntitiesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const Entity *entity = dtd_->lookupEntityTemp(1, str); if (!entity) return accessNull; ptr.assign(new EntityNode(grove(), entity)); return accessOK; } AccessResult DefaultedEntitiesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const Entity *entity = grove()->lookupDefaultedEntity(str); if (!entity) return accessNull; ptr.assign(new EntityNode(grove(), entity)); return accessOK; } NodeListPtr DefaultedEntitiesNamedNodeList::nodeList() const { return new EntitiesNodeList(grove(), grove()->defaultedEntityIter()); } NodeListPtr DocEntitiesNamedNodeList::nodeList() const { return new DocEntitiesNodeList(grove()); } AccessResult DocEntitiesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const Entity *entity = grove()->governingDtd()->lookupEntityTemp(0, str); // How I hate the default entity. while (!entity) { if (!grove()->hasDefaultEntity()) return accessNull; // Make sure that the value of complete // we look at is that before we looked up // the entity. Boolean complete = grove()->complete(); entity = grove()->lookupDefaultedEntity(str); if (entity) break; if (complete) return accessNull; if (!grove()->waitForMoreNodes()) return accessTimeout; } ptr.assign(new EntityNode(grove(), entity)); return accessOK; } AccessResult ElementsNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { for (;;) { Boolean complete = grove()->complete(); const ElementChunk *element = grove()->lookupElement(str); if (element) { ptr.assign(new ElementNode(grove(), element)); break; } if (complete) return accessNull; if (!grove()->waitForMoreNodes()) return accessTimeout; } return accessOK; } NodeListPtr ElementsNamedNodeList::nodeList() const { return new ElementsNodeList(grove(), grove()->root()->documentElement); } ElementsNodeList::ElementsNodeList(const GroveImpl *grove, const Chunk *first) : grove_(grove), first_(first) { } AccessResult ElementsNodeList::first(NodePtr &ptr) const { const Chunk *p = first_; while (p) { while (p == grove_->completeLimit()) { if (!grove_->waitForMoreNodes()) return accessTimeout; } if (p->id()) { ((ElementsNodeList *)this)->first_ = p; ptr.assign(new ElementNode(grove_, (const ElementChunk *)p)); return accessOK; } p = p->after(); } return accessNull; } AccessResult ElementsNodeList::chunkRest(NodeListPtr &ptr) const { const Chunk *p = first_; while (p) { while (p == grove_->completeLimit()) { if (!grove_->waitForMoreNodes()) return accessTimeout; } if (p->id()) { if (canReuse(ptr)) ((ElementsNodeList *)this)->first_ = p->after(); else ptr.assign(new ElementsNodeList(grove_, p->after())); return accessOK; } p = p->after(); } return accessNull; } // iter.next() gives first member of list that this represents EntitiesNodeList::EntitiesNodeList(const GroveImpl *grove, const Dtd::ConstEntityIter &iter) : grove_(grove), iter_(iter) { } AccessResult EntitiesNodeList::first(NodePtr &ptr) const { Dtd::ConstEntityIter tem(iter_); const Entity *entity = tem.nextTemp(); if (!entity) return accessNull; ptr.assign(new EntityNode(grove_, entity)); return accessOK; } AccessResult EntitiesNodeList::chunkRest(NodeListPtr &ptr) const { if (canReuse(ptr)) { EntitiesNodeList *list = (EntitiesNodeList *)this; if (list->iter_.nextTemp() == 0) return accessNull; return accessOK; } Dtd::ConstEntityIter tem(iter_); if (tem.nextTemp() == 0) return accessNull; ptr.assign(new EntitiesNodeList(grove_, tem)); return accessOK; } DocEntitiesNodeList::DocEntitiesNodeList(const GroveImpl *grove) : EntitiesNodeList(grove, grove->governingDtd()->generalEntityIter()) { } AccessResult DocEntitiesNodeList::first(NodePtr &ptr) const { AccessResult ret = EntitiesNodeList::first(ptr); if (ret != accessNull || !grove()->hasDefaultEntity()) return ret; while (!grove()->complete()) if (!grove()->waitForMoreNodes()) return accessTimeout; Dtd::ConstEntityIter tem(grove()->defaultedEntityIter()); const Entity *entity = tem.nextTemp(); if (!entity) return accessNull; ptr.assign(new EntityNode(grove(), entity)); return accessOK; } AccessResult DocEntitiesNodeList::chunkRest(NodeListPtr &ptr) const { AccessResult ret = EntitiesNodeList::chunkRest(ptr); if (ret != accessNull || !grove()->hasDefaultEntity()) return ret; while (!grove()->complete()) if (!grove()->waitForMoreNodes()) return accessTimeout; Dtd::ConstEntityIter tem(grove()->defaultedEntityIter()); const Entity *entity = tem.nextTemp(); if (!entity) return accessNull; ptr.assign(new EntitiesNodeList(grove(), tem)); return accessOK; } NotationsNamedNodeList ::NotationsNamedNodeList(const GroveImpl *grove, const Dtd *dtd) : BaseNamedNodeList(grove, grove->generalSubstTable()), dtd_(dtd) { } NodeListPtr NotationsNamedNodeList::nodeList() const { return new NotationsNodeList(grove(), dtd_->notationIter()); } AccessResult NotationsNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const Notation *notation = dtd_->lookupNotationTemp(str); if (!notation) return accessNull; ptr.assign(new NotationNode(grove(), notation)); return accessOK; } // iter.next() gives first member of list that this represents NotationsNodeList::NotationsNodeList(const GroveImpl *grove, const Dtd::ConstNotationIter &iter) : grove_(grove), iter_(iter) { } AccessResult NotationsNodeList::first(NodePtr &ptr) const { Dtd::ConstNotationIter tem(iter_); const Notation *notation = tem.nextTemp(); if (!notation) return accessNull; ptr.assign(new NotationNode(grove_, notation)); return accessOK; } AccessResult NotationsNodeList::chunkRest(NodeListPtr &ptr) const { if (canReuse(ptr)) { NotationsNodeList *list = (NotationsNodeList *)this; if (list->iter_.next().isNull()) return accessNull; return accessOK; } Dtd::ConstNotationIter tem(iter_); if (tem.nextTemp() == 0) return accessNull; ptr.assign(new NotationsNodeList(grove_, tem)); return accessOK; } NotationNode::NotationNode(const GroveImpl *grove, const Notation *notation) : BaseNode(grove), notation_(notation) { } AccessResult NotationNode::getOrigin(NodePtr &ptr) const { ptr.assign(new DocumentTypeNode(grove(), grove()->lookupDtd(*(notation_->declInDtdNamePointer())))); return accessOK; } AccessResult NotationNode::getName(GroveString &str) const { setString(str, notation_->name()); return accessOK; } AccessResult NotationNode::getExternalId(NodePtr &ptr) const { ptr.assign(new NotationExternalIdNode(grove(), notation_)); return accessOK; } AccessResult NotationNode::getAttributeDefs(NamedNodeListPtr &ptr) const { ptr.assign(new NotationAttributeDefsNamedNodeList(grove(), *notation_)); return accessOK; } AccessResult NotationNode::getLocation(Location &loc) const { return grove()->proxifyLocation(notation_->defLocation(), loc); } bool NotationNode::same(const BaseNode &node) const { return node.same2(this); } bool NotationNode::same2(const NotationNode *node) const { return notation_ == node->notation_; } void NotationNode::accept(NodeVisitor &visitor) { visitor.notation(*this); } unsigned long NotationNode::hash() const { return (unsigned long)notation_; } FormalPublicIdNode::FormalPublicIdNode(const GroveImpl *grove, const PublicId *pubid) : BaseNode(grove), pubid_(pubid) { } AccessResult FormalPublicIdNode::getOwnerType(OwnerType::Enum &type) const { PublicId::OwnerType otp; if (!pubid_->getOwnerType(otp)) return accessNull; switch (otp) { case PublicId::ISO: type = OwnerType::iso; break; case PublicId::registered: type = OwnerType::registered; break; case PublicId::unregistered: type = OwnerType::unregistered; break; } return accessOK; } AccessResult FormalPublicIdNode::getOwnerId(GroveString &str) const { if (!pubid_->getOwner( #ifndef HAVE_MUTABLE ((FormalPublicIdNode *)this)-> #endif owner_)) return accessNull; setString(str, owner_); return accessOK; } AccessResult FormalPublicIdNode::getTextClass(TextClass::Enum &tc) const { PublicId::TextClass text; if (!pubid_->getTextClass(text)) return accessNull; switch (text) { case PublicId::CAPACITY: tc = TextClass::capacity; break; case PublicId::CHARSET: tc = TextClass::charset; break; case PublicId::DOCUMENT: tc = TextClass::document; break; case PublicId::DTD: tc = TextClass::dtd; break; case PublicId::ELEMENTS: tc = TextClass::elements; break; case PublicId::ENTITIES: tc = TextClass::entities; break; case PublicId::LPD: tc = TextClass::lpd; break; case PublicId::NONSGML: tc = TextClass::nonsgml; break; case PublicId::NOTATION: tc = TextClass::notation; break; case PublicId::SHORTREF: tc = TextClass::shortref; break; case PublicId::SUBDOC: tc = TextClass::subdoc; break; case PublicId::SYNTAX: tc = TextClass::syntax; break; case PublicId::TEXT: tc = TextClass::text; break; default: return accessNull; } return accessOK; } AccessResult FormalPublicIdNode::getUnavailable(bool &u) const { if (!pubid_->getUnavailable(u)) return accessNull; return accessOK; } AccessResult FormalPublicIdNode::getTextDescription(GroveString &str) const { if (!pubid_->getDescription( #ifndef HAVE_MUTABLE ((FormalPublicIdNode *)this)-> #endif desc_)) return accessNull; setString(str, desc_); return accessOK; } AccessResult FormalPublicIdNode::getTextLanguage(GroveString &str) const { if (!pubid_->getLanguage( #ifndef HAVE_MUTABLE ((FormalPublicIdNode *)this)-> #endif lang_)) return accessNull; setString(str, lang_); return accessOK; } AccessResult FormalPublicIdNode::getTextDesignatingSequence(GroveString &str) const { if (!pubid_->getDesignatingSequence( #ifndef HAVE_MUTABLE ((FormalPublicIdNode *)this)-> #endif dseq_)) return accessNull; setString(str, dseq_); return accessOK; } AccessResult FormalPublicIdNode::getTextDisplayVersion(GroveString &str) const { if (!pubid_->getDisplayVersion( #ifndef HAVE_MUTABLE ((FormalPublicIdNode *)this)-> #endif dver_)) return accessNull; setString(str, dver_); return accessOK; } void FormalPublicIdNode::accept(NodeVisitor &visitor) { visitor.formalPublicId(*this); } bool FormalPublicIdNode::same(const BaseNode &node) const { return node.same2(this); } bool FormalPublicIdNode::same2(const FormalPublicIdNode *node) const { return pubid_ == node->pubid_; } ExternalIdNode::ExternalIdNode(const GroveImpl *grove) : BaseNode(grove) { } AccessResult ExternalIdNode::getPublicId(GroveString &str) const { const StringC *s = externalId().publicIdString(); if (!s) return accessNull; setString(str, *s); return accessOK; } AccessResult ExternalIdNode::getFormalPublicId(NodePtr &ptr) const { const PublicId *pubid = externalId().publicId(); if (!pubid || pubid->type() != PublicId::fpi) return accessNull; ptr.assign(new FormalPublicIdNode(grove(), pubid)); return accessOK; } AccessResult ExternalIdNode::getSystemId(GroveString &str) const { const StringC *s = externalId().systemIdString(); if (!s) return accessNull; setString(str, *s); return accessOK; } AccessResult ExternalIdNode::getGeneratedSystemId(GroveString &str) const { const StringC &s = externalId().effectiveSystemId(); if (!s.size()) return accessNull; setString(str, s); return accessOK; } void ExternalIdNode::accept(NodeVisitor &visitor) { visitor.externalId(*this); } bool ExternalIdNode::same(const BaseNode &node) const { return node.same2(this); } bool ExternalIdNode::same2(const ExternalIdNode *node) const { return &externalId() == &node->externalId(); } EntityExternalIdNode::EntityExternalIdNode(const GroveImpl *grove, const ExternalEntity *entity) : ExternalIdNode(grove), entity_(entity) { } const ExternalId &EntityExternalIdNode::externalId() const { return entity_->externalId(); } AccessResult EntityExternalIdNode::getOrigin(NodePtr &ptr) const { ptr.assign(new EntityNode(grove(), entity_)); return accessOK; } unsigned long EntityExternalIdNode::hash() const { return secondHash((unsigned long)entity_); } NotationExternalIdNode::NotationExternalIdNode(const GroveImpl *grove, const Notation *notation) : ExternalIdNode(grove), notation_(notation) { } const ExternalId &NotationExternalIdNode::externalId() const { return notation_->externalId(); } AccessResult NotationExternalIdNode::getOrigin(NodePtr &ptr) const { ptr.assign(new NotationNode(grove(), notation_)); return accessOK; } unsigned long NotationExternalIdNode::hash() const { return secondHash((unsigned long)notation_); } AccessResult ChunkNode::getParent(NodePtr &ptr) const { if (!chunk_->origin) return accessNull; // This is needed because PiNodes in the prolog and // epilog don't have a parent but do have an origin. // Also for the document element. if ((const Chunk *)chunk()->origin == grove()->root()) return accessNull; chunk_->origin->setNodePtrFirst(ptr, this); return accessOK; } AccessResult ChunkNode::getTreeRoot(NodePtr &ptr) const { if (chunk()->origin && (const Chunk *)chunk()->origin != grove()->root() // With invalid documents we might have elements in the epilog && !grove()->root()->epilog && grove()->root()->documentElement) return grove()->root()->documentElement->setNodePtrFirst(ptr, this); return Node::getTreeRoot(ptr); } AccessResult ChunkNode::getOrigin(NodePtr &ptr) const { if (!chunk_->origin) return accessNull; chunk_->origin->setNodePtrFirst(ptr, this); return accessOK; } AccessResult ChunkNode::getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { if ((const Chunk *)chunk()->origin != grove()->root()) name = ComponentName::idContent; else if ((const Chunk *)chunk() == grove()->root()->documentElement) name = ComponentName::idDocumentElement; else { const Chunk *tem; if (chunk()->getFirstSibling(grove(), tem) == accessOK && tem == grove()->root()->prolog) name = ComponentName::idProlog; else name = ComponentName::idEpilog; } return accessOK; } unsigned long ChunkNode::hash() const { return (unsigned long)chunk_; } bool ChunkNode::same(const BaseNode &node) const { return node.same2(this); } bool ChunkNode::same2(const ChunkNode *node) const { return chunk_ == node->chunk_; } BaseNode::~BaseNode() { } void BaseNode::addRef() { ++refCount_; } void BaseNode::release() { ASSERT(refCount_ != 0); if (--refCount_ == 0) delete this; } unsigned BaseNode::groveIndex() const { return grove_->groveIndex(); } bool BaseNode::operator==(const Node &node) const { if (!sameGrove(node)) return 0; return same((const BaseNode &)node); } bool BaseNode::chunkContains(const Node &node) const { if (!sameGrove(node)) return 0; return same((const BaseNode &)node); } bool BaseNode::inChunk(const DataNode *) const { return 0; } bool BaseNode::inChunk(const CdataAttributeValueNode *) const { return 0; } bool BaseNode::same2(const ChunkNode *) const { return 0; } bool BaseNode::same2(const DataNode *) const { return 0; } bool BaseNode::same2(const AttributeAsgnNode *) const { return 0; } bool BaseNode::same2(const AttributeValueTokenNode *) const { return 0; } bool BaseNode::same2(const CdataAttributeValueNode *) const { return 0; } bool BaseNode::same2(const EntityNode *) const { return 0; } bool BaseNode::same2(const NotationNode *) const { return 0; } bool BaseNode::same2(const ExternalIdNode *) const { return 0; } bool BaseNode::same2(const FormalPublicIdNode *) const { return 0; } bool BaseNode::same2(const DocumentTypeNode *) const { return 0; } bool BaseNode::same2(const SgmlConstantsNode *) const { return 0; } bool BaseNode::same2(const MessageNode *) const { return 0; } bool BaseNode::same2(const ElementTypeNode *) const { return 0; } bool BaseNode::same2(const RankStemNode *) const { return 0; } bool BaseNode::same2(const ModelGroupNode *) const { return 0; } bool BaseNode::same2(const ElementTokenNode *) const { return 0; } bool BaseNode::same2(const PcdataTokenNode *) const { return 0; } bool BaseNode::same2(const AttributeDefNode *) const { return 0; } bool BaseNode::same2(const DefaultEntityNode *) const { return 0; } AccessResult BaseNode::nextSibling(NodePtr &ptr) const { return nextChunkSibling(ptr); } class NodalPropertyValue : public PropertyValue { public: NodePtr nd; NodeListPtr nl; NamedNodeListPtr nnl; void set(const NodePtr &x) { nd = x; } void set(const NodeListPtr &x) { nl = x; } void set(const NamedNodeListPtr &x) { nnl = x; } void set(bool) { CANNOT_HAPPEN(); } void set(GroveChar) { CANNOT_HAPPEN(); } void set(GroveString) { CANNOT_HAPPEN(); } void set(ComponentName::Id) { CANNOT_HAPPEN(); } void set(const GroveStringListPtr &) { CANNOT_HAPPEN(); } void set(const ComponentName::Id *) { CANNOT_HAPPEN(); } void set(long) { CANNOT_HAPPEN(); } }; AccessResult BaseNode::nextChunkSibling(NodePtr &ptr) const { NodePtr origin; ComponentName::Id id; NodalPropertyValue pv; SdataMapper sm; NodeListPtr nl; if (getOrigin(origin) != accessOK || getOriginToSubnodeRelPropertyName(id) != accessOK || origin->property(id, sm, pv) != accessOK) return accessNull; if (pv.nd) return accessNull; nl = pv.nl ? pv.nl : pv.nnl->nodeList(); for (;;) { NodePtr nd; if (nl->first(nd) != accessOK || nl->rest(nl) != accessOK) return accessNull; if (*nd == *ptr) break; } if (nl->first(ptr) != accessOK) return accessNull; return accessOK; } AccessResult BaseNode::follow(NodeListPtr &ptr) const { NodePtr nd; AccessResult ret = nextSibling(nd); switch (ret) { case accessOK: ptr.assign(new SiblingNodeList(nd)); break; case accessNull: ptr.assign(new BaseNodeList); ret = accessOK; break; default: break; } return ret; } AccessResult BaseNode::children(NodeListPtr &ptr) const { NodePtr head; AccessResult ret = firstChild(head); switch (ret) { case accessOK: ptr.assign(new SiblingNodeList(head)); break; case accessNull: ptr.assign(new BaseNodeList); ret = accessOK; break; default: break; } return ret; } AccessResult BaseNode::getOrigin(NodePtr &ptr) const { return getParent(ptr); } AccessResult BaseNode::getGroveRoot(NodePtr &ptr) const { ptr.assign(new SgmlDocumentNode(grove(), grove()->root())); return accessOK; } AccessResult BaseNode::getLocation(Location &) const { return accessNull; } bool BaseNode::queryInterface(IID iid, const void *&p) const { if (iid == LocNode::iid) { const LocNode *ip = this; p = ip; return 1; } return 0; } AccessResult ForwardingChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { if (forwardTo == 0) return accessNull; ASSERT(origin == forwardTo->origin); return forwardTo->setNodePtrFirst(ptr, node); } AccessResult ForwardingChunk::getFollowing(const GroveImpl *grove, const Chunk *&p, unsigned long &nNodes) const { AccessResult ret = Chunk::getFollowing(grove, p, nNodes); if (ret == accessOK) nNodes = 0; return ret; } AccessResult LocOriginChunk::getFollowing(const GroveImpl *grove, const Chunk *&p, unsigned long &nNodes) const { AccessResult ret = Chunk::getFollowing(grove, p, nNodes); if (ret == accessOK) nNodes = 0; return ret; } AccessResult LocOriginChunk::setNodePtrFirst(NodePtr &ptr, const BaseNode *node) const { return ((const Chunk *)(this + 1))->setNodePtrFirst(ptr, node); } AccessResult LocOriginChunk::setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const { return ((const Chunk *)(this + 1))->setNodePtrFirst(ptr, node); } AccessResult LocOriginChunk::setNodePtrFirst(NodePtr &ptr, const DataNode *node) const { return ((const Chunk *)(this + 1))->setNodePtrFirst(ptr, node); } const Chunk *LocOriginChunk::after() const { return this + 1; } Boolean LocOriginChunk::getLocOrigin(const Origin *&ret) const { ret = locOrigin; return 1; } AccessResult Chunk::setNodePtrFirst(NodePtr &ptr, const ElementNode *node) const { return setNodePtrFirst(ptr, (const BaseNode *)node); } AccessResult Chunk::setNodePtrFirst(NodePtr &ptr, const DataNode *node) const { return setNodePtrFirst(ptr, (const BaseNode *)node); } const StringC *Chunk::id() const { return 0; } AccessResult Chunk::getFollowing(const GroveImpl *grove, const Chunk *&f, unsigned long &n) const { const Chunk *p = after(); while (p == grove->completeLimit()) if (!grove->waitForMoreNodes()) return accessTimeout; if (p->origin != origin) return accessNull; n = 1; f = p; return accessOK; } AccessResult Chunk::getFirstSibling(const GroveImpl *grove, const Chunk *&p) const { if ((const Chunk *)origin == grove->root()) return accessNotInClass; p = origin->after(); return accessOK; } Boolean Chunk::getLocOrigin(const Origin *&) const { return 0; } // ------------------------------ dev -------------------------------- // -- CLASS IMP: RankStemNode AccessResult RankStemNode::getOrigin(NodePtr &ptr) const { ptr.assign(new DocumentTypeNode(grove(), grove()->lookupDtd(rankStem_))); return accessOK; } AccessResult RankStemNode::getStem(GroveString &str) const { setString(str, rankStem_.name()); return accessOK; } AccessResult RankStemNode::getElementTypes(NodeListPtr &ptr) const { ptr.assign(new RankStemElementTypesNodeList(grove(), rankStem_, iter_)); return accessOK; } bool RankStemNode::same(const BaseNode &node) const { return node.same2(this); } bool RankStemNode::same2(const RankStemNode *node) const { return &rankStem_ == &(node->rankStem()); } void RankStemNode::accept(NodeVisitor &visitor) { visitor.rankStem(*this); } unsigned long RankStemNode::hash() const { return (unsigned long)&rankStem_; } // -- CLASS IMP: ElementTypeNode AccessResult ElementTypeNode::getOrigin(NodePtr &ptr) const { ptr.assign(new DocumentTypeNode(grove(), grove()->lookupDtd(elementType_))); return accessOK; } AccessResult ElementTypeNode::getLocation(Location &loc) const { const ElementDefinition *def = elementType_.definition(); if (def == 0) return accessNull; return grove()->proxifyLocation(def->location(), loc); } AccessResult ElementTypeNode::getGi(GroveString &str) const { setString(str, elementType_.name()); return accessOK; } AccessResult ElementTypeNode::getModelGroup(NodePtr &ptr) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || def->declaredContent() != ElementDefinition::modelGroup) return accessNull; ptr.assign(new ModelGroupNode(grove(), elementType_, *(def->compiledModelGroup()->modelGroup()))); return accessOK; } AccessResult ElementTypeNode::getContentType(Node::ContentType::Enum &enumId) const { const ElementDefinition *def = elementType_.definition(); if (def == 0) return accessNull; switch (def->declaredContent() ) { case ElementDefinition::modelGroup: enumId = ContentType::modelgrp; break; case ElementDefinition::any: enumId = ContentType::any; break; case ElementDefinition::cdata: enumId = ContentType::cdata; break; case ElementDefinition::rcdata: enumId = ContentType::rcdata; break; case ElementDefinition::empty: enumId = ContentType::empty; break; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult ElementTypeNode::getExclusions(GroveStringListPtr &sl) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || (def->declaredContent() != ElementDefinition::modelGroup && def->declaredContent() != ElementDefinition::any)) return accessNull; sl.assign(new GroveStringList); GroveString str; for (size_t i = 0; i < def->nExclusions(); i++ ) { setString(str, def->exclusion(i)->name()); sl->append(str); } return accessOK; } AccessResult ElementTypeNode::getInclusions(GroveStringListPtr &sl) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || (def->declaredContent() != ElementDefinition::modelGroup && def->declaredContent() != ElementDefinition::any)) return accessNull; sl.assign(new GroveStringList); GroveString str; for (size_t i = 0; i < def->nInclusions(); i++ ) { setString(str, def->inclusion(i)->name()); sl->append(str); } return accessOK; } AccessResult ElementTypeNode::getOmitEndTag(bool &f) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || !def->omittedTagSpec()) return accessNull; f = def->canOmitEndTag(); return accessOK; } AccessResult ElementTypeNode::getOmitStartTag(bool &f) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || !def->omittedTagSpec()) return accessNull; f = def->canOmitStartTag(); return accessOK; } AccessResult ElementTypeNode::getRankGroup(GroveStringListPtr &stems) const { // FIXME: What about rank groups with exactly one member ? const ElementDefinition *def = elementType_.definition(); if (def == 0 || !def->nRankStems() <= 1) return accessNull; stems.assign(new GroveStringList); GroveString str; for (size_t i = 0; i < def->nRankStems(); i++) { setString(str, def->rankStem(i)->name()); stems->append(str); } return accessOK; } AccessResult ElementTypeNode::getRankStem(GroveString &str) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || !def->nRankStems() != 1) return accessNull; setString(str, def->rankStem(0)->name()); return accessOK; } AccessResult ElementTypeNode::getRankSuffix(GroveString &str) const { const ElementDefinition *def = elementType_.definition(); if (def == 0 || def->rankSuffix().size() == 0) return accessNull; setString(str, def->rankSuffix()); return accessOK; } AccessResult ElementTypeNode::getAttributeDefs(NamedNodeListPtr &ptr) const { ptr.assign(new ElementTypeAttributeDefsNamedNodeList(grove(), elementType_)); return accessOK; } bool ElementTypeNode::same(const BaseNode &node) const { return node.same2(this); } bool ElementTypeNode::same2(const ElementTypeNode *node) const { return &elementType_ == &(node->elementType()); } void ElementTypeNode::accept(NodeVisitor &visitor) { visitor.elementType(*this); } unsigned long ElementTypeNode::hash() const { return (unsigned long)&elementType_; } // -- CLASS IMP: RankStemElementTypesNodeList RankStemElementTypesNodeList::RankStemElementTypesNodeList(const GroveImpl *grove, const RankStem &rankStem, const Dtd::ConstElementTypeIter &iter) : grove_(grove), rankStem_(rankStem), iter_(iter) { } AccessResult RankStemElementTypesNodeList::first(NodePtr &ptr) const { RankStemElementTypesNodeList *list = (RankStemElementTypesNodeList *)this; for (;;) { Dtd::ConstElementTypeIter tem(iter_); const ElementType *elementType = tem.next(); if (elementType == 0) return accessNull; if (elementType->isRankedElement() && elementType->rankedElementRankStem() == &rankStem_) { ptr.assign(new ElementTypeNode(grove_, *elementType)); return accessOK; } list->iter_.next(); } } AccessResult RankStemElementTypesNodeList::chunkRest(NodeListPtr &ptr) const { NodePtr tem; if (first(tem) == accessNull) return accessNull; if (canReuse(ptr)) { ((RankStemElementTypesNodeList *)this)->iter_.next(); return first(tem); } Dtd::ConstElementTypeIter iter(iter_); iter.next(); ptr.assign(new RankStemElementTypesNodeList(grove_, rankStem_, iter)); return ptr->first(tem); } // -- CLASS IMP: ElementTypesNodeList ElementTypesNodeList::ElementTypesNodeList(const GroveImpl *grove, const Dtd *dtd, const Dtd::ConstElementTypeIter &elementTypeIter, const Dtd::ConstRankStemIter &rankStemIter) : grove_(grove), dtd_(dtd), elementTypeIter_(elementTypeIter), rankStemIter_(rankStemIter) { } AccessResult ElementTypesNodeList::first(NodePtr &ptr) const { Dtd::ConstElementTypeIter elementTypeIter(elementTypeIter_); const ElementType *elementType = elementTypeIter.next(); if (elementType) { ptr.assign(new ElementTypeNode(grove_, *elementType)); return accessOK; } Dtd::ConstRankStemIter rankStemIter(rankStemIter_); const RankStem *rankStem = rankStemIter.next(); if (rankStem) { ptr.assign(new RankStemNode(grove_, *rankStem, dtd_->elementTypeIter())); return accessOK; } return accessNull; } AccessResult ElementTypesNodeList::chunkRest(NodeListPtr &ptr) const { if (canReuse(ptr)) { ElementTypesNodeList *list = (ElementTypesNodeList *)this; if (list->elementTypeIter_.next() == 0) if (list->rankStemIter_.next() == 0) return accessNull; return accessOK; } Dtd::ConstElementTypeIter elementTypeIter(elementTypeIter_); Dtd::ConstRankStemIter rankStemIter(rankStemIter_); if (elementTypeIter.next() == 0) if (rankStemIter.next() == 0) return accessNull; ptr.assign(new ElementTypesNodeList(grove_, dtd_, elementTypeIter, rankStemIter)); return accessOK; } // -- CLASS IMP: ElementTypesNamedNodeList ElementTypesNamedNodeList::ElementTypesNamedNodeList(const GroveImpl *grove, const Dtd *dtd) : BaseNamedNodeList( grove, grove->generalSubstTable() ), dtd_(dtd) { } NodeListPtr ElementTypesNamedNodeList::nodeList() const { return new ElementTypesNodeList(grove(), dtd_, dtd_->elementTypeIter(), dtd_->rankStemIter()); } AccessResult ElementTypesNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { const ElementType *elementType = dtd_->lookupElementType(str); // ? Temp if (elementType) { ptr.assign(new ElementTypeNode(grove(), *elementType)); return accessOK; } const RankStem *rankStem = dtd_->lookupRankStem(str); if (rankStem) { ptr.assign(new RankStemNode(grove(), *rankStem, dtd_->elementTypeIter())); return accessOK; } return accessNull; } // -- CLASS IMP: ContentTokenNodeBase ContentTokenNodeBase::ContentTokenNodeBase(const GroveImpl *grove, const ElementType &elementType, ModelGroupNode *parentModelGroupNode) : BaseNode(grove), elementType_(elementType), parentModelGroupNode_(parentModelGroupNode) { if (parentModelGroupNode_ != 0) parentModelGroupNode_->addRef(); } ContentTokenNodeBase::~ContentTokenNodeBase() { if (parentModelGroupNode_ != 0) parentModelGroupNode_->release(); } AccessResult ContentTokenNodeBase::getOrigin(NodePtr &ptr) const { if (parentModelGroupNode_ != 0) ptr.assign(parentModelGroupNode_); else ptr.assign(new ElementTypeNode(grove(), elementType_)); return accessOK; } AccessResult ContentTokenNodeBase::getLocation(Location &loc) const { const ElementDefinition *def = elementType_.definition(); if (def == 0) return accessNull; return grove()->proxifyLocation(def->location(), loc); } // -- CLASS IMP: ElementTokenNode AccessResult ElementTokenNode::getGi(GroveString &str) const { ASSERT(elementToken_.elementType() != 0); setString(str, elementToken_.elementType()->name()); return accessOK; } AccessResult ElementTokenNode::getOccurIndicator(Node::OccurIndicator::Enum &occur) const { switch (elementToken_.occurrenceIndicator()) { case ContentToken::opt: occur = OccurIndicator::opt; break; case ContentToken::plus: occur = OccurIndicator::plus; break; case ContentToken::rep: occur = OccurIndicator::rep; break; case ContentToken::none: return accessNull; default: CANNOT_HAPPEN(); } return accessOK; } bool ElementTokenNode::same(const BaseNode &node) const { return node.same2(this); } bool ElementTokenNode::same2(const ElementTokenNode *node) const { return &elementToken_ == &(node->elementToken()); } void ElementTokenNode::accept(NodeVisitor &visitor) { visitor.elementToken(*this); } unsigned long ElementTokenNode::hash() const { return (unsigned long)&elementToken_; } // -- CLASS IMP: PcdataTokenNode bool PcdataTokenNode::same(const BaseNode &node) const { return node.same2(this); } bool PcdataTokenNode::same2(const PcdataTokenNode *node) const { return &pcdataToken_ == &(node->pcdataToken()); } void PcdataTokenNode::accept(NodeVisitor &visitor) { visitor.pcdataToken(*this); } unsigned long PcdataTokenNode::hash() const { return (unsigned long)&pcdataToken_; } // -- CLASS IMP: ModelGroupNode AccessResult ModelGroupNode::getOriginToSubnodeRelPropertyName(ComponentName::Id &name) const { name = parentModelGroupNode_ == 0 ? ComponentName::idModelGroup : ComponentName::idContentTokens; return accessOK; } AccessResult ModelGroupNode::getConnector(Node::Connector::Enum &conn) const { switch (modelGroup_.connector()) { case ModelGroup::andConnector: conn = Connector::and_; break; case ModelGroup::orConnector: conn = Connector::or_; break; case ModelGroup::seqConnector: conn = Connector::seq; break; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult ModelGroupNode::getOccurIndicator(Node::OccurIndicator::Enum &occur) const { switch (modelGroup_.occurrenceIndicator()) { case ContentToken::opt: occur = OccurIndicator::opt; break; case ContentToken::plus: occur = OccurIndicator::plus; break; case ContentToken::rep: occur = OccurIndicator::rep; break; case ContentToken::none: return accessNull; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult ModelGroupNode::getContentTokens(NodeListPtr &ptr) const { ptr.assign(new ContentTokenNodeList(grove(), *(ModelGroupNode *)this)); return accessOK; } void ModelGroupNode::makeNode(NodePtr &ptr, unsigned contentTokenIdx) { ASSERT( contentTokenIdx < modelGroup_.nMembers()); const ContentToken &contentToken = modelGroup_.member(contentTokenIdx); const ModelGroup *asModelGroup = contentToken.asModelGroup(); if (asModelGroup != 0) ptr.assign(new ModelGroupNode(grove(), elementType_, *asModelGroup, this)); else { const LeafContentToken *asLeafContentToken = contentToken.asLeafContentToken(); if (asLeafContentToken != 0) if (asLeafContentToken->elementType() != 0) ptr.assign(new ElementTokenNode(grove(), elementType_, *(const ElementToken*)asLeafContentToken, this)); else if (asLeafContentToken->occurrenceIndicator() == ContentToken::rep) ptr.assign(new PcdataTokenNode(grove(), elementType_, *(const PcdataToken*)asLeafContentToken, this)); else CANNOT_HAPPEN(); } } bool ModelGroupNode::same(const BaseNode &node) const { return node.same2(this); } bool ModelGroupNode::same2(const ModelGroupNode *node) const { return &modelGroup_ == &(node->modelGroup()); } void ModelGroupNode::accept(NodeVisitor &visitor) { visitor.modelGroup(*this); } unsigned long ModelGroupNode::hash() const { return (unsigned long)&modelGroup_; } // -- CLASS IMP: ContentTokenNodeList ContentTokenNodeList::ContentTokenNodeList(const GroveImpl *grove, ModelGroupNode &modelGroupNode, unsigned firstTokenIdx) : grove_(grove), modelGroupNode_(modelGroupNode), firstTokenIdx_(firstTokenIdx) { } AccessResult ContentTokenNodeList::next() { if (++firstTokenIdx_ >= modelGroupNode_.modelGroup().nMembers()) return accessNull; return accessOK; } AccessResult ContentTokenNodeList::first(NodePtr &ptr) const { if (firstTokenIdx_ < modelGroupNode_.modelGroup().nMembers()) modelGroupNode_.makeNode(ptr, firstTokenIdx_); else return accessNull; return accessOK; } AccessResult ContentTokenNodeList::chunkRest(NodeListPtr &ptr) const { if (canReuse(ptr)) { ContentTokenNodeList *list = (ContentTokenNodeList *)this; return list->next(); } unsigned firstTokenIdx = firstTokenIdx_; if (++firstTokenIdx >= modelGroupNode_.modelGroup().nMembers()) return accessNull; ptr.assign(new ContentTokenNodeList(grove_, modelGroupNode_, firstTokenIdx)); return accessOK; } // class IMP: AttributeDefOrigin AccessResult AttributeDefOrigin::makeAttributeValueNode(const GroveImpl *grove, NodePtr &ptr, const AttributeValue *value) const { if (value) { const Text *text; const StringC *str; switch (value->info(text, str)) { case AttributeValue::tokenized: ptr.assign(makeAttributeValueTokenNode(grove, (const TokenizedAttributeValue *)value, attIndex_, 0)); return accessOK; case AttributeValue::cdata: { TextIter iter(*text); if (!CdataAttributeValueNode::skipBoring(iter)) { ptr.assign(0); return accessNull; } else { ptr.assign(makeCdataAttributeValueNode(grove, value, attIndex_, iter)); return accessOK; } } default: break; } } return accessNull; } AccessResult AttributeDefOrigin::makeAttributeValueNodeList(const GroveImpl *grove, NodeListPtr &ptr, const AttributeValue *value = 0) const { NodePtr nodePtr; AccessResult result; result = makeAttributeValueNode(grove, nodePtr, value); if (result == accessOK) ptr.assign(nodePtr.operator->() == 0 ? new BaseNodeList : new SiblingNodeList(nodePtr)); return result; } AccessResult AttributeDefOrigin::makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, const StringC &name) const { if (attDefList() == 0) return accessNull; for (size_t i = 0; i < attDefList()->size(); i++) if (attDefList()->def(i)->name() == name) { return makeAttributeDefNode(grove, ptr, i); break; } return accessNull; } // class IMP: ElementTypeAttributeDefOrigin ElementTypeAttributeDefOrigin::ElementTypeAttributeDefOrigin(const ElementType *elementType) : elementType_(elementType) { } const AttributeDefinitionList *ElementTypeAttributeDefOrigin::attDefList() const { return elementType_->attributeDefTemp(); } AccessResult ElementTypeAttributeDefOrigin::makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const { ptr.assign(new ElementTypeAttributeDefNode(grove, *elementType_, attributeDefIdx)); return accessOK; } AccessResult ElementTypeAttributeDefOrigin::makeAttributeDefList(const GroveImpl *grove, NodeListPtr &ptr, size_t firstAttDefIdx) const { ptr.assign(new ElementTypeAttributeDefsNodeList(grove, *elementType_, firstAttDefIdx)); return accessOK; } Node *ElementTypeAttributeDefOrigin ::makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const { return new ElementTypeCdataAttributeValueNode(grove, value, attIndex, iter, charIndex, elementType_); } Node *ElementTypeAttributeDefOrigin ::makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const { return new ElementTypeAttributeValueTokenNode(grove, value, attIndex, tokenIndex, elementType_); } Node *ElementTypeAttributeDefOrigin::makeOriginNode(const GroveImpl *grove, size_t) const { return new ElementTypeAttributeDefNode(grove, *elementType_, attIndex_); } const void *ElementTypeAttributeDefOrigin::attributeOriginId() const { return elementType_; } // class IMP: NotationAttributeDefOrigin NotationAttributeDefOrigin::NotationAttributeDefOrigin(const Notation *notation) : notation_(notation) { } const AttributeDefinitionList *NotationAttributeDefOrigin::attDefList() const { return notation_->attributeDefTemp(); } AccessResult NotationAttributeDefOrigin::makeAttributeDefNode(const GroveImpl *grove, NodePtr &ptr, size_t attributeDefIdx) const { ptr.assign(new NotationAttributeDefNode(grove, *notation_, attributeDefIdx)); return accessOK; } AccessResult NotationAttributeDefOrigin::makeAttributeDefList(const GroveImpl *grove, NodeListPtr &ptr, size_t firstAttDefIdx) const { ptr.assign(new NotationAttributeDefsNodeList(grove, *notation_, firstAttDefIdx)); return accessOK; } Node *NotationAttributeDefOrigin ::makeCdataAttributeValueNode(const GroveImpl *grove, const AttributeValue *value, size_t attIndex, const TextIter &iter, size_t charIndex) const { return new NotationCdataAttributeValueNode(grove, value, attIndex, iter, charIndex, notation_); } Node *NotationAttributeDefOrigin ::makeAttributeValueTokenNode(const GroveImpl *grove, const TokenizedAttributeValue *value, size_t attIndex, size_t tokenIndex) const { return new NotationAttributeValueTokenNode(grove, value, attIndex, tokenIndex, notation_); } Node *NotationAttributeDefOrigin::makeOriginNode(const GroveImpl *grove, size_t) const { return new NotationAttributeDefNode(grove, *notation_, attIndex_); } const void *NotationAttributeDefOrigin::attributeOriginId() const { return notation_; } // class IMP: AttributeDefNode AccessResult AttributeDefNode::getName(GroveString &str) const { setString(str, attDefList()->def(attIndex_)->name()); return accessOK; } AccessResult AttributeDefNode::getDeclValueType(Node::DeclValueType::Enum &dvt) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); switch (desc.declaredValue) { case AttributeDefinitionDesc::cdata: dvt = DeclValueType::cdata; break; case AttributeDefinitionDesc::name: dvt = DeclValueType::name; break; case AttributeDefinitionDesc::number: dvt = DeclValueType::number; break; case AttributeDefinitionDesc::nmtoken: dvt = DeclValueType::nmtoken; break; case AttributeDefinitionDesc::nutoken: dvt = DeclValueType::nutoken; break; case AttributeDefinitionDesc::entity: dvt = DeclValueType::entity; break; case AttributeDefinitionDesc::idref: dvt = DeclValueType::idref; break; case AttributeDefinitionDesc::names: dvt = DeclValueType::names; break; case AttributeDefinitionDesc::numbers: dvt = DeclValueType::numbers; break; case AttributeDefinitionDesc::nmtokens: dvt = DeclValueType::nmtokens; break; case AttributeDefinitionDesc::nutokens: dvt = DeclValueType::nutokens; break; case AttributeDefinitionDesc::entities: dvt = DeclValueType::entities; break; case AttributeDefinitionDesc::idrefs: dvt = DeclValueType::idrefs; break; case AttributeDefinitionDesc::id: dvt = DeclValueType::id; break; case AttributeDefinitionDesc::notation: dvt = DeclValueType::notation; break; case AttributeDefinitionDesc::nameTokenGroup: dvt = DeclValueType::nmtkgrp; break; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult AttributeDefNode::getDefaultValueType(Node::DefaultValueType::Enum &dvt) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); switch (desc.defaultValueType) { case AttributeDefinitionDesc::required: dvt = DefaultValueType::required; break; case AttributeDefinitionDesc::current: dvt = DefaultValueType::current; break; case AttributeDefinitionDesc::implied: dvt = DefaultValueType::implied; break; case AttributeDefinitionDesc::conref: dvt = DefaultValueType::conref; break; case AttributeDefinitionDesc::defaulted: dvt = DefaultValueType::value; break; case AttributeDefinitionDesc::fixed: dvt = DefaultValueType::fixed; break; default: CANNOT_HAPPEN(); } return accessOK; } AccessResult AttributeDefNode::getTokens(GroveStringListPtr &tokens) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); if (desc.declaredValue != AttributeDefinitionDesc::notation && desc.declaredValue != AttributeDefinitionDesc::nameTokenGroup) return accessNull; tokens.assign(new GroveStringList); GroveString str; for (size_t i = 0; i < desc.allowedValues.size(); i++) { setString(str, desc.allowedValues[i]); tokens->append(str); } return accessOK; } AccessResult AttributeDefNode::getCurrentAttributeIndex(long &index) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); if (desc.defaultValueType != AttributeDefinitionDesc::current) return accessNull; index = desc.currentIndex; return accessOK; } void AttributeDefNode::accept(NodeVisitor &visitor) { visitor.attributeDef(*this); } bool AttributeDefNode::same(const BaseNode &node) const { return node.same2(this); } bool AttributeDefNode::same2(const AttributeDefNode *node) const { return (attributeOriginId() == node->attributeOriginId() && attIndex_ == node->attIndex()); } unsigned long AttributeDefNode::hash() const { unsigned long n = (unsigned long)attributeOriginId(); return secondHash(n + attIndex_); } // class IMP: ElementTypeAttributeDefNode AccessResult ElementTypeAttributeDefNode::getOrigin(NodePtr &ptr) const { ptr.assign(new ElementTypeNode(grove(), *elementType_)); return accessOK; } AccessResult ElementTypeAttributeDefNode::getCurrentGroup(NodeListPtr &ptr) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); if (desc.defaultValueType != AttributeDefinitionDesc::current) return accessNull; ptr.assign( new ElementTypeCurrentGroupAttributeDefsNodeList(grove(), grove()->governingDtd()->elementTypeIter(), desc.currentIndex)); return accessOK; } AccessResult ElementTypeAttributeDefNode::getLocation(Location &loc) const { const ElementDefinition *def = elementType_->definition(); if (def == 0) return accessNull; return grove()->proxifyLocation(def->location(), loc); } AccessResult ElementTypeAttributeDefNode::getDefaultValue(NodeListPtr &ptr) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); const AttributeValue *value = desc.defaultValue.pointer(); return makeAttributeValueNodeList(grove(), ptr, value); } // class IMP: NotationAttributeDefNode AccessResult NotationAttributeDefNode::getOrigin(NodePtr &ptr) const { ptr.assign(new NotationNode(grove(), notation_)); return accessOK; } AccessResult NotationAttributeDefNode::getCurrentGroup(NodeListPtr &ptr) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); if (desc.defaultValueType != AttributeDefinitionDesc::current) return accessNull; NodePtr nodePtr; nodePtr.assign(new NotationAttributeDefNode(grove(), *notation_, attIndex_)); ptr.assign(new SiblingNodeList(nodePtr)); return accessOK; } AccessResult NotationAttributeDefNode::getLocation(Location &loc) const { return grove()->proxifyLocation(notation_->defLocation(), loc); } AccessResult NotationAttributeDefNode::getDefaultValue(NodeListPtr &ptr) const { AttributeDefinitionDesc desc; attDefList()->def(attIndex_)->getDesc(desc); const AttributeValue *value = desc.defaultValue.pointer(); return makeAttributeValueNodeList(grove(), ptr, value); } // -- CLASS IMP: AttributeDefsNodeList bool AttributeDefsNodeList::inList(size_t attIndex) const { if (attDefList() == 0 || attIndex >= attDefList()->size()) return false; return true; } AccessResult AttributeDefsNodeList::first(NodePtr &ptr) const { return inList(attIndex_) ? makeAttributeDefNode(grove_, ptr, attIndex_) : accessNull; } AccessResult AttributeDefsNodeList::chunkRest(NodeListPtr &ptr) const { if (canReuse(ptr)) { AttributeDefsNodeList *list = (AttributeDefsNodeList *)this; if (list->inList(list->attIndex_)) { ++(list->attIndex_); return accessOK; } return accessNull; } return inList(attIndex_) ? makeAttributeDefList(grove_, ptr, attIndex_+1) : accessNull; } // -- CLASS IMP: AttributeDefsNamedNodeList NodeListPtr AttributeDefsNamedNodeList::nodeList() const { NodeListPtr ptr; makeAttributeDefList(grove(), ptr, 0); return ptr; } AccessResult AttributeDefsNamedNodeList::namedNodeU(const StringC &str, NodePtr &ptr) const { return makeAttributeDefNode(grove(), ptr, str); } // -- CLASS IMP: ElementTypeCurrentGroupAttributeDefsNodeList ElementTypeCurrentGroupAttributeDefsNodeList ::ElementTypeCurrentGroupAttributeDefsNodeList(const GroveImpl *grove, const Dtd::ConstElementTypeIter &iter, size_t currentGroupIndex) : grove_(grove), iter_(iter), currentGroupIndex_(currentGroupIndex), attIndex_(0) { elementType_ = iter_.next(); next(false); } bool ElementTypeCurrentGroupAttributeDefsNodeList::next(Dtd::ConstElementTypeIter &iter, const ElementType *&elementType, size_t &attIndex, bool incrementFirst) const { if (incrementFirst) attIndex++; while (elementType != 0) { if (attIndex >= elementType->attributeDefTemp()->size() ) { do { elementType = iter.next(); } while(elementType != 0 && !elementType->attributeDefTemp()->anyCurrent()); attIndex = 0; } else { if (elementType->attributeDefTemp()->def(attIndex)->isCurrent()) { AttributeDefinitionDesc desc; elementType->attributeDefTemp()->def(attIndex)->getDesc(desc); if (desc.currentIndex == currentGroupIndex_) break; } attIndex++; } } return elementType != 0 ? true : false; } AccessResult ElementTypeCurrentGroupAttributeDefsNodeList::first(NodePtr &ptr) const { if (elementType_ == 0) return accessNull; ptr.assign(new ElementTypeAttributeDefNode(grove_, *elementType_, attIndex_)); return accessOK; } AccessResult ElementTypeCurrentGroupAttributeDefsNodeList::chunkRest(NodeListPtr &ptr) const { if (elementType_ == 0) return accessNull; if (canReuse(ptr)) { ElementTypeCurrentGroupAttributeDefsNodeList *list = (ElementTypeCurrentGroupAttributeDefsNodeList *)this; list->next(); return accessOK; } else { Dtd::ConstElementTypeIter iter(iter_); const ElementType *elementType = elementType_; size_t attIndex = attIndex_; next(iter, elementType, attIndex); ptr.assign(new ElementTypeCurrentGroupAttributeDefsNodeList(grove_, iter, elementType, attIndex, currentGroupIndex_)); } return accessOK; } // ------------------------------ dev end -------------------------------- #ifdef SP_NAMESPACE } #endif #include "grove_inst.cxx" OpenJade-1.4devel/spgrove/GroveBuilder.h0000644000021000000240000000226607025631167013767 // Copyright (c) 1996 James Clark // See the file COPYING for copying permission. #ifndef GroveBuilder_INCLUDED #define GroveBuilder_INCLUDED 1 #include #include "Node.h" #ifdef SP_USE_DLL #ifdef BUILD_LIBSPGROVE #define SPGROVE_API SP_DLLEXPORT #else #define SPGROVE_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define SPGROVE_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class Messenger; class ErrorCountEventHandler; class MessageFormatter; class SPGROVE_API GroveBuilder { public: static bool setBlocking(bool); static ErrorCountEventHandler *make(unsigned index, Messenger *, MessageFormatter *, bool validateOnly, GROVE_NAMESPACE_SCOPE NodePtr &root); static ErrorCountEventHandler *make(unsigned index, Messenger *, MessageFormatter *, bool validateOnly, const ConstPtr &sd, const ConstPtr &prologSyntax, const ConstPtr &instanceSyntax, GROVE_NAMESPACE_SCOPE NodePtr &root); private: GroveBuilder(); }; #ifdef SP_NAMESPACE } #endif #endif /* not GroveBuilder_INCLUDED */ OpenJade-1.4devel/spgrove/SdNode.cxx0000644000021000000240000000047007025631167013120 // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #include "config.h" #include "SdNode.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif const Node::IID SdNode::iid = "SdNode"; #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/spgrove/SdNode.h0000644000021000000240000000170707025631167012551 // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #ifndef SdNode_INCLUDED #define SdNode_INCLUDED 1 #include #include "Node.h" #include #include #include "GroveBuilder.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef GROVE_NAMESPACE #define GROVE_NAMESPACE_SCOPE GROVE_NAMESPACE:: #else #define GROVE_NAMESPACE_SCOPE #endif class SPGROVE_API SdNode { public: virtual GROVE_NAMESPACE_SCOPE AccessResult getSd(ConstPtr &sd, ConstPtr &prologSyntax, ConstPtr &instanceSyntax) const = 0; static const GROVE_NAMESPACE_SCOPE Node::IID iid; static const SdNode *convert(const GROVE_NAMESPACE_SCOPE NodePtr &nd) { const void *p; if (nd && nd->queryInterface(iid, p)) return (const SdNode *)p; else return 0; } }; #undef GROVE_NAMESPACE_SCOPE #ifdef SP_NAMESPACE } #endif #endif /* not SdNode_INCLUDED */ OpenJade-1.4devel/spgrove/threads.h0000644000021000000240000003036307031670646013031 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef threads_INCLUDED #define threads_INCLUDED 1 // Thread primitives. #if defined(_MSC_VER) && defined(_MT) // WIN32 #define SP_THREAD #define STRICT 1 #define WIN32_LEAN_AND_MEAN #include #include // appears to turn these warnings back on #ifdef _MSC_VER #pragma warning ( disable : 4237 ) #endif class Thread { public: Thread(int (*func)(void *), void *arg) { unsigned threadId; arg_ = new Arg; arg_->func = func; arg_->arg = arg; arg_->exited = 0; handle_ = HANDLE(_beginthreadex(NULL, 0, start, arg_, 0, &threadId)); } int wait() { if (WaitForSingleObject(handle_, INFINITE) != WAIT_OBJECT_0) abort(); if (!CloseHandle(handle_)) abort(); if (arg_->exited) { int ret = arg_->ret; delete arg_; return ret; } // Something's gone wrong. We'll get a leak. return 0; } private: struct Arg { int (*func)(void *); void *arg; int ret; int exited; }; static unsigned __stdcall start(void *p) { Arg *arg = (Arg *)p; arg->ret = (*arg->func)(arg->arg); arg->exited = 1; return 0; } HANDLE handle_; Arg *arg_; }; class Mutex { public: class Lock { public: Lock(Mutex *mp) : mp_(mp) { if (mp) EnterCriticalSection(&mp->cs_); } ~Lock() { if (mp_) LeaveCriticalSection(&mp_->cs_); } private: Mutex *mp_; }; Mutex() { InitializeCriticalSection(&cs_); } ~Mutex() { DeleteCriticalSection(&cs_); } friend class Lock; private: CRITICAL_SECTION cs_; }; // Thread-safe reference counts. class RefCount { public: RefCount() : count_(0) { } void operator++() { InterlockedIncrement(&count_); } bool operator--() { return InterlockedDecrement(&count_) != 0; } operator unsigned long() const { return count_; } private: long count_; }; #ifndef SP_NO_BLOCK #define SP_CONDITION class Condition { public: // Manual reset event, initially non-signalled Condition() : handle_(CreateEvent(NULL, 1, 0, NULL)), nWaiters_(0) { } ~Condition() { CloseHandle(handle_); } // Set the event to signalled, releasing all threads waiting on it, // then set it back to non-signalled. // For performance reasons, we want to avoid calling PulseEvent unless we have // some thread waiting on this condition. // The obvious solution of a boolean variable that's set by wait() and // cleared by pulse() fails in the following scenario: // reader: needPulse_ = 1; // writer: needPulse_ = 0; // writer: PulseEvent() // reader: WaitForSingleObject() void pulse() { if (nWaiters_) { PulseEvent(handle_); } } // Wait for the event to become signalled. bool wait() const { InterlockedIncrement((long *)&nWaiters_); bool ret = (WaitForSingleObject(handle_, INFINITE) == WAIT_OBJECT_0); InterlockedDecrement((long *)&nWaiters_); return ret; } // Set the event to signalled, releasing all threads waiting on it. // Don't set it back to non-signalled. Any thread that subsequently // waits will return immediately. void set() { SetEvent(handle_); } private: long nWaiters_; HANDLE handle_; }; #endif /* not SP_NO_BLOCK */ #endif /* _MSC_VER && _MT */ #if defined (USE_THREADS) && !defined(SP_THREAD) #ifdef SP_MUTEX_MACH // For Mach, using C Threads. May or may not work as-is on your Mach-based OS. // Written by Raf Schietekat on 1996-11-10. // Platform used: NEXTSTEP_(Dev_)3.2 with sp-1.1.1 and jade-0.1. // Maturity: only dsssl/demo.sgm tested (successfully). #define SP_THREAD extern "C" { #ifdef __NeXT__ // catch is a reserved word in C++, it's only used to declare a struct member #define catch catch22 #include #undef catch // don't want ASSERT to clash with ASSERT in SP's macros.h #undef ASSERT #elif defined __GNU__ // catch is a reserved word in C++, it's only used to declare a struct member #define catch catch22 #include #undef catch // don't want ASSERT to clash with ASSERT in SP's macros.h #undef ASSERT #else // Change to whatever works for you, and tell James Clark (or me). // catch is a reserved word in C++, it's only used to declare a struct member #define catch catch22 #include #undef catch // don't want ASSERT to clash with ASSERT in SP's macros.h #undef ASSERT #endif } class Thread { public: Thread(int (*func)(void *), void *arg) { arg_ = new Arg; arg_->func = func; arg_->arg = arg; arg_->exited = 0; handle_ = cthread_fork((cthread_fn_t)start, (any_t)arg_); // will be cthread_join()'ed in wait() } int wait() { cthread_join(handle_); if (arg_ && arg_->exited) { int ret = arg_->ret; delete arg_; arg_ = 0; return ret; } // Something's gone wrong. We'll get a leak. return 0; } private: struct Arg { int (*func)(void *); void *arg; int ret; int exited; }; static void *start(void *p) { Arg *arg = (Arg *)p; arg->ret = (*arg->func)(arg->arg); arg->exited = 1; return 0; } cthread_t handle_; Arg *arg_; }; class Mutex { public: class Lock { // Lock serves to automatically unlock Mutex, however control leaves // a block. Don't let any "warning: unused variable `class Mutex::Lock lock'" // mislead you; hopefully your compiler won't optimise this away... public: Lock(Mutex *mp) : mp_(mp) { if (mp_) mutex_lock (&mp_->cs_); } ~Lock() { if (mp_) mutex_unlock(&mp_->cs_); } private: Mutex *mp_; }; Mutex() { mutex_init (&cs_); } ~Mutex() { mutex_clear(&cs_); } friend class Lock; private: struct mutex cs_; }; // Thread-safe reference counts. class RefCount { public: RefCount() : count_(0) { mutex_init (&cs_); } ~RefCount() { mutex_clear(&cs_); } void operator++() { mutex_lock(&cs_); ++count_; mutex_unlock(&cs_); } bool operator--() { bool ret; mutex_lock(&cs_); ret=(0!=--count_); mutex_unlock(&cs_); return ret; // safe iff reference-count semantics are observed } operator unsigned long() const { return count_; } // safe iff reference-count semantics are observed private: long count_; // hmm, () returns unsigned long... struct mutex cs_; // don't build on top of Mutex class, for efficiency }; #ifndef SP_NO_BLOCK #define SP_CONDITION class Condition { // doesn't trivially map to a condition_t! public: Condition() : set_(0) { /**/mutex_= mutex_alloc(); condition_=condition_alloc(); } ~Condition() { /**/mutex_free( mutex_); condition_free(condition_); } void pulse() { condition_broadcast(condition_); } bool wait() const { mutex_lock ( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_); if(!set_) condition_wait( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif condition_, #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_); mutex_unlock( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_); return 1; // 0 would be interpreted as timeout, which is not supported directly // do we need that? would require some more coding, with another thread } void set() { mutex_lock (mutex_); set_=1; mutex_unlock(mutex_); condition_broadcast(condition_); } private: // nWaiters_ functionality already in Mach C Threads mutable mutex_t mutex_; // every C Threads condition_t needs a mutex_t // but also see set_ below mutable condition_t condition_; // can't have struct and struct mutex because of the const in wait() // (can/should this const-ness be revised?) bool set_; // born as false, does a single transition to true, then dies // therefore, no mutex (with its overhead) seems required, right? // wrong: // consumer reads set_ as false // producer sets set_ to true // producer signals condition for the last time // consumer waits, and waits forever // (consumer didn't get last condition because it was not yet waiting) }; #endif /* SP_NO_BLOCK */ #endif /* SP_MUTEX_MACH */ #ifdef SP_MUTEX_PTHREADS // Support for pthreads on Linux. // Written by Matthias Clasen extern "C" { // for some reason sigset_t is missing here (with glibc 2.0.7); // so we define it manually. typedef __sigset_t sigset_t; #include } #define SP_THREAD class Thread { public: Thread(int (*func)(void *), void *arg) { arg_ = new Arg; arg_->func = func; arg_->arg = arg; arg_->exited = 0; pthread_create (&handle_, NULL, start, (void *)arg_); } int wait() { pthread_join(handle_, NULL); if (arg_ && arg_->exited) { int ret = arg_->ret; delete arg_; arg_ = 0; return ret; } // Something's gone wrong. We'll get a leak. return 0; } private: struct Arg { int (*func)(void *); void *arg; int ret; int exited; }; static void *start(void *p) { Arg *arg = (Arg *)p; arg->ret = (*arg->func)(arg->arg); arg->exited = 1; return 0; } pthread_t handle_; Arg *arg_; }; class Mutex { public: class Lock { // Lock serves to automatically unlock Mutex, however control leaves // a block. Don't let any "warning: unused variable `class Mutex::Lock lock'" // mislead you; hopefully your compiler won't optimise this away... public: Lock(Mutex *mp) : mp_(mp) { if (mp_) pthread_mutex_lock (&mp_->cs_); } ~Lock() { if (mp_) pthread_mutex_unlock(&mp_->cs_); } private: Mutex *mp_; }; Mutex() { pthread_mutex_init (&cs_, NULL); } ~Mutex() { pthread_mutex_destroy (&cs_); } friend class Lock; private: pthread_mutex_t cs_; }; // Thread-safe reference counts. class RefCount { public: RefCount() : count_(0) { pthread_mutex_init (&cs_, NULL); } ~RefCount() { pthread_mutex_destroy (&cs_); } void operator++() { pthread_mutex_lock(&cs_); ++count_; pthread_mutex_unlock(&cs_); } bool operator--() { bool ret; pthread_mutex_lock(&cs_); ret=(0!=--count_); pthread_mutex_unlock(&cs_); return ret; // safe iff reference-count semantics are observed } operator unsigned long() const { return count_; } // safe iff reference-count semantics are observed private: long count_; // hmm, () returns unsigned long... pthread_mutex_t cs_; // don't build on top of Mutex class, for efficiency }; #ifndef SP_NO_BLOCK #define SP_CONDITION class Condition { // doesn't trivially map to a condition_t! public: Condition() : set_(0) { pthread_mutex_init(&mutex_, NULL); pthread_cond_init(&condition_, NULL); } ~Condition() { pthread_mutex_destroy(&mutex_); pthread_cond_destroy(&condition_); } void pulse() { pthread_cond_broadcast(&condition_); } bool wait() const { pthread_mutex_lock(&( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_)); if (!set_) pthread_cond_wait(&( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif condition_), &( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_)); pthread_mutex_unlock(&( #ifndef HAVE_MUTABLE ((Condition *)this)-> #endif mutex_)); return 1; // 0 would be interpreted as timeout, which is not supported directly // do we need that? would require some more coding, with another thread } void set() { pthread_mutex_lock(&mutex_); set_=1; pthread_mutex_unlock(&mutex_); pthread_cond_broadcast(&condition_); } private: mutable pthread_mutex_t mutex_; mutable pthread_cond_t condition_; bool set_; }; #endif /* SP_NO_BLOCK */ #endif /* SP_MUTEX_PTHREADS */ #endif /* USE_THREADS */ #ifndef SP_THREAD class Thread { public: Thread(int (*func)(void *), void *args) : ret_((*func)(args)) { } int wait() { return ret_; } private: int ret_; }; class RefCount { public: RefCount() : count_(0) { } void operator++() { ++count_; } bool operator--() { return --count_ != 0; } operator unsigned long() const { return count_; } private: unsigned long count_; }; class Mutex { public: class Lock { public: Lock(Mutex *) { } }; Mutex() { } }; #endif /* not SP_THREAD */ #ifndef SP_CONDITION class Condition { public: Condition() { } void pulse() { } void set() { } bool wait() const { return 0; } }; #endif /* not SP_CONDITION */ #endif /* not threads_INCLUDED */ OpenJade-1.4devel/spgrove/grove_inst.m40000644000021000000240000000114307067706475013652 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #undef SP_DEFINE_TEMPLATES #include #include #include "Node.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class ElementChunk; __instantiate(`PointerTable') __instantiate(`Vector') __instantiate(Vector >) #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/spgrove/grove_inst.cxx0000644000021000000240000000267007067712407014132 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #undef SP_DEFINE_TEMPLATES #include #include #include "Node.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class ElementChunk; #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_2; #endif #endif #endif #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/spgrove/spgrove.dsp0000644000021000000240000001305507025631167013420 # Microsoft Developer Studio Project File - Name="spgrove" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=spgrove - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "spgrove.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "spgrove.mak" CFG="spgrove - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "spgrove - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spgrove - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "spgrove - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir ".\Release" # PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\grove" /D "BUILD_LIBSPGROVE" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20100000" /subsystem:windows /dll /machine:I386 /out:"..\bin\ospgrove.dll" /base:0x22000000 # SUBTRACT LINK32 /profile /map !ELSEIF "$(CFG)" == "spgrove - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir ".\Debug" # PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\grove" /D "BUILD_LIBSPGROVE" /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20100000" /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\ospgrove.dll" /base:0x22000000 # SUBTRACT LINK32 /incremental:no !ENDIF # Begin Target # Name "spgrove - Win32 Release" # Name "spgrove - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" # Begin Source File SOURCE=.\grove_inst.m4 !IF "$(CFG)" == "spgrove - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\grove_inst.m4 InputName=grove_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "spgrove - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\grove_inst.m4 InputName=grove_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\GroveApp.cxx # End Source File # Begin Source File SOURCE=.\GroveBuilder.cxx # End Source File # Begin Source File SOURCE=.\SdNode.cxx # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # Begin Source File SOURCE=.\GroveApp.h # End Source File # Begin Source File SOURCE=.\GroveBuilder.h # End Source File # Begin Source File SOURCE=.\SdNode.h # End Source File # Begin Source File SOURCE=.\threads.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=.\grove_inst.cxx # PROP BASE Exclude_From_Build 1 # PROP Exclude_From_Build 1 # End Source File # End Target # End Project OpenJade-1.4devel/style/0000777000021000000240000000000007070410061010742 5OpenJade-1.4devel/style/Makefile.in0000644000021000000240000004444107070410061012732 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ lib_LTLIBRARIES = libostyle.la libostyle_la_LDFLAGS = -version-info 0:0:0 libostyle_la_SOURCES = Collector.cxx Collector.h DssslApp.cxx DssslApp.h DssslAppMessages.h DssslSpecEventHandler.cxx DssslSpecEventHandler.h ELObj.cxx ELObj.h ELObjMessageArg.cxx ELObjMessageArg.h ELObjPropVal.h EvalContext.h Expression.cxx Expression.h FOTBuilder.cxx FOTBuilder.h FlowObj.cxx GroveManager.cxx GroveManager.h InheritedC.cxx Insn.cxx Insn.h Insn2.h Interpreter.cxx Interpreter.h InterpreterMessages.cxx InterpreterMessages.h LangObj.cxx LangObj.h MacroFlowObj.cxx MacroFlowObj.h NumberCache.cxx NumberCache.h Pattern.cxx Pattern.h ProcessContext.cxx ProcessContext.h ProcessingMode.cxx ProcessingMode.h SchemeParser.cxx SchemeParser.h SosofoObj.h Style.cxx Style.h StyleEngine.cxx StyleEngine.h VM.h charNames.h charProps.h dsssl_ns.h primitive.cxx primitive.h sdata.h style_inst.cxx style_pch.h stylelib.cxx stylelib.h TransformationMode.h TransformationMode.cxx DocumentGenerator.h DocumentGenerator.cxx # We install the headers needed to create a new application based on # the DssslApp class. pkginclude_HEADERS = FOTBuilder.h dsssl_ns.h DssslApp.h GroveManager.h INCLUDES = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove EXTRA_DIST = FlowObj_inst.cxx primitive_inst.cxx style_inst.m4 FlowObj_inst.m4 primitive_inst.m4 InterpreterMessages.msg InterpreterMessages.rc DssslAppMessages.msg DssslAppMessages.rc style.dsp BUILT_SOURCES = style_inst.cxx FlowObj_inst.cxx primitive_inst.cxx InterpreterMessages.h InterpreterMessages.cxx InterpreterMessages.rc DssslAppMessages.h DssslAppMessages.rc MSGGENFLAGS = -l xModule SUFFIXES = .m4 .msg .rc mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libostyle_la_LIBADD = libostyle_la_OBJECTS = Collector.lo DssslApp.lo \ DssslSpecEventHandler.lo ELObj.lo ELObjMessageArg.lo Expression.lo \ FOTBuilder.lo FlowObj.lo GroveManager.lo InheritedC.lo Insn.lo \ Interpreter.lo InterpreterMessages.lo LangObj.lo MacroFlowObj.lo \ NumberCache.lo Pattern.lo ProcessContext.lo ProcessingMode.lo \ SchemeParser.lo Style.lo StyleEngine.lo primitive.lo style_inst.lo \ stylelib.lo TransformationMode.lo DocumentGenerator.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(pkginclude_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libostyle_la_SOURCES) OBJECTS = $(libostyle_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cxx .lo .m4 .msg .o .rc .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps style/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) distclean-libLTLIBRARIES: maintainer-clean-libLTLIBRARIES: install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: libostyle.la: $(libostyle_la_OBJECTS) $(libostyle_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libostyle_la_LDFLAGS) $(libostyle_la_OBJECTS) $(libostyle_la_LIBADD) $(LIBS) .cxx.o: $(CXXCOMPILE) -c $< .cxx.lo: $(LTCXXCOMPILE) -c $< install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) list='$(pkginclude_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = style distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done Collector.lo Collector.o : Collector.cxx ../config.h Collector.h DocumentGenerator.lo DocumentGenerator.o : DocumentGenerator.cxx \ stylelib.h ../config.h dsssl_ns.h DocumentGenerator.h \ ../grove/Node.h DssslApp.lo DssslApp.o : DssslApp.cxx stylelib.h ../config.h dsssl_ns.h \ DssslApp.h ../spgrove/GroveApp.h ../spgrove/GroveBuilder.h \ ../grove/Node.h FOTBuilder.h GroveManager.h DssslAppMessages.h \ StyleEngine.h ../grove/LocNode.h ../spgrove/SdNode.h DssslSpecEventHandler.lo DssslSpecEventHandler.o : \ DssslSpecEventHandler.cxx stylelib.h ../config.h dsssl_ns.h \ DssslSpecEventHandler.h InterpreterMessages.h FOTBuilder.h \ ../grove/Node.h ELObj.lo ELObj.o : ELObj.cxx stylelib.h ../config.h dsssl_ns.h ELObj.h \ Collector.h ../grove/Node.h FOTBuilder.h EvalContext.h \ Interpreter.h Expression.h Insn.h Style.h ProcessingMode.h \ Pattern.h SosofoObj.h NumberCache.h GroveManager.h \ TransformationMode.h InterpreterMessages.h ELObjMessageArg.lo ELObjMessageArg.o : ELObjMessageArg.cxx stylelib.h \ ../config.h dsssl_ns.h ELObjMessageArg.h ELObj.h Collector.h \ ../grove/Node.h FOTBuilder.h Interpreter.h Expression.h Insn.h \ Style.h ProcessingMode.h Pattern.h SosofoObj.h NumberCache.h \ GroveManager.h TransformationMode.h Expression.lo Expression.o : Expression.cxx stylelib.h ../config.h \ dsssl_ns.h Insn.h ELObj.h Collector.h ../grove/Node.h \ FOTBuilder.h Insn2.h SosofoObj.h Style.h ProcessingMode.h \ Expression.h Pattern.h Interpreter.h NumberCache.h \ GroveManager.h TransformationMode.h InterpreterMessages.h \ ELObjMessageArg.h FOTBuilder.lo FOTBuilder.o : FOTBuilder.cxx stylelib.h ../config.h \ dsssl_ns.h FOTBuilder.h ../grove/Node.h FlowObj.lo FlowObj.o : FlowObj.cxx stylelib.h ../config.h dsssl_ns.h \ ProcessContext.h Collector.h Style.h ELObj.h ../grove/Node.h \ FOTBuilder.h Insn.h ProcessingMode.h Expression.h Pattern.h \ SosofoObj.h VM.h EvalContext.h Interpreter.h NumberCache.h \ GroveManager.h TransformationMode.h InterpreterMessages.h \ ELObjMessageArg.h FlowObj_inst.cxx GroveManager.lo GroveManager.o : GroveManager.cxx stylelib.h ../config.h \ dsssl_ns.h GroveManager.h ../grove/Node.h FOTBuilder.h InheritedC.lo InheritedC.o : InheritedC.cxx stylelib.h ../config.h \ dsssl_ns.h Style.h ELObj.h Collector.h ../grove/Node.h \ FOTBuilder.h Insn.h ProcessingMode.h Expression.h Pattern.h \ VM.h EvalContext.h Interpreter.h SosofoObj.h NumberCache.h \ GroveManager.h TransformationMode.h InterpreterMessages.h Insn.lo Insn.o : Insn.cxx stylelib.h ../config.h dsssl_ns.h VM.h \ Collector.h EvalContext.h ../grove/Node.h Insn.h ELObj.h \ FOTBuilder.h Interpreter.h Expression.h Style.h \ ProcessingMode.h Pattern.h SosofoObj.h NumberCache.h \ GroveManager.h TransformationMode.h InterpreterMessages.h \ ELObjMessageArg.h Insn2.h ELObjPropVal.h Interpreter.lo Interpreter.o : Interpreter.cxx stylelib.h ../config.h \ dsssl_ns.h Interpreter.h ELObj.h Collector.h ../grove/Node.h \ FOTBuilder.h Expression.h Insn.h Style.h ProcessingMode.h \ Pattern.h SosofoObj.h NumberCache.h GroveManager.h \ TransformationMode.h InterpreterMessages.h ../grove/LocNode.h \ MacroFlowObj.h ELObjMessageArg.h VM.h EvalContext.h \ SchemeParser.h LangObj.h charNames.h sdata.h charProps.h InterpreterMessages.lo InterpreterMessages.o : InterpreterMessages.cxx \ stylelib.h ../config.h dsssl_ns.h InterpreterMessages.h LangObj.lo LangObj.o : LangObj.cxx stylelib.h ../config.h dsssl_ns.h \ LangObj.h ELObj.h Collector.h ../grove/Node.h FOTBuilder.h MacroFlowObj.lo MacroFlowObj.o : MacroFlowObj.cxx stylelib.h ../config.h \ dsssl_ns.h MacroFlowObj.h SosofoObj.h ELObj.h Collector.h \ ../grove/Node.h FOTBuilder.h Insn.h Expression.h VM.h \ EvalContext.h Insn2.h Style.h ProcessingMode.h Pattern.h \ Interpreter.h NumberCache.h GroveManager.h TransformationMode.h \ ProcessContext.h NumberCache.lo NumberCache.o : NumberCache.cxx stylelib.h ../config.h \ dsssl_ns.h NumberCache.h ../grove/Node.h Pattern.lo Pattern.o : Pattern.cxx stylelib.h ../config.h dsssl_ns.h \ Pattern.h ../grove/Node.h Interpreter.h ELObj.h Collector.h \ FOTBuilder.h Expression.h Insn.h Style.h ProcessingMode.h \ SosofoObj.h NumberCache.h GroveManager.h TransformationMode.h ProcessContext.lo ProcessContext.o : ProcessContext.cxx stylelib.h \ ../config.h dsssl_ns.h ProcessContext.h Collector.h Style.h \ ELObj.h ../grove/Node.h FOTBuilder.h Insn.h ProcessingMode.h \ Expression.h Pattern.h SosofoObj.h VM.h EvalContext.h \ Interpreter.h NumberCache.h GroveManager.h TransformationMode.h \ InterpreterMessages.h ProcessingMode.lo ProcessingMode.o : ProcessingMode.cxx stylelib.h \ ../config.h dsssl_ns.h ProcessingMode.h Expression.h ELObj.h \ Collector.h ../grove/Node.h FOTBuilder.h Insn.h Pattern.h \ Interpreter.h Style.h SosofoObj.h NumberCache.h GroveManager.h \ TransformationMode.h InterpreterMessages.h Insn2.h VM.h \ EvalContext.h ../grove/LocNode.h SchemeParser.lo SchemeParser.o : SchemeParser.cxx stylelib.h ../config.h \ dsssl_ns.h SchemeParser.h Interpreter.h ELObj.h Collector.h \ ../grove/Node.h FOTBuilder.h Expression.h Insn.h Style.h \ ProcessingMode.h Pattern.h SosofoObj.h NumberCache.h \ GroveManager.h TransformationMode.h InterpreterMessages.h \ MacroFlowObj.h LangObj.h VM.h EvalContext.h ELObjMessageArg.h \ DssslSpecEventHandler.h Style.lo Style.o : Style.cxx stylelib.h ../config.h dsssl_ns.h Style.h \ ELObj.h Collector.h ../grove/Node.h FOTBuilder.h Insn.h \ ProcessingMode.h Expression.h Pattern.h VM.h EvalContext.h \ Interpreter.h SosofoObj.h NumberCache.h GroveManager.h \ TransformationMode.h InterpreterMessages.h StyleEngine.lo StyleEngine.o : StyleEngine.cxx stylelib.h ../config.h \ dsssl_ns.h StyleEngine.h ../grove/Node.h FOTBuilder.h \ GroveManager.h Interpreter.h ELObj.h Collector.h Expression.h \ Insn.h Style.h ProcessingMode.h Pattern.h SosofoObj.h \ NumberCache.h TransformationMode.h InterpreterMessages.h \ SchemeParser.h DssslSpecEventHandler.h ProcessContext.h VM.h \ EvalContext.h DocumentGenerator.h TransformationMode.lo TransformationMode.o : TransformationMode.cxx \ stylelib.h ../config.h dsssl_ns.h TransformationMode.h Insn.h \ ELObj.h Collector.h ../grove/Node.h FOTBuilder.h Expression.h \ Interpreter.h Style.h ProcessingMode.h Pattern.h SosofoObj.h \ NumberCache.h GroveManager.h InterpreterMessages.h \ ELObjMessageArg.h VM.h EvalContext.h primitive.lo primitive.o : primitive.cxx stylelib.h ../config.h \ dsssl_ns.h Interpreter.h ELObj.h Collector.h ../grove/Node.h \ FOTBuilder.h Expression.h Insn.h Style.h ProcessingMode.h \ Pattern.h SosofoObj.h NumberCache.h GroveManager.h \ TransformationMode.h InterpreterMessages.h EvalContext.h \ ELObjMessageArg.h ../grove/LocNode.h VM.h ELObjPropVal.h \ LangObj.h primitive.h primitive_inst.cxx style_inst.lo style_inst.o : style_inst.cxx stylelib.h ../config.h \ dsssl_ns.h stylelib.lo stylelib.o : stylelib.cxx stylelib.h ../config.h dsssl_ns.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-libLTLIBRARIES install-exec: install-exec-am install-data-am: install-pkgincludeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-libLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ distclean-compile clean-compile maintainer-clean-compile \ mostlyclean-libtool distclean-libtool clean-libtool \ maintainer-clean-libtool uninstall-pkgincludeHEADERS \ install-pkgincludeHEADERS tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ %.h %.cxx %.rc: %.msg $(PERL) -w $(top_builddir)/msggen.pl $(MSGGENFLAGS) $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/style/Makefile.am0000644000021000000240000000355307067706571012744 ## Process this file with automake to produce Makefile.in lib_LTLIBRARIES = libostyle.la libostyle_la_LDFLAGS = -version-info 0:0:0 libostyle_la_SOURCES = Collector.cxx Collector.h DssslApp.cxx \ DssslApp.h DssslAppMessages.h DssslSpecEventHandler.cxx \ DssslSpecEventHandler.h ELObj.cxx ELObj.h ELObjMessageArg.cxx \ ELObjMessageArg.h ELObjPropVal.h EvalContext.h Expression.cxx \ Expression.h FOTBuilder.cxx FOTBuilder.h FlowObj.cxx \ GroveManager.cxx GroveManager.h InheritedC.cxx Insn.cxx Insn.h \ Insn2.h Interpreter.cxx Interpreter.h InterpreterMessages.cxx \ InterpreterMessages.h LangObj.cxx LangObj.h MacroFlowObj.cxx \ MacroFlowObj.h NumberCache.cxx NumberCache.h Pattern.cxx Pattern.h \ ProcessContext.cxx ProcessContext.h ProcessingMode.cxx \ ProcessingMode.h SchemeParser.cxx SchemeParser.h SosofoObj.h \ Style.cxx Style.h StyleEngine.cxx StyleEngine.h VM.h charNames.h \ charProps.h dsssl_ns.h primitive.cxx primitive.h \ sdata.h style_inst.cxx style_pch.h stylelib.cxx \ stylelib.h TransformationMode.h TransformationMode.cxx \ DocumentGenerator.h DocumentGenerator.cxx # We install the headers needed to create a new application based on # the DssslApp class. pkginclude_HEADERS = FOTBuilder.h dsssl_ns.h DssslApp.h GroveManager.h INCLUDES = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove EXTRA_DIST = FlowObj_inst.cxx primitive_inst.cxx \ style_inst.m4 FlowObj_inst.m4 primitive_inst.m4 \ InterpreterMessages.msg InterpreterMessages.rc \ DssslAppMessages.msg DssslAppMessages.rc \ style.dsp BUILT_SOURCES = style_inst.cxx FlowObj_inst.cxx primitive_inst.cxx \ InterpreterMessages.h InterpreterMessages.cxx \ InterpreterMessages.rc DssslAppMessages.h DssslAppMessages.rc MSGGENFLAGS = -l xModule SUFFIXES = .m4 .msg .rc .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ %.h %.cxx %.rc: %.msg $(PERL) -w $(top_builddir)/msggen.pl $(MSGGENFLAGS) $< OpenJade-1.4devel/style/Collector.cxx0000644000021000000240000001536507067706475013371 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #include "Collector.h" #include #include #if 1 #define DEBUG #endif Collector::Collector(size_t maxSize) : freePtr_(&allObjectsList_), currentColor_(Object::someColor), blocks_(0), lastTraced_(0), totalObjects_(0), maxSize_(maxSize) { allObjectsList_.makeHead(); permanentFinalizersList_.makeHead(); } Collector::~Collector() { if (freePtr_ != &allObjectsList_) { for (Object *p = allObjectsList_.next(); p != freePtr_; p = p->next()) { if (!p->hasFinalizer_) break; p->finalize(); } } { for (Object *p = permanentFinalizersList_.next(); p != &permanentFinalizersList_; p = p->next()) { ASSERT(p->hasFinalizer_); p->finalize(); } } while (blocks_) { Block *tem = blocks_; blocks_ = blocks_->next; delete tem; } } void Collector::makeSpace() { unsigned long nLive = collect(); // Ensure that at least one-quarter of the heap is free, but don't allocate fewer // than 512 objects. if (freePtr_ == &allObjectsList_ || totalObjects_ - nLive < (totalObjects_ >> 2) || totalObjects_ < 128) { size_t allocObjs; if (totalObjects_ < 128) allocObjs = 512; else { allocObjs = (totalObjects_ >> 2) - (totalObjects_ - nLive); if (allocObjs < 512) allocObjs = 512; } if (freePtr_ == &allObjectsList_) { blocks_ = new Block(blocks_, allocObjs, maxSize_, freePtr_->prev()); freePtr_ = blocks_->firstObj; } else blocks_ = new Block(blocks_, allocObjs, maxSize_, freePtr_); totalObjects_ += allocObjs; } #ifdef DEBUG check(); #endif } void Collector::check() { size_t n = 0; bool allocated = 1; bool allowFinalizer = 1; for (Object *p = allObjectsList_.next(); p != &allObjectsList_; p = p->next()) { if (p == freePtr_) allocated = 0; else if (allocated) { if (p->color() != currentColor_) abort(); if (allowFinalizer) { if (!p->hasFinalizer_) allowFinalizer = 0; } else if (p->hasFinalizer_) abort(); } if (p->next()->prev() != p) abort(); if (p->prev()->next() != p) abort(); n++; } if (n != totalObjects_) abort(); } // Link block in after follow. Collector::Block::Block(Block *p, size_t n, size_t sz, Object *follow) : next(p) { Object *next = follow->next_; Object *prev = follow; Object *cur = (Object *)::operator new(n * sz); firstObj = follow->next_ = cur; for (size_t i = 0; i < n; i++) { Object *tem = (i == n - 1 ? next : (Object *)((char *)cur + sz)); cur->next_ = tem; cur->prev_ = prev; prev = cur; cur = tem; } next->prev_ = prev; } unsigned long Collector::collect() { Object *oldFreePtr = freePtr_; unsigned long nLive = 0; currentColor_ = (currentColor_ == Object::someColor ? Object::anotherColor : Object::someColor); lastTraced_ = &allObjectsList_; traceStaticRoots(); traceDynamicRoots(); if (lastTraced_ != &allObjectsList_) { Object *scanPtr = allObjectsList_.next(); for (;;) { if (scanPtr->hasSubObjects()) scanPtr->traceSubObjects(*this); nLive++; Object *next = scanPtr->next(); if (scanPtr->hasFinalizer_) scanPtr->moveAfter(&allObjectsList_); if (scanPtr == lastTraced_) { freePtr_ = next; break; } scanPtr = next; } } else freePtr_ = allObjectsList_.next(); lastTraced_ = 0; for (Object *p = freePtr_; p != oldFreePtr; p = p->next()) { if (!p->hasFinalizer_) break; p->finalize(); } #ifdef DEBUG check(); #endif return nLive; } void Collector::makePermanent(Object *obj) { if (!obj->hasSubObjects()) { // Handle the simple case quickly. if (obj->color() != Object::permanentColor) { totalObjects_--; obj->setColor(Object::permanentColor); obj->readOnly_ = 1; if (obj->hasFinalizer_) obj->moveAfter(&permanentFinalizersList_); else { obj->next_->prev_ = obj->prev_; obj->prev_->next_ = obj->next_; } } } else { Object::Color saveColor = currentColor_; currentColor_ = Object::permanentColor; lastTraced_ = &allObjectsList_; trace(obj); if (lastTraced_ != &allObjectsList_) { Object *scanPtr = allObjectsList_.next(); for (;;) { scanPtr->readOnly_ = 1; if (scanPtr->hasSubObjects()) scanPtr->traceSubObjects(*this); totalObjects_--; Object *next = scanPtr->next(); if (scanPtr->hasFinalizer_) scanPtr->moveAfter(&permanentFinalizersList_); else { // unlink from allObjectsList_ scanPtr->next_->prev_ = scanPtr->prev_; scanPtr->prev_->next_ = scanPtr->next_; } if (scanPtr == lastTraced_) break; scanPtr = next; } } lastTraced_ = 0; currentColor_ = saveColor; } } void Collector::makeReadOnly1(Object *obj) { Object::Color saveColor = currentColor_; currentColor_ = (currentColor_ == Object::someColor ? Object::anotherColor : Object::someColor); lastTraced_ = &allObjectsList_; trace(obj); if (lastTraced_ != &allObjectsList_) { Object *scanPtr = allObjectsList_.next(); Object *firstNonFinal = 0; Object *lim; for (;;) { if (scanPtr->hasSubObjects()) scanPtr->traceSubObjects(*this); Object *next = scanPtr->next(); if (scanPtr->hasFinalizer_) scanPtr->moveAfter(&allObjectsList_); else if (!firstNonFinal) firstNonFinal = scanPtr; if (scanPtr == lastTraced_) { lim = next; break; } scanPtr = next; } // We have 1 or more objects to be made read-only in currentColor // Followed by 0 or more objects with finalizers in saveColor // Followed by 0 or more objects without finalizers in saveColor for (scanPtr = allObjectsList_.next(); scanPtr != lim; scanPtr = scanPtr->next()) { scanPtr->readOnly_ = 1; scanPtr->setColor(saveColor); } if (firstNonFinal) { for (; scanPtr != freePtr_ && scanPtr->hasFinalizer_; scanPtr = scanPtr->next()) ; if (scanPtr != lim) { Object *last = lim->prev(); // Move section of list from firstNonFinal up to lastTraced but not including // lim to before scanPtr firstNonFinal->prev()->next_ = last->next(); last->next()->prev_ = firstNonFinal->prev(); firstNonFinal->prev_ = scanPtr->prev(); last->next_ = scanPtr->prev()->next(); firstNonFinal->prev()->next_ = firstNonFinal; last->next()->prev_ = last; } } } lastTraced_ = 0; currentColor_ = saveColor; #ifdef DEBUG check(); #endif } void Collector::traceDynamicRoots() { for (DynamicRoot *p = dynRootList_.next_; p != &dynRootList_; p = p->next_) p->trace(*this); } Collector::DynamicRoot::~DynamicRoot() { unlink(); } void Collector::unallocateObject(void *obj) { ((Object *)obj)->moveAfter(freePtr_); } OpenJade-1.4devel/style/Collector.h0000644000021000000240000001277507025631170012777 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Collector_INCLUDED #define Collector_INCLUDED 1 #include #include // A garbage collector. class Collector { public: struct Block; class Object { friend struct Block; friend class Collector; public: bool readOnly() const { return readOnly_; } bool permanent() const { return color_ == permanentColor; } protected: Object() : readOnly_(0) { } virtual ~Object() { } // If we copy an object, don't copy inappropriate info. Object(const Object &obj) { hasSubObjects_ = obj.hasSubObjects_; } // For objects with subobjects, this must be overriden // to call Collector::trace for each direct subobject. virtual void traceSubObjects(Collector &) const { } private: enum Color { someColor, anotherColor, permanentColor }; Object *next() const { return next_; } Object *prev() const { return prev_; } void makeHead() { prev_ = next_ = this; } Color color() const { return Color(color_); } void setColor(Color color) { color_ = color; } void moveAfter(Object *tail); bool hasSubObjects() const { return hasSubObjects_; } void finalize() { this->~Object(); } private: Object *prev_; Object *next_; char color_; char hasFinalizer_; protected: char hasSubObjects_; char readOnly_; }; class DynamicRoot { public: DynamicRoot(Collector &); virtual ~DynamicRoot(); virtual void trace(Collector &) const { } DynamicRoot(const DynamicRoot &); void operator=(const DynamicRoot &); private: DynamicRoot(); void link(const DynamicRoot *); void unlink(); DynamicRoot *next_; DynamicRoot *prev_; friend class Collector; }; class ObjectDynamicRoot : public DynamicRoot { public: ObjectDynamicRoot(Collector &, Object * = 0); ObjectDynamicRoot &operator=(Object *obj); void trace(Collector &) const; operator Object *() const { return obj_; } private: Object *obj_; }; struct Block { Block(Block *, size_t, size_t, Object *); ~Block(); Block *next; Object *firstObj; }; Collector(size_t maxSize); virtual ~Collector(); void *allocateObject(bool hasFinalizer); // This is called only when the constructor throws an exception. void unallocateObject(void *); void trace(const Object *obj); // Permanent objects must not be altered in such a way that // they contain pointers to non-permanent objects. void makePermanent(Object *); // Returns the number of live objects. unsigned long collect(); void makeReadOnly(Object *); bool objectMaybeLive(Object *); protected: virtual void traceStaticRoots() const { } private: Collector(const Collector &); // undefined void operator=(const Collector &); // undefined Object *freePtr_; Object allObjectsList_; // doubly-linked circular list of all objects Object permanentFinalizersList_; Object *lastTraced_; DynamicRoot dynRootList_; // doubly-linked circular list Object::Color currentColor_; Block *blocks_; unsigned long totalObjects_; size_t maxSize_; void makeSpace(); void traceDynamicRoots(); void check(); void makeReadOnly1(Object *); friend class DynamicRoot; friend class Object; }; inline void Collector::Object::moveAfter(Object *tail) { // unlink from old position next_->prev_ = prev_; prev_->next_ = next_; // link in following tail next_ = tail->next_; tail->next_->prev_ = this; prev_ = tail; tail->next_ = this; } inline void *Collector::allocateObject(bool hasFinalizer) { if (freePtr_ == &allObjectsList_) makeSpace(); Object *tem = freePtr_; freePtr_ = freePtr_->next(); tem->setColor(currentColor_); tem->hasFinalizer_ = hasFinalizer; if (hasFinalizer) tem->moveAfter(&allObjectsList_); return tem; } inline void Collector::trace(const Object *obj) { if (obj && obj->color() != currentColor_ && obj->color() != Object::permanentColor) { ((Object *)obj)->setColor(currentColor_); ((Object *)obj)->moveAfter(lastTraced_); lastTraced_ = (Object *)obj; } } inline void Collector::DynamicRoot::link(const DynamicRoot *root) { DynamicRoot *list = (DynamicRoot *)root; // link in just after list prev_ = list; next_ = list->next_; list->next_->prev_ = this; list->next_ = this; } inline void Collector::DynamicRoot::unlink() { next_->prev_ = prev_; prev_->next_ = next_; } inline Collector::DynamicRoot::DynamicRoot(Collector &c) { link(&c.dynRootList_); } inline Collector::DynamicRoot::DynamicRoot() : next_(this), prev_(this) { } inline Collector::DynamicRoot::DynamicRoot(const DynamicRoot &root) { link(&root); } inline void Collector::DynamicRoot::operator=(const DynamicRoot &root) { unlink(); link(&root); } inline Collector::ObjectDynamicRoot::ObjectDynamicRoot(Collector &c, Object *obj) : Collector::DynamicRoot(c), obj_(obj) { } inline Collector::ObjectDynamicRoot & Collector::ObjectDynamicRoot::operator=(Object *obj) { obj_ = obj; return *this; } inline void Collector::ObjectDynamicRoot::trace(Collector &c) const { c.trace(obj_); } inline Collector::Block::~Block() { ::operator delete(firstObj); } inline bool Collector::objectMaybeLive(Object *obj) { return obj->color() == currentColor_ || obj->color() == Object::permanentColor; } inline void Collector::makeReadOnly(Object *obj) { if (!obj->hasSubObjects()) obj->readOnly_ = 1; else if (!obj->readOnly()) makeReadOnly1(obj); } #endif /* not Collector_INCLUDED */ OpenJade-1.4devel/style/DssslApp.cxx0000644000021000000240000003742107067711423013156 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "DssslApp.h" #include #include "DssslAppMessages.h" #include "StyleEngine.h" #include #include #include "LocNode.h" #include "SdNode.h" #include #include #include #include #include #include #ifdef SP_HAVE_LOCALE #include #endif #ifndef OPENJADE_MESSAGE_DOMAIN #define OPENJADE_MESSAGE_DOMAIN "" #endif /* not OPENJADE_MESSAGE_DOMAIN */ #ifndef OPENJADE_LOCALE_DIR #define OPENJADE_LOCALE_DIR "" #endif /* not OPENJADE_LOCALE_DIR */ #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif /* shift a-z far enough to be outside C locale alphanumeric */ const char docOffset = 40; const char specOffset = 80; DssslApp::DssslApp(int unitsPerInch) : GroveApp("unicode"), unitsPerInch_(unitsPerInch), dssslSpecOption_(0), debugMode_(0), dsssl2_(0), strictMode_(0), specTitleOption_(0), fotbDescr_(0), fotb_(0), se_(0) { registerOption('2', 0, DssslAppMessages::help2); registerOption('G', SP_T("debug"), DssslAppMessages::GHelp); registerOption('d', SP_T("specification"), DssslAppMessages::sysid, DssslAppMessages::dHelp); registerOption('V', SP_T("define"), DssslAppMessages::vardef, DssslAppMessages::VHelp); registerOption('s', SP_T("strict"), DssslAppMessages::sHelp); registerOption('T', SP_T("spec-title"), DssslAppMessages::name, DssslAppMessages::THelp); registerOption('e' + docOffset, SP_T("doc-open-entities"), DssslAppMessages::eHelp); registerOption('g' + docOffset, SP_T("doc-open-elements"), DssslAppMessages::gHelp); registerOption('n' + docOffset, SP_T("doc-error-numbers"), DssslAppMessages::nHelp); registerOption('x' + docOffset, SP_T("doc-references"), DssslAppMessages::xHelp); registerOption('i' + docOffset, SP_T("doc-include"), DssslAppMessages::name, DssslAppMessages::iHelp); registerOption('w' + docOffset, SP_T("doc-warning"), DssslAppMessages::type, DssslAppMessages::wHelp); registerOption('e' + specOffset, SP_T("spec-open-entities"), DssslAppMessages::eHelp); registerOption('g' + specOffset, SP_T("spec-open-elements"), DssslAppMessages::gHelp); registerOption('n' + specOffset, SP_T("spec-error-numbers"), DssslAppMessages::nHelp); registerOption('x' + specOffset, SP_T("spec-references"), DssslAppMessages::xHelp); registerOption('i' + specOffset, SP_T("spec-include"), DssslAppMessages::name, DssslAppMessages::iHelp); registerOption('w' + specOffset, SP_T("spec-warning"), DssslAppMessages::type, DssslAppMessages::wHelp); registerInfo(DssslAppMessages::prefixInfo, 1); } int DssslApp::init(int argc, AppChar **argv) { int ret = GroveApp::init(argc, argv); #ifdef SP_HAVE_LOCALE // Since we use strtod(), must have C numeric setlocale(LC_NUMERIC, "C"); #endif MessageTable::instance()->registerMessageDomain(MessageFragment::xModule, OPENJADE_MESSAGE_DOMAIN, OPENJADE_LOCALE_DIR); return ret; } int DssslApp::processSysid(const StringC &sysid) { rootSystemId_ = sysid; ParsedSystemId v; if (!entityManager()->parseSystemId(sysid, systemCharset(), 0, 0, *this, v)) return 0; for (size_t i = v.size(); i > 0; i--) if (v[i - 1].storageManager->inheritable()) { ParsedSystemId specId; specId.resize(1); StorageObjectSpec &spec = specId[0]; spec = v[i - 1]; StringC &s = spec.specId; // replace an up to 5 character extension with .dsl for (size_t j = 0; j < 5; j++) { if (s.size() < j + 1) break; if (s[s.size() - j - 1] == '.') { s.resize(s.size() - j - 1); break; } } if (strcmp(v[i - 1].storageManager->type(), "OSFILE") == 0) defaultOutputBasename_ = s; if (!dssslSpecOption_) { static const Char ext[] = { '.', 'd', 's', 'l' }; s.append(ext, SIZEOF(ext)); specId.unparse(systemCharset(), 0, dssslSpecSysid_); } break; } int ret = 1; fotb_ = makeFOTBuilder(fotbDescr_); if (fotb_) { if (initSpecParser()) { se_ = new StyleEngine(*this, *this, unitsPerInch_, debugMode_, dsssl2_, strictMode_, *fotbDescr_, outputCodingSystem()); se_->parseSpec(specParser_, systemCharset(), dssslSpecId_, *this, defineVars_); ret = GroveApp::processSysid(sysid); delete se_; } delete fotb_; } return ret; } void DssslApp::processOption(AppChar opt, const AppChar *arg) { switch (opt) { case AppChar('e' + docOffset): case AppChar('g' + docOffset): case AppChar('n' + docOffset): case AppChar('x' + docOffset): case AppChar('i' + docOffset): case AppChar('w' + docOffset): GroveApp::processOption(opt - docOffset, arg); break; case AppChar('e' + specOffset): case AppChar('g' + specOffset): case AppChar('n' + specOffset): case AppChar('x' + specOffset): case AppChar('i' + specOffset): case AppChar('w' + specOffset): docOptions_ = options_; options_ = specOptions_; GroveApp::processOption(opt - specOffset, arg); specOptions_ = options_; options_ = docOptions_; break; case 'e': case 'g': case 'n': case 'x': case 'i': case 'w': processOption(opt + docOffset, arg); processOption(opt + specOffset, arg); break; case 'G': debugMode_ = 1; break; case '2': dsssl2_ = 1; break; case 'd': dssslSpecId_.resize(0); dssslSpecSysid_ = convertInput(arg); dssslSpecOption_ = 1; splitOffId(dssslSpecSysid_, dssslSpecId_); break; case 'T': specTitleOption_ = 1; specTitle_ = convertInput(arg); break; case 'V': defineVars_.push_back(convertInput(arg)); break; case 's': strictMode_ = 1; break; case 'v': message(DssslAppMessages::versionInfo, StringMessageArg(convertInput(SP_T(OPENJADE_PACKAGE))), StringMessageArg(convertInput(SP_T(OPENJADE_VERSION)))); // fall through default: GroveApp::processOption(opt, arg); } } void DssslApp::splitOffId(StringC &sysid, StringC &id) { id.resize(0); for (size_t i = sysid.size(); i > 0; i--) { if (sysid[i - 1] == '#') { id.assign(sysid.data() + i, sysid.size() - i); sysid.resize(i - 1); break; } } } int DssslApp::generateEvents(ErrorCountEventHandler *eceh) { groveTable_.insert(rootSystemId_, rootNode_); // Since the thread parsing the DSSSL spec is a different thread // from the thread parsing the document, we can't share an // entity manager. // The document parser has already been inited and so will // use the current entity manager. // The spec parser hasn't yet been inited and so will use // a new entity manager. // The parser thread is started in GroveApp::generateEvents // which hasn't happened yet. clearEntityManager(); return GroveApp::generateEvents(eceh); } class PrologPiEventHandler : public ErrorCountEventHandler { public: PrologPiEventHandler(DssslApp &app); void pi(PiEvent *); void endProlog(EndPrologEvent *); Boolean gotSpec() { return gotSpec_; } private: DssslApp *app_; Boolean gotSpec_; }; PrologPiEventHandler::PrologPiEventHandler(DssslApp &app) : app_(&app), gotSpec_(0) { } void PrologPiEventHandler::pi(PiEvent *event) { if (app_->getDssslSpecFromPi(event->data(), event->dataLength(), event->location())) { gotSpec_ = 1; cancel(); } delete event; } void PrologPiEventHandler::endProlog(EndPrologEvent *event) { cancel(); delete event; } Boolean DssslApp::getDssslSpecFromProlog() { initParser(rootSystemId_); PrologPiEventHandler eh(*this); parser_.parseAll(eh, eh.cancelPtr()); return eh.gotSpec(); } Boolean DssslApp::getDssslSpecFromPi(const Char *s, size_t n, const Location &loc) { static struct { const char *key; Boolean (DssslApp::*handler)(const Char *s, size_t, const Location &); } pis[] = { { "xml-stylesheet", &DssslApp::handleAttlistPi }, { "xml:stylesheet", &DssslApp::handleAttlistPi }, { "stylesheet", &DssslApp::handleAttlistPi }, { "dsssl", &DssslApp::handleSimplePi }, }; for (size_t i = 0; i < SIZEOF(pis); i++) { size_t len = strlen(pis[i].key); if (n >= len && matchCi(s, len, pis[i].key) && (n == len || isS(s[len]))) { s += len; n -= len; return (this->*pis[i].handler)(s, n, loc); } } return 0; } Boolean DssslApp::handleSimplePi(const Char *s, size_t n, const Location &loc) { skipS(s, n); if (n == 0) return 0; StringC sysid(s, n); splitOffId(sysid, dssslSpecId_); return entityManager()->expandSystemId(sysid, loc, 0, systemCharset(), 0, *this, dssslSpecSysid_); } Boolean DssslApp::handleAttlistPi(const Char *s, size_t n, const Location &loc) { // FIXME maybe give warnings if syntax is wrong Boolean hadHref = 0; StringC href; Boolean hadTitle = 0; Boolean isDsssl = 0; Boolean isAlternate = 0; StringC name; StringC value; while (getAttribute(s, n, name, value)) { if (matchCi(name, "type")) { static const char *types[] = { "text/dsssl", "text/x-dsssl", "application/dsssl", "application/x-dsssl" }; for (size_t i = 0; i < SIZEOF(types); i++) if (matchCi(value, types[i])) { isDsssl = 1; break; } if (!isDsssl) return 0; } else if (matchCi(name, "href")) { hadHref = 1; value.swap(href); } else if (matchCi(name, "title")) { if (specTitleOption_ && specTitle_ != value) { availableSpecTitles_.push_back(value); return 0; } hadTitle = 1; } else if (matchCi(name, "alternate")) { isAlternate = matchCi(value, "yes"); } else if (matchCi(name, "media")) { /* There is no point in doing detailed comparisons if either the stylesheet is suitable for all media types or the backend handles all media types. This doesn't work for redundant values like "all, screen". */ Boolean match = matchCi(value, "all") || (fotbDescr_->media[0] == 0); const Char *c = value.data(); const Char *end = c + value.size(); while (c < end && !match) { while (c < end && isS(*c)) c++; for (int i = 0; fotbDescr_->media[i] && !match; i++) { match = 1; const Char *d; const char *d1; for (d = c, d1 = fotbDescr_->media[i];; d++, d1++) { if (d == end) { match = (*d1 == '\0'); break; } if (*d1 == '\0') { /* This is not entirely correct. We should check that *d is outside of [a-zA-Z0-9-]. */ match = (*d == Char(' ') || *d == Char(',')); break; } if (*d != Char(*d1)) { match = 0; break; } } } while (c < end && *c != Char(',')) c++; c++; } if (!match) return 0; } } // PI doesn't contain useful information if (!isDsssl || !hadHref) return 0; // if (!(specTitleOption_ && hadTitle) && isAlternate && dssslSpecSysid_.size() > 0) return 0; splitOffId(href, dssslSpecId_); // FIXME should use location of attribute value rather than location of PI return entityManager()->expandSystemId(href, loc, 0, systemCharset(), 0, *this, dssslSpecSysid_) && ((specTitleOption_ && hadTitle) || !isAlternate); } void DssslApp::skipS(const Char *&s, size_t &n) { while (n > 0 && isS(*s)) s++, n--; } Boolean DssslApp::isS(Char c) { return c <= CHAR_MAX && isspace((unsigned char)c); } Boolean DssslApp::matchCi(const StringC &s, const char *key) { return matchCi(s.data(), s.size(), key); } Boolean DssslApp::matchCi(const Char *s, size_t n, const char *key) { for (; *key; key++, s++, n--) { if (!n) return 0; if (*s != tolower(*key) && *s != toupper(*key)) return 0; } return n == 0; } Boolean DssslApp::getAttribute(const Char *&s, size_t &n, StringC &name, StringC &value) { name.resize(0); value.resize(0); skipS(s, n); for (;;) { if (n == 0) return 0; if (*s == '=' || isS(*s)) break; name += *s; s++, n--; } skipS(s, n); if (n == 0 || *s != '=') return 0; s++, n--; skipS(s, n); Char quote = 0; if (n > 0 && (*s == '"' || *s == '\'')) { quote = *s; s++, n--; } for (;;) { if (n == 0) { if (quote) return 0; break; } if (quote) { if (*s == quote) { s++, n--; break; } } else if (isS(*s)) break; value += *s; s++, n--; } // FIXME resolve numeric character references return 1; } Boolean DssslApp::initSpecParser() { if (!dssslSpecOption_ && !getDssslSpecFromProlog()) { if (specTitleOption_ && availableSpecTitles_.size() > 0) message(DssslAppMessages::noSpecTitle, StringMessageArg(specTitle_), StringVectorMessageArg(availableSpecTitles_)); if (dssslSpecSysid_.size() == 0) { message(DssslAppMessages::noSpec); return 0; } } SgmlParser::Params params; params.sysid = dssslSpecSysid_; params.entityManager = entityManager().pointer(); params.options = &specOptions_; specParser_.init(params); specParser_.allLinkTypesActivated(); return 1; } void DssslApp::processGrove() { se_->process(rootNode_, *fotb_); } bool DssslApp::load(const StringC &sysid, const Vector &active, const NodePtr &parent, NodePtr &rootNode, const Vector &architecture) { SgmlParser::Params params; params.sysid = sysid; const NodePtr *ndp = groveTable_.lookup(params.sysid); if (ndp) { rootNode = *ndp; return 1; } ErrorCountEventHandler *eceh; const SdNode *sdNode; NodePtr parentRoot; if (parent && parent->getGroveRoot(parentRoot) == accessOK && (sdNode = SdNode::convert(parentRoot)) != 0 && sdNode->getSd(params.sd, params.prologSyntax, params.instanceSyntax) == accessOK) { params.entityType = SgmlParser::Params::subdoc; eceh = GroveBuilder::make(groveTable_.count() + 1, this, this, 0, params.sd, params.prologSyntax, params.instanceSyntax, rootNode); } else eceh = GroveBuilder::make(groveTable_.count() + 1, this, this, 0, rootNode); Owner eh(eceh); groveTable_.insert(params.sysid, rootNode); params.entityManager = entityManager().pointer(); params.options = &options_; SgmlParser parser; parser.init(params); for (size_t i = 0; i < active.size(); i++) parser.activateLinkType(active[i]); parser.allLinkTypesActivated(); if (architecture.size() > 0) { SelectOneArcDirector director(architecture, *eh); ArcEngine::parseAll(parser, director, director, eceh->cancelPtr()); } else parser.parseAll(*eh, eceh->cancelPtr()); return 1; } void DssslApp::mapSysid(StringC &id) { // find the sysid for id by looking through the catalogs. ConstPtr catalog(entityManager()->makeCatalog(id, systemCharset(), *this)); catalog->lookupPublic(id, systemCharset(), *this, id); } bool DssslApp::readEntity(const StringC &sysid, StringC &contents) { Owner in(entityManager()->open(sysid, systemCharset(), InputSourceOrigin::make(), 0, *this)); if (!in) return 0; for (;;) { Xchar c = in->get(*this); if (c == InputSource::eE) break; in->extendToBufferEnd(); contents.append(in->currentTokenStart(), in->currentTokenLength()); } return !in->accessError(); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/DssslApp.h0000644000021000000240000000443007067704136012600 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #ifndef DssslApp_INCLUDED #define DssslApp_INCLUDED 1 #include "GroveApp.h" #include "FOTBuilder.h" #include "GroveManager.h" #include "dsssl_ns.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class StyleEngine; class STYLE_API DssslApp : public GroveApp, public GroveManager { public: DssslApp(int unitsPerInch); virtual FOTBuilder *makeFOTBuilder(const FOTBuilder::Description *&) = 0; int processSysid(const StringC &); bool load(const StringC &sysid, const Vector &active, const NodePtr &parent, NodePtr &rootNode, const Vector &architecture); bool readEntity(const StringC &, StringC &); void mapSysid(StringC &); protected: void processOption(AppChar opt, const AppChar *arg); int init(int argc, AppChar **argv); int unitsPerInch_; StringC defaultOutputBasename_; private: void processGrove(); int generateEvents(ErrorCountEventHandler *eceh); Boolean getDssslSpecFromProlog(); Boolean getDssslSpecFromPi(const Char *s, size_t n, const Location &loc); static void splitOffId(StringC &, StringC &); Boolean handleSimplePi(const Char *, size_t, const Location &); Boolean handleAttlistPi(const Char *, size_t, const Location &); static void skipS(const Char *&s, size_t &n); static Boolean isS(Char c); static Boolean matchCi(const StringC &s, const char *key); static Boolean matchCi(const Char *s, size_t n, const char *key); static Boolean getAttribute(const Char *&s, size_t &n, StringC &name, StringC &value); Boolean initSpecParser(); Boolean dssslSpecOption_; StringC dssslSpecSysid_; // system ID of doc StringC dssslSpecId_; // unique ID in doc // Variables to be defined as true Vector defineVars_; SgmlParser specParser_; HashTable groveTable_; StringC rootSystemId_; bool debugMode_; bool dsssl2_; bool strictMode_; ParserOptions docOptions_; ParserOptions specOptions_; friend class PrologPiEventHandler; const FOTBuilder::Description *fotbDescr_; Boolean specTitleOption_; StringC specTitle_; Vector availableSpecTitles_; FOTBuilder *fotb_; StyleEngine *se_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not DssslApp_INCLUDED */ OpenJade-1.4devel/style/DssslAppMessages.h0000444000021000000240000001051507067713003014260 // This file was automatically generated from DssslAppMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct DssslAppMessages { // 2000 static const MessageType2 versionInfo; // 2001 static const MessageType0 noSpec; // 2002 static const MessageType2 noSpecTitle; // 2003 static const MessageType1 prefixInfo; // 2004 static const MessageType1 help2; // 2005 static const MessageType1 GHelp; // 2006 static const MessageType1 dHelp; // 2007 static const MessageType1 THelp; // 2008 static const MessageType1 VHelp; // 2009 static const MessageType1 sHelp; // 2010 static const MessageType1 eHelp; // 2011 static const MessageType1 gHelp; // 2012 static const MessageType1 nHelp; // 2013 static const MessageType1 xHelp; // 2014 static const MessageType1 iHelp; // 2015 static const MessageType1 wHelp; // 2016 static const MessageFragment sysid; // 2017 static const MessageFragment vardef; // 2018 static const MessageFragment name; // 2019 static const MessageFragment type; }; const MessageType2 DssslAppMessages::versionInfo( MessageType::info, MessageFragment::xModule, 2000 #ifndef SP_NO_MESSAGE_TEXT ,"%1 version %2" #endif ); const MessageType0 DssslAppMessages::noSpec( MessageType::error, MessageFragment::xModule, 2001 #ifndef SP_NO_MESSAGE_TEXT ,"no DSSSL specification: use -d to specify" #endif ); const MessageType2 DssslAppMessages::noSpecTitle( MessageType::error, MessageFragment::xModule, 2002 #ifndef SP_NO_MESSAGE_TEXT ,"no applicable processing instruction with title %1; available titles: %2" #endif ); const MessageType1 DssslAppMessages::prefixInfo( MessageType::info, MessageFragment::xModule, 2003 #ifndef SP_NO_MESSAGE_TEXT ,"Options with a \"doc-\"/\"spec-\" prefix apply only to the document/specification." #endif ); const MessageType1 DssslAppMessages::help2( MessageType::info, MessageFragment::xModule, 2004 #ifndef SP_NO_MESSAGE_TEXT ,"Enable experimental DSSSL extensions." #endif ); const MessageType1 DssslAppMessages::GHelp( MessageType::info, MessageFragment::xModule, 2005 #ifndef SP_NO_MESSAGE_TEXT ,"Debug mode." #endif ); const MessageType1 DssslAppMessages::dHelp( MessageType::info, MessageFragment::xModule, 2006 #ifndef SP_NO_MESSAGE_TEXT ,"Use DSSSL specification %1." #endif ); const MessageType1 DssslAppMessages::THelp( MessageType::info, MessageFragment::xModule, 2007 #ifndef SP_NO_MESSAGE_TEXT ,"Use DSSSL specification with title %1." #endif ); const MessageType1 DssslAppMessages::VHelp( MessageType::info, MessageFragment::xModule, 2008 #ifndef SP_NO_MESSAGE_TEXT ,"Pretend that %1 appeared in the specification." #endif ); const MessageType1 DssslAppMessages::sHelp( MessageType::info, MessageFragment::xModule, 2009 #ifndef SP_NO_MESSAGE_TEXT ,"Strict DSSSL compliance mode." #endif ); const MessageType1 DssslAppMessages::eHelp( MessageType::info, MessageFragment::xModule, 2010 #ifndef SP_NO_MESSAGE_TEXT ,"Show open entities in error messages." #endif ); const MessageType1 DssslAppMessages::gHelp( MessageType::info, MessageFragment::xModule, 2011 #ifndef SP_NO_MESSAGE_TEXT ,"Show open elements in error messages." #endif ); const MessageType1 DssslAppMessages::nHelp( MessageType::info, MessageFragment::xModule, 2012 #ifndef SP_NO_MESSAGE_TEXT ,"Show error numbers in error messages." #endif ); const MessageType1 DssslAppMessages::xHelp( MessageType::info, MessageFragment::xModule, 2013 #ifndef SP_NO_MESSAGE_TEXT ,"Show references in error messages." #endif ); const MessageType1 DssslAppMessages::iHelp( MessageType::info, MessageFragment::xModule, 2014 #ifndef SP_NO_MESSAGE_TEXT ,"Define parameter entity %1 as \"INCLUDE\"." #endif ); const MessageType1 DssslAppMessages::wHelp( MessageType::info, MessageFragment::xModule, 2015 #ifndef SP_NO_MESSAGE_TEXT ,"Enable warning %1." #endif ); const MessageFragment DssslAppMessages::sysid( MessageFragment::xModule, 2016 #ifndef SP_NO_MESSAGE_TEXT ,"SYSID" #endif ); const MessageFragment DssslAppMessages::vardef( MessageFragment::xModule, 2017 #ifndef SP_NO_MESSAGE_TEXT ,"DEFINITION" #endif ); const MessageFragment DssslAppMessages::name( MessageFragment::xModule, 2018 #ifndef SP_NO_MESSAGE_TEXT ,"NAME" #endif ); const MessageFragment DssslAppMessages::type( MessageFragment::xModule, 2019 #ifndef SP_NO_MESSAGE_TEXT ,"TYPE" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/style/DssslSpecEventHandler.cxx0000644000021000000240000004346607067706542015644 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "DssslSpecEventHandler.h" #include "InterpreterMessages.h" #include #include "FOTBuilder.h" #include #include "Node.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif // FIXME Stop parsing spec when we know we don't we have everything we ever need class TextInputSourceOrigin : public InputSourceOrigin { public: TextInputSourceOrigin(Text &text); Boolean defLocation(Offset off, const Origin *&, Index &) const; const Text &text() const { return text_; } void noteCharRef(Index, const NamedCharRef &); void setExternalInfo(ExternalInfo *); InputSourceOrigin *copy() const; const Location &parent() const; private: Text text_; Location refLocation_; }; DssslSpecEventHandler::DssslSpecEventHandler(Messenger &mgr) : mgr_(&mgr), gatheringBody_(0), currentPart_(0), currentDoc_(0), currentDecl_(0) { } void DssslSpecEventHandler::load(SgmlParser &specParser, const CharsetInfo &charset, const StringC &id, Vector &parts) { parser_ = &specParser; charset_ = &charset; Doc *doc = findDoc(StringC()); // Load it now so that we can get the concrete syntax. doc->load(*this); Part *tem; if (id.size() == 0) tem = doc->resolveFirstPart(*this); else { StringC normId(id); ConstPtr syn = parser_->instanceSyntax(); if (!syn.isNull()) syn->generalSubstTable()->subst(normId); tem = doc->refPart(normId)->resolve(*this); } if (tem && tem->partial()) mgr_->message(InterpreterMessages::partialSpec); resolveParts(tem, parts); } DssslSpecEventHandler::Doc *DssslSpecEventHandler::findDoc(const StringC &sysid) { for (IListIter iter(docs_); !iter.done(); iter.next()) if (sysid == iter.cur()->sysid()) return iter.cur(); Doc *doc = new Doc(sysid); docs_.insert(doc); return doc; } void DssslSpecEventHandler::resolveParts(Part *part, Vector &parts) { if (!part) return; if (parts.size() > 0 && parts[0]->style() != part->style()) { mgr_->message(InterpreterMessages::mixedLanguages); return; } parts.push_back(part); if (part->setMark()) { mgr_->message(InterpreterMessages::useLoop); return; } const Vector &use = part->use(); for (size_t i = 0; i < use.size(); i++) { Part *tem = use[i]->resolve(*this); resolveParts(tem, parts); } part->setMark(0); } void DssslSpecEventHandler::loadDoc(SgmlParser &parser, Doc &doc) { currentDoc_ = &doc; gotArc_ = 0; ArcEngine::parseAll(parser, *mgr_, *this, cancelPtr()); if (!gotArc_) { mgr_->message(InterpreterMessages::specNotArc); return; } } EventHandler * DssslSpecEventHandler::arcEventHandler(const Notation *notation, const Vector &, const SubstTable *) { if (!notation) return 0; const StringC *pubid = notation->externalId().publicIdString(); static const char dssslArc[] = "ISO/IEC 10179:1996//NOTATION DSSSL Architecture Definition Document//EN"; if (pubid == 0 || pubid->size() != sizeof(dssslArc) - 1) return 0; for (int i = 0; dssslArc[i] != '\0'; i++) { if (dssslArc[i] != (*pubid)[i]) return 0; } gotArc_ = 1; return this; } void DssslSpecEventHandler::message(MessageEvent *event) { mgr_->dispatchMessage(event->message()); delete event; } static struct { const char *gi; void (DssslSpecEventHandler::*start)(const StartElementEvent &); void (DssslSpecEventHandler::*end)(const EndElementEvent &); } mappingTable[] = { { "STYLE-SPECIFICATION", &DssslSpecEventHandler::styleSpecificationStart, &DssslSpecEventHandler::specificationEnd }, { "STYLE-SPECIFICATION-BODY", &DssslSpecEventHandler::specificationBodyStart, &DssslSpecEventHandler::specificationBodyEnd }, { "TRANSFORMATION-SPECIFICATION", &DssslSpecEventHandler::transformSpecificationStart, &DssslSpecEventHandler::specificationEnd }, { "TRANSFORMATION-SPECIFICATION-BODY", &DssslSpecEventHandler::specificationBodyStart, &DssslSpecEventHandler::specificationBodyEnd }, { "EXTERNAL-SPECIFICATION", &DssslSpecEventHandler::externalSpecificationStart, &DssslSpecEventHandler::externalSpecificationEnd }, { "FEATURES", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "BASESET-ENCODING", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "LITERAL-DESCRIBED-CHAR", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "ADD-NAME-CHARS", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "ADD-SEPARATOR-CHARS", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "STANDARD-CHARS", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "OTHER-CHARS", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "COMBINE-CHAR", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "MAP-SDATA-ENTITY", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "CHAR-REPERTOIRE", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, { "SGML-GROVE-PLAN", &DssslSpecEventHandler::declarationStart, &DssslSpecEventHandler::declarationEnd }, }; void DssslSpecEventHandler::endProlog(EndPrologEvent *event) { currentDoc_->setLocation(event->location()); delete event; } void DssslSpecEventHandler::startElement(StartElementEvent *event) { for (size_t i = 0; i < SIZEOF(mappingTable); i++) if (event->name() == mappingTable[i].gi) { (this->*(mappingTable[i].start))(*event); break; } delete event; } void DssslSpecEventHandler::endElement(EndElementEvent *event) { for (size_t i = 0; i < SIZEOF(mappingTable); i++) if (event->name() == mappingTable[i].gi) { (this->*(mappingTable[i].end))(*event); break; } delete event; } void DssslSpecEventHandler::data(DataEvent *event) { if (gatheringBody_) currentBody_.addChars(event->data(), event->dataLength(), event->location()); delete event; } const Text * DssslSpecEventHandler::attributeText(const StartElementEvent &event, const char *attName) { const AttributeList &atts = event.attributes(); StringC attNameString; for (const char *p = attName; *p; p++) attNameString += Char(*p); unsigned index; if (atts.attributeIndex(attNameString, index)) { const AttributeValue *val = atts.value(index); if (val) return val->text(); } return 0; } const StringC * DssslSpecEventHandler::attributeString(const StartElementEvent &event, const char *attName) { const Text *text = attributeText(event, attName); if (text) return &text->string(); else return 0; } ConstPtr DssslSpecEventHandler::attributeEntity(const StartElementEvent &event, const char *attName) { const AttributeList &atts = event.attributes(); StringC attNameString; for (const char *p = attName; *p; p++) attNameString += Char(*p); unsigned index; if (!atts.attributeIndex(attNameString, index)) return 0; const AttributeSemantics *sem = atts.semantics(index); if (!sem || sem->nEntities() != 1) return 0; return sem->entity(0); } void DssslSpecEventHandler::externalSpecificationStart(const StartElementEvent &event) { StringC empty; const StringC *idP = attributeString(event, "ID"); if (!idP) idP = ∅ PartHeader *header = currentDoc_->refPart(*idP); const Entity *ent = attributeEntity(event, "DOCUMENT").pointer(); if (!ent) return; const ExternalEntity *ext = ent->asExternalEntity(); if (!ext) return; const StringC &sysid = ext->externalId().effectiveSystemId(); if (sysid.size()) { Doc *doc = findDoc(sysid); const StringC *specidP = attributeString(event, "SPECID"); if (!specidP) header->setPart(new ExternalFirstPart(doc)); else header->setPart(new ExternalPart(doc->refPart(*specidP, event.location()))); } } void DssslSpecEventHandler::externalSpecificationEnd(const EndElementEvent &) { // nothing to do } void DssslSpecEventHandler::styleSpecificationStart(const StartElementEvent &event) { specificationStart(event, 1); } void DssslSpecEventHandler::transformSpecificationStart(const StartElementEvent &event) { specificationStart(event, 0); } void DssslSpecEventHandler::specificationStart(const StartElementEvent &event, bool isStyle) { StringC empty; const StringC *idP = attributeString(event, "ID"); if (!idP) idP = ∅ PartHeader *header = currentDoc_->refPart(*idP); // FIXME give an error (or ignore) if header has part already const Text *useP = attributeText(event, "USE"); const StringC *partialP = attributeString(event, "PARTIAL"); bool isPartial = (partialP && *partialP == "PARTIAL"); header->setPart(currentPart_ = new Part(currentDoc_, isPartial, isStyle)); if (useP) { const StringC &use = useP->string(); size_t i = 0; for (;;) { size_t j; for (j = i; j < use.size() && use[j] != ' '; j++) ; if (j > i) currentPart_->addUse(currentDoc_->refPart(StringC(use.data() + i, j - i), useP->charLocation(i))); if (j >= use.size()) break; i = j + 1; } } } void DssslSpecEventHandler::specificationEnd(const EndElementEvent &event) { currentPart_ = 0; } void DssslSpecEventHandler::specificationBodyStart(const StartElementEvent &event) { if (currentPart_) { currentBody_.clear(); ConstPtr entity = attributeEntity(event, "CONTENT"); if (entity.isNull()) gatheringBody_ = 1; else currentPart_->append(new EntityBodyElement(entity)); } } void DssslSpecEventHandler::specificationBodyEnd(const EndElementEvent &event) { if (gatheringBody_) { if (currentPart_) currentPart_->append(new ImmediateBodyElement(currentBody_)); gatheringBody_ = 0; } } void DssslSpecEventHandler::declarationStart(const StartElementEvent &event) { if (currentPart_ || currentDoc_) { currentBody_.clear(); gatheringBody_ = 1; DssslSpecEventHandler::DeclarationElement::Type type; if (event.name() == "FEATURES") type = DssslSpecEventHandler::DeclarationElement::features; else if (event.name() == "BASESET-ENCODING") type = DssslSpecEventHandler::DeclarationElement::basesetEncoding; else if (event.name() == "LITERAL-DESCRIBED-CHAR") type = DssslSpecEventHandler::DeclarationElement::literalDescribedChar; else if (event.name() == "ADD-NAME-CHARS") type = DssslSpecEventHandler::DeclarationElement::addNameChars; else if (event.name() == "ADD-SEPARATOR-CHARS") type = DssslSpecEventHandler::DeclarationElement::addSeparatorChars; else if (event.name() == "STANDARD-CHARS") type = DssslSpecEventHandler::DeclarationElement::standardChars; else if (event.name() == "OTHER-CHARS") type = DssslSpecEventHandler::DeclarationElement::otherChars; else if (event.name() == "COMBINE-CHAR") type = DssslSpecEventHandler::DeclarationElement::combineChar; else if (event.name() == "MAP-SDATA-ENTITY") type = DssslSpecEventHandler::DeclarationElement::mapSdataEntity; else if (event.name() == "CHAR-REPERTOIRE") type = DssslSpecEventHandler::DeclarationElement::charRepertoire; else if (event.name() == "SGML-GROVE-PLAN") type = DssslSpecEventHandler::DeclarationElement::sgmlGrovePlan; currentDecl_ = new DeclarationElement(type); const StringC *str; if (str = attributeString(event, "NAME")) currentDecl_->setName(*str); if (str = attributeString(event, "TEXT")) currentDecl_->setText(*str); if (str = attributeString(event, "MODADD")) currentDecl_->setModadd(*str); if (str = attributeString(event, "DESC")) currentDecl_->setDesc(*str); } } void DssslSpecEventHandler::declarationEnd(const EndElementEvent &event) { if (gatheringBody_ && currentDecl_) { currentDecl_->setContent(currentBody_); if (currentPart_) currentPart_->append(currentDecl_); else currentDoc_->append(currentDecl_); gatheringBody_ = 0; currentDecl_ = 0; } } TextInputSourceOrigin::TextInputSourceOrigin(Text &text) { text_.swap(text); } Boolean TextInputSourceOrigin::defLocation(Offset off, const Origin *&origin, Index &index) const { return text_.charLocation(off, origin, index); } void TextInputSourceOrigin::noteCharRef(Index, const NamedCharRef &) { CANNOT_HAPPEN(); } void TextInputSourceOrigin::setExternalInfo(ExternalInfo *) { CANNOT_HAPPEN(); } InputSourceOrigin *TextInputSourceOrigin::copy() const { return new TextInputSourceOrigin(*this); } const Location &TextInputSourceOrigin::parent() const { return refLocation_; } DssslSpecEventHandler::Doc::Doc() : loaded_(0) { } DssslSpecEventHandler::Doc::Doc(const StringC &sysid) : sysid_(sysid), loaded_(0) { } void DssslSpecEventHandler::Doc::setLocation(const Location &loc) { loc_ = loc; } DssslSpecEventHandler::Part * DssslSpecEventHandler::Doc::resolveFirstPart(DssslSpecEventHandler &eh) { load(eh); PartHeader *header = 0; for (IListIter iter(headers_); !iter.done(); iter.next()) header = iter.cur(); if (!header) { if (!loc_.origin().isNull()) { eh.mgr_->setNextLocation(loc_); eh.mgr_->message(InterpreterMessages::noParts); } return 0; } return header->resolve(eh); } void DssslSpecEventHandler::Doc::load(DssslSpecEventHandler &eh) { if (loaded_) return; loaded_ = 1; if (sysid_.size() > 0) { SgmlParser::Params params; params.parent = eh.parser_; params.sysid = sysid_; SgmlParser specParser(params); eh.loadDoc(specParser, *this); } else eh.loadDoc(*eh.parser_, *this); } DssslSpecEventHandler::PartHeader * DssslSpecEventHandler::Doc::refPart(const StringC &id) { for (IListIter iter(headers_); !iter.done(); iter.next()) if (iter.cur()->id() == id) return iter.cur(); PartHeader *header = new PartHeader(this, id); headers_.insert(header); return header; } DssslSpecEventHandler::PartHeader * DssslSpecEventHandler::Doc::refPart(const StringC &id, const Location &refLoc) { PartHeader *header = refPart(id); header->setRefLoc(refLoc); return header; } void DssslSpecEventHandler::Doc::append(DeclarationElement *decl) { declarations_.append(decl); } DssslSpecEventHandler::BodyElement::~BodyElement() { } DssslSpecEventHandler::ImmediateBodyElement::ImmediateBodyElement(Text &text) { text_.swap(text); } void DssslSpecEventHandler ::ImmediateBodyElement::makeInputSource(DssslSpecEventHandler &, Owner &in) { TextInputSourceOrigin *origin = new TextInputSourceOrigin(text_); in = new InternalInputSource(origin->text().string(), origin); } DssslSpecEventHandler::DeclarationElement::DeclarationElement(Type type) : type_(type) { } void DssslSpecEventHandler ::DeclarationElement::setContent(Text &content) { content_.swap(content); } void DssslSpecEventHandler ::DeclarationElement::makeInputSource(DssslSpecEventHandler &, Owner &in) { TextInputSourceOrigin *origin = new TextInputSourceOrigin(content_); in = new InternalInputSource(origin->text().string(), origin); } DssslSpecEventHandler::DeclarationElement::Type DssslSpecEventHandler::DeclarationElement::type() const { return type_; } DssslSpecEventHandler ::EntityBodyElement::EntityBodyElement(const ConstPtr &entity) : entity_(entity) { } void DssslSpecEventHandler ::EntityBodyElement::makeInputSource(DssslSpecEventHandler &eh, Owner &in) { const InternalEntity *internal = entity_->asInternalEntity(); if (internal) { in = new InternalInputSource(internal->string(), EntityOrigin::make(entity_, Location())); return; } const StringC &sysid = entity_->asExternalEntity()->externalId().effectiveSystemId(); if (sysid.size()) in = eh.parser_->entityManager().open(sysid, *eh.charset_, InputSourceOrigin::make(), 0, *eh.mgr_); } DssslSpecEventHandler::PartHeader::PartHeader(Doc *doc, const StringC &id) : doc_(doc), id_(id) { } void DssslSpecEventHandler::PartHeader::setRefLoc(const Location &loc) { if (refLoc_.origin().isNull()) refLoc_ = loc; } DssslSpecEventHandler::Part * DssslSpecEventHandler::PartHeader::resolve(DssslSpecEventHandler &eh) { doc_->load(eh); if (!specPart_) { eh.mgr_->setNextLocation(refLoc_); eh.mgr_->message(InterpreterMessages::missingPart, StringMessageArg(id_)); return 0; } return specPart_->resolve(eh); } DssslSpecEventHandler::SpecPart::~SpecPart() { } DssslSpecEventHandler::ExternalPart::ExternalPart(PartHeader *header) : header_(header) { } DssslSpecEventHandler::Part * DssslSpecEventHandler::ExternalPart::resolve(DssslSpecEventHandler &eh) { return header_->resolve(eh); } DssslSpecEventHandler::ExternalFirstPart::ExternalFirstPart(Doc *doc) : doc_(doc) { } DssslSpecEventHandler::Part * DssslSpecEventHandler::ExternalFirstPart::resolve(DssslSpecEventHandler &eh) { return doc_->resolveFirstPart(eh); } DssslSpecEventHandler::Part::Part(Doc *doc, bool partial, bool style) : mark_(0), doc_(doc), partial_(partial), style_(style) { } bool DssslSpecEventHandler::Part::partial() { return partial_; } bool DssslSpecEventHandler::Part::style() { return style_; } DssslSpecEventHandler::Part * DssslSpecEventHandler::Part::resolve(DssslSpecEventHandler &) { return this; } void DssslSpecEventHandler::Part::append(BodyElement *element) { bodyElements_.append(element); } void DssslSpecEventHandler::Part::append(DeclarationElement *element) { declarations_.append(element); } DssslSpecEventHandler::Doc *DssslSpecEventHandler::Part::doc() { return doc_; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/DssslSpecEventHandler.h0000644000021000000240000001573107067706546015267 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef DssslSpecEventHandler_INCLUDED #define DssslSpecEventHandler_INCLUDED 1 #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class DssslSpecEventHandler : private ErrorCountEventHandler, private ArcDirector { public: class BodyElement : public Link { public: virtual ~BodyElement(); virtual void makeInputSource(DssslSpecEventHandler &, Owner &) = 0; }; class ImmediateBodyElement : public BodyElement { public: ImmediateBodyElement(Text &); void makeInputSource(DssslSpecEventHandler &, Owner &); private: Text text_; }; class EntityBodyElement : public BodyElement { public: EntityBodyElement(const ConstPtr &); void makeInputSource(DssslSpecEventHandler &, Owner &); private: ConstPtr entity_; }; class SpecPart; class Doc; class Part; class MapSdataEntityElement; class DeclarationElement : public Link { public: enum Type { features, basesetEncoding, literalDescribedChar, addNameChars, addSeparatorChars, standardChars, otherChars, combineChar, mapSdataEntity, charRepertoire, sgmlGrovePlan, }; DeclarationElement(Type); void makeInputSource(DssslSpecEventHandler&, Owner&); Type type() const; void setContent(Text &); void setName(const StringC &s) { name_ = s; }; const StringC &name() { return name_; }; void setText(const StringC &s) { text_ = s; }; const StringC &text() { return text_; }; void setModadd(const StringC &s) { modadd_ = s; }; const StringC &modadd() { return modadd_; }; void setDesc(const StringC &s) { desc_ = s; }; const StringC &desc() { return desc_; }; private: Type type_; Text content_; StringC name_; StringC text_; StringC modadd_; StringC desc_; }; class PartHeader : public Link { public: PartHeader(Doc *, const StringC &id); const StringC &id() const; Part *resolve(DssslSpecEventHandler &); void setPart(SpecPart *); void setRefLoc(const Location &); private: Doc *doc_; StringC id_; // Location of first reference Location refLoc_; Owner specPart_; }; class SpecPart { public: virtual ~SpecPart(); virtual Part *resolve(DssslSpecEventHandler &) = 0; }; class ExternalPart : public SpecPart { public: ExternalPart(PartHeader *); Part *resolve(DssslSpecEventHandler &); private: PartHeader *header_; }; class ExternalFirstPart : public SpecPart { public: ExternalFirstPart(Doc *); Part *resolve(DssslSpecEventHandler &); private: Doc *doc_; }; class Part : public SpecPart { public: typedef IListIter Iter; typedef IListIter DIter; Part(Doc *, bool partial, bool style); Iter iter(); DIter diter(); Doc *doc(); const Vector &use() const; void addUse(PartHeader *); void append(BodyElement *); void append(DeclarationElement *); bool setMark(bool = 1); bool style(); bool partial(); private: Part *resolve(DssslSpecEventHandler &); IList declarations_; IList bodyElements_; Vector use_; bool mark_; Doc *doc_; bool style_; bool partial_; }; class Doc : public Link { public: Doc(); Doc(const StringC &sysid); void setLocation(const Location &); PartHeader *refPart(const StringC &); PartHeader *refPart(const StringC &, const Location &refLoc); Part *resolveFirstPart(DssslSpecEventHandler &); Part::DIter diter(); void load(DssslSpecEventHandler &); void append(DeclarationElement *); const StringC &sysid() const; private: bool loaded_; StringC sysid_; IList declarations_; IList headers_; Location loc_; friend class Part; }; DssslSpecEventHandler(Messenger &); void load(SgmlParser &specParser, const CharsetInfo &, const StringC &id, Vector &parts); void externalSpecificationStart(const StartElementEvent &); void externalSpecificationEnd(const EndElementEvent &); void styleSpecificationStart(const StartElementEvent &); void transformSpecificationStart(const StartElementEvent &); void specificationEnd(const EndElementEvent &); void specificationBodyStart(const StartElementEvent &); void specificationBodyEnd(const EndElementEvent &); void declarationStart(const StartElementEvent &); void declarationEnd(const EndElementEvent &); private: Vector &parts(); void startElement(StartElementEvent *); void endElement(EndElementEvent *); void specificationStart(const StartElementEvent &, bool); void data(DataEvent *); void message(MessageEvent *); void endProlog(EndPrologEvent *); EventHandler *arcEventHandler(const Notation *, const Vector &, const SubstTable *); void loadDoc(SgmlParser &, Doc &); void resolveParts(Part *, Vector &); Doc *findDoc(const StringC &); const StringC *attributeString(const StartElementEvent &, const char *); const Text *attributeText(const StartElementEvent &, const char *); ConstPtr attributeEntity(const StartElementEvent &, const char *); Messenger *mgr_; bool gotArc_; bool gatheringBody_; Part *currentPart_; Text currentBody_; Doc *currentDoc_; IList docs_; SgmlParser *parser_; const CharsetInfo *charset_; DeclarationElement *currentDecl_; friend class Doc; friend class EntityBodyElement; friend class PartHeader; }; inline const StringC &DssslSpecEventHandler::PartHeader::id() const { return id_; } inline void DssslSpecEventHandler::PartHeader::setPart(SpecPart *part) { specPart_ = part; } inline void DssslSpecEventHandler::Part::addUse(PartHeader *header) { use_.push_back(header); } inline const Vector & DssslSpecEventHandler::Part::use() const { return use_; } inline const StringC &DssslSpecEventHandler::Doc::sysid() const { return sysid_; } inline DssslSpecEventHandler::Part::Iter DssslSpecEventHandler::Part::iter() { return Iter(bodyElements_); } inline DssslSpecEventHandler::Part::DIter DssslSpecEventHandler::Part::diter() { return DIter(declarations_); } inline DssslSpecEventHandler::Part::DIter DssslSpecEventHandler::Doc::diter() { return Part::DIter(declarations_); } inline bool DssslSpecEventHandler::Part::setMark(bool b) { bool tem = mark_; mark_ = b; return tem; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not DssslSpecEventHandler_INCLUDED */ OpenJade-1.4devel/style/ELObj.cxx0000644000021000000240000007420207067706551012364 // Copyright (c) 1996 James Clark, 2000 Peter Nilsson // See the file copying.txt for copying permission. #include "stylelib.h" #include "ELObj.h" #include "EvalContext.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ReverseNodeListObj : public NodeListObj { public: ReverseNodeListObj(NodeListObj *); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListReverse(EvalContext &context, Interpreter &interp); NodePtr nodeListRef(long, EvalContext &, Interpreter &); long nodeListLength(EvalContext &context, Interpreter &interp); void traceSubObjects(Collector &) const; bool contains(EvalContext &, Interpreter &, const NodePtr &); private: NodeListObj *reversed(EvalContext &context, Interpreter &interp); NodeListObj *nl_; NodeListObj *reversed_; }; ELObj::ELObj() { hasSubObjects_ = 0; } bool ELObj::isEqual(ELObj &) { return false; } bool ELObj::isEquiv(ELObj &obj) { return isEqual(obj); } bool ELObj::isNil() const { return false; } bool ELObj::isList() const { return false; } bool ELObj::isTrue() const { return true; } PairObj *ELObj::asPair() { return 0; } VectorObj *ELObj::asVector() { return 0; } SymbolObj *ELObj::asSymbol() { return 0; } KeywordObj *ELObj::asKeyword() { return 0; } StringObj *ELObj::convertToString() { return 0; } FunctionObj *ELObj::asFunction() { return 0; } SosofoObj *ELObj::asSosofo() { return 0; } ColorObj *ELObj::asColor() { return 0; } ColorSpaceObj *ELObj::asColorSpace() { return 0; } AddressObj *ELObj::asAddress() { return 0; } DisplaySpaceObj *ELObj::asDisplaySpace() { return 0; } InlineSpaceObj *ELObj::asInlineSpace() { return 0; } GlyphSubstTableObj *ELObj::asGlyphSubstTable() { return 0; } LanguageObj *ELObj::asLanguage() { return 0; } bool ELObj::optSingletonNodeList(EvalContext &, Interpreter &, NodePtr &) { return 0; } NodeListObj *ELObj::asNodeList() { return 0; } NamedNodeListObj *ELObj::asNamedNodeList() { return 0; } StyleObj *ELObj::asStyle() { return 0; } BoxObj *ELObj::asBox() { return 0; } void ELObj::print(Interpreter &interp, OutputCharStream &out) { out << "#"; } void ELObj::print(Interpreter &interp, OutputCharStream &out, unsigned) { print(interp, out); } bool ELObj::exactIntegerValue(long &) { return false; } bool ELObj::realValue(double &) { return false; } bool ELObj::inexactRealValue(double &) { return false; } bool ELObj::lengthValue(long &n) { return false; } ELObj::QuantityType ELObj::quantityValue(long &, double &, int &) { return noQuantity; } const LengthSpec *ELObj::lengthSpec() const { return 0; } bool ELObj::stringData(const Char *&, size_t &) { return false; } bool ELObj::charValue(Char &) { return false; } const FOTBuilder::GlyphId *ELObj::glyphId() const { return 0; } ELObj *ELObj::resolveQuantities(bool, Interpreter &, const Location &) { return this; } ErrorObj::ErrorObj() { } void ErrorObj::print(Interpreter &interp, OutputCharStream &out) { out << "#"; } UnspecifiedObj::UnspecifiedObj() { } void UnspecifiedObj::print(Interpreter &interp, OutputCharStream &out) { out << "#v"; } NilObj::NilObj() { } bool NilObj::isNil() const { return true; } bool NilObj::isList() const { return true; } void NilObj::print(Interpreter &, OutputCharStream &out) { out << "()"; } TrueObj::TrueObj() { } void TrueObj::print(Interpreter &, OutputCharStream &out) { out << "#t"; } FalseObj::FalseObj() { } bool FalseObj::isTrue() const { return false; } void FalseObj::print(Interpreter &, OutputCharStream &out) { out << "#f"; } SymbolObj::SymbolObj(StringObj *name) : name_(name), cValue_(FOTBuilder::symbolFalse) { hasSubObjects_ = 1; } void SymbolObj::traceSubObjects(Collector &c) const { c.trace(name_); } void SymbolObj::print(Interpreter &interp, OutputCharStream &out) { out.write(name()->data(), name()->size()); } SymbolObj *SymbolObj::asSymbol() { return this; } StringObj *SymbolObj::convertToString() { return name(); } KeywordObj::KeywordObj(const Identifier *ident) : ident_(ident) { } KeywordObj *KeywordObj::asKeyword() { return this; } bool KeywordObj::isEqual(ELObj &obj) { KeywordObj *k = obj.asKeyword(); return k && k->ident_ == ident_; } void KeywordObj::print(Interpreter &interp, OutputCharStream &out) { out << ident_->name() << ":"; } PairObj::PairObj(ELObj *car, ELObj *cdr) : car_(car), cdr_(cdr) { hasSubObjects_ = 1; } bool PairObj::isEqual(ELObj &obj) { PairObj *p = obj.asPair(); // FIXME need non-recursive implementation return p && equal(*p->car(), *car()) && equal(*p->cdr(), *cdr()); } bool PairObj::isEquiv(ELObj &obj) { PairObj *p = obj.asPair(); // FIXME need non-recursive implementation return p && eqv(*p->car(), *car()) && eqv(*p->cdr(), *cdr()); } void PairObj::traceSubObjects(Collector &c) const { c.trace(car_); c.trace(cdr_); } ELObj *PairObj::resolveQuantities(bool force, Interpreter &interp, const Location &loc) { bool fail = 0; PairObj *pair = this; for (;;) { ELObj *tem = pair->car_->resolveQuantities(force, interp, loc); if (!tem) fail = 1; else { if (pair->permanent()) interp.makePermanent(tem); pair->car_ = tem; } PairObj *nextPair = pair->cdr_->asPair(); if (!nextPair) break; pair = nextPair; } ELObj *tem = pair->cdr_->resolveQuantities(force, interp, loc); if (!tem) fail = 1; else { if (pair->permanent()) interp.makePermanent(tem); pair->cdr_ = tem; } if (fail) return 0; else return this; } PairObj *PairObj::asPair() { return this; } bool PairObj::isList() const { ELObj *p = cdr_; while (!p->isNil()) { PairObj *pair = p->asPair(); if (!pair) return false; p = pair->cdr(); } return true; } void PairObj::print(Interpreter &interp, OutputCharStream &out) { out << "("; car_->print(interp, out); ELObj *p = cdr_; for (;;) { if (p->isNil()) { out << ")"; return; } PairObj *pair = p->asPair(); if (!pair) { out << " . "; p->print(interp, out); out << ")"; return; } out << " "; pair->car()->print(interp, out); p = pair->cdr(); } } VectorObj::VectorObj() { hasSubObjects_ = 1; } VectorObj::VectorObj(Vector &v) { hasSubObjects_ = 1; v.swap(*this); } void VectorObj::traceSubObjects(Collector &c) const { for (size_t i = 0; i < Vector::size(); i++) c.trace((*this)[i]); } VectorObj *VectorObj::asVector() { return this; } bool VectorObj::isEquiv(ELObj &) { return 0; } bool VectorObj::isEqual(ELObj &obj) { VectorObj *v = obj.asVector(); if (!v) return 0; if (size() != v->size()) return 0; for (size_t i = 0; i < size(); i++) if (!equal(*(*this)[i], *(*v)[i])) return 0; return 1; } void VectorObj::print(Interpreter &interp, OutputCharStream &out) { out << "#("; Vector &v = *this; for (size_t i = 0; i < v.size(); i++) { if (i) out << " "; ELObj *tem = v[i]; if (!tem) out << "#"; else { v[i] = 0; tem->print(interp, out); v[i] = tem; } } out << ")"; } ELObj *VectorObj::resolveQuantities(bool force, Interpreter &interp, const Location &loc) { bool fail = 0; Vector &v = *this; for (size_t i = 0; i < v.size(); i++) { ELObj *tem = v[i]->resolveQuantities(force, interp, loc); if (tem) { if (permanent()) interp.makePermanent(tem); v[i] = tem; } else fail = 1; } if (fail) return 0; return this; } CharObj::CharObj(Char ch) : ch_(ch) { } void CharObj::display(Interpreter &interp, OutputCharStream &out) const { out.put(ch_); // FIXME } void CharObj::print(Interpreter &, OutputCharStream &out) { out << "#\\"; out.put(ch_); // FIXME } bool CharObj::charValue(Char &c) { c = ch_; return 1; } bool CharObj::isEqual(ELObj &obj) { Char c; return obj.charValue(c) && c == ch_; } StringObj::StringObj() { } StringObj::StringObj(const StringC &str) : StringC(str) { } StringObj::StringObj(const Char *s, size_t len) : StringC(s, len) { } bool StringObj::stringData(const Char *&s, size_t &n) { s = data(); n = size(); return true; } bool StringObj::isEqual(ELObj &obj) { const Char *s; size_t n; return (obj.stringData(s, n) && n == size() && (n == 0 || memcmp(s, data(), n*sizeof(Char)) == 0)); } StringObj *StringObj::convertToString() { return this; } void StringObj::print(Interpreter &interp, OutputCharStream &out) { // FIXME out << "\""; const Char *s = data(); for (size_t i = 0; i < size(); i++) switch (s[i]) { case '\\': case '"': out << "\\"; // fall through default: out.put(s[i]); break; } out << "\""; } IntegerObj::IntegerObj() : n_(0) { } IntegerObj::IntegerObj(long n) : n_(n) { } bool IntegerObj::isEqual(ELObj &obj) { long n; return obj.exactIntegerValue(n) && n == n_; } void IntegerObj::print(Interpreter &interp, OutputCharStream &out) { print(interp, out, 10); } void IntegerObj::print(Interpreter &, OutputCharStream &out, unsigned radix) { if (radix == 10) { if (n_ < 0) out << '-' << (unsigned long)-n_; else out << (unsigned long)n_; return; } if (n_ == 0) { out << '0'; return; } unsigned long n; if (n_ < 0) { out << '-'; n = -n_; } else n = n_; char buf[64]; int i = 0; while (n != 0) { buf[i++] = "0123456789abcdef"[n % radix]; n /= radix; } while (i > 0) out << buf[--i]; } bool IntegerObj::exactIntegerValue(long &n) { n = n_; return true; } bool IntegerObj::realValue(double &n) { n = n_; return true; } ELObj::QuantityType IntegerObj::quantityValue(long &val, double &, int &dim) { val = n_; dim = 0; return longQuantity; } RealObj::RealObj(double n) : n_(n) { } bool RealObj::isEqual(ELObj &obj) { double n; return obj.inexactRealValue(n) && n == n_; } bool RealObj::realValue(double &n) { n = n_; return true; } bool RealObj::inexactRealValue(double &n) { n = n_; return true; } ELObj::QuantityType RealObj::quantityValue(long &, double &val, int &dim) { val = n_; dim = 0; return doubleQuantity; } void RealObj::print(Interpreter &, OutputCharStream &out) { char buf[1024]; sprintf(buf, "%g", n_); out << buf; } LengthObj::LengthObj(long n) : n_(n) { } bool LengthObj::lengthValue(long &n) { n = n_; return true; } ELObj::QuantityType LengthObj::quantityValue(long &val, double &, int &dim) { val = n_; dim = 1; return longQuantity; } bool LengthObj::isEqual(ELObj &obj) { long n; double d; int dim; switch (obj.quantityValue(n, d, dim)) { case noQuantity: break; case doubleQuantity: return dim == 1 && d == n_; case longQuantity: return dim == 1 && n == n_; } return 0; } void LengthObj::print(Interpreter &interp, OutputCharStream &out) { char buf[1024]; sprintf(buf, "%gpt", n_ * 72.0/interp.unitsPerInch()); out << buf; } QuantityObj::QuantityObj(double val, int dim) : val_(val), dim_(dim) { } bool QuantityObj::isEqual(ELObj &obj) { long n; double d; int dim; switch (obj.quantityValue(n, d, dim)) { case noQuantity: break; case doubleQuantity: return dim == dim_ && d == val_; case longQuantity: return dim == dim_ && n == val_; } return 0; } ELObj::QuantityType QuantityObj::quantityValue(long &, double &val, int &dim) { val = val_; dim = dim_; return doubleQuantity; } void QuantityObj::print(Interpreter &interp, OutputCharStream &out) { char buf[1024]; sprintf(buf, "%gpt%d", val_ * pow(72.0/interp.unitsPerInch(), double(dim_)), dim_); out << buf; } bool QuantityObj::realValue(double &d) { if (dim_ != 0) return 0; d = val_; return 1; } bool QuantityObj::inexactRealValue(double &d) { if (dim_ != 0) return 0; d = val_; return 1; } LengthSpecObj::LengthSpecObj(const LengthSpec &spec) : lengthSpec_(new LengthSpec(spec)) { } const LengthSpec *LengthSpecObj::lengthSpec() const { return lengthSpec_.pointer(); } LengthSpec::LengthSpec() { for (int i = 0; i < nVals; i++) val_[i] = 0.0; } LengthSpec::LengthSpec(double d) { val_[0] = d; for (int i = 1; i < nVals; i++) val_[i] = 0.0; } LengthSpec::LengthSpec(Unknown unknown, double d) { int i; for (i = 0; i < unknown; i++) val_[i] = 0.0; val_[unknown] = d; for (i = unknown + 1; i < nVals; i++) val_[i] = 0.0; } void LengthSpec::operator+=(const LengthSpec &ls) { for (int i = 0; i < nVals; i++) val_[i] += ls.val_[i]; } void LengthSpec::operator-=(const LengthSpec &ls) { for (int i = 0; i < nVals; i++) val_[i] -= ls.val_[i]; } void LengthSpec::operator*=(double d) { for (int i = 0; i < nVals; i++) val_[i] *= d; } void LengthSpec::operator/=(double d) { for (int i = 0; i < nVals; i++) val_[i] /= d; } bool LengthSpec::convert(FOTBuilder::LengthSpec &result) const { // FIXME do some checking result.length = long(val_[0] < 0.0 ? val_[0] - 0.5 : val_[0] + .5); result.displaySizeFactor = val_[1]; return 1; } bool LengthSpec::convert(FOTBuilder::TableLengthSpec &result) const { // FIXME do some checking result.length = long(val_[0] < 0.0 ? val_[0] - 0.5 : val_[0] + .5); result.displaySizeFactor = val_[1]; result.tableUnitFactor = val_[2]; return 1; } DisplaySpaceObj::DisplaySpaceObj(const FOTBuilder::DisplaySpace &displaySpace) : displaySpace_(new FOTBuilder::DisplaySpace(displaySpace)) { } const FOTBuilder::DisplaySpace &DisplaySpaceObj::displaySpace() const { return *displaySpace_; } DisplaySpaceObj *DisplaySpaceObj::asDisplaySpace() { return this; } InlineSpaceObj::InlineSpaceObj(const FOTBuilder::InlineSpace &inlineSpace) : inlineSpace_(new FOTBuilder::InlineSpace(inlineSpace)) { } const FOTBuilder::InlineSpace &InlineSpaceObj::inlineSpace() const { return *inlineSpace_; } InlineSpaceObj *InlineSpaceObj::asInlineSpace() { return this; } UnresolvedLengthObj::UnresolvedLengthObj(long val, int valExp, Unit *unit) : val_(val), valExp_(valExp), unit_(unit) { } ELObj *UnresolvedLengthObj::resolveQuantities(bool force, Interpreter &interp, const Location &loc) { unsigned part; Location defLoc; if (!unit_->defined(part, defLoc)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::undefinedQuantity, StringMessageArg(unit_->name())); return interp.makeError(); } return unit_->resolveQuantity(force, interp, val_, valExp_); } UnresolvedQuantityObj ::UnresolvedQuantityObj(double val, Unit *unit, int unitExp) : val_(val), unit_(unit), unitExp_(unitExp) { } ELObj *UnresolvedQuantityObj::resolveQuantities(bool force, Interpreter &interp, const Location &loc) { unsigned part; Location defLoc; if (!unit_->defined(part, defLoc)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::undefinedQuantity, StringMessageArg(unit_->name())); return interp.makeError(); } return unit_->resolveQuantity(force, interp, val_, unitExp_); } GlyphIdObj::GlyphIdObj(const FOTBuilder::GlyphId &glyphId) : glyphId_(glyphId) { } const FOTBuilder::GlyphId *GlyphIdObj::glyphId() const { return &glyphId_; } bool GlyphIdObj::isEqual(ELObj &obj) { const FOTBuilder::GlyphId *p = obj.glyphId(); return (p && p->publicId == glyphId_.publicId && p->suffix == glyphId_.suffix); } GlyphSubstTableObj::GlyphSubstTableObj(const ConstPtr &table) : table_(table) { } GlyphSubstTableObj *GlyphSubstTableObj::asGlyphSubstTable() { return this; } AddressObj::AddressObj(FOTBuilder::Address::Type type, const NodePtr &node, const StringC &str1, const StringC &str2, const StringC &str3) { address_ = new FOTBuilder::Address; address_->type = type; address_->node = node; address_->params[0] = str1; address_->params[1] = str2; address_->params[2] = str3; } AddressObj *AddressObj::asAddress() { return this; } NodeListObj *NodeListObj::asNodeList() { return this; } NodeListObj *NodeListObj::nodeListNoOrder(Collector &) { return this; } NodeListObj *NodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { chunk = 0; return nodeListRest(context, interp); } bool NodeListObj::optSingletonNodeList(EvalContext &context, Interpreter &interp, NodePtr &node) { NodeListObj *rest = nodeListRest(context, interp); ELObjDynamicRoot protect(interp, rest); if (rest->nodeListFirst(context, interp)) return 0; node = nodeListFirst(context, interp); return 1; } NodePtr NodeListObj::nodeListRef(long n, EvalContext &context, Interpreter &interp) { if (n < 0) return NodePtr(); NodeListObj *nl = this; ELObjDynamicRoot protect(interp, nl); while (n > 0) { NodePtr nd(nl->nodeListFirst(context, interp)); if (!nd) return NodePtr(); GroveString str; if (nd->charChunk(interp, str) == accessOK && str.size() <= n) { bool chunk; nl = nl->nodeListChunkRest(context, interp, chunk); if (chunk) n -= str.size(); else n--; } else { nl = nl->nodeListRest(context, interp); n--; } protect = nl; } return nl->nodeListFirst(context, interp); } NodeListObj *NodeListObj::nodeListReverse(EvalContext &, Interpreter &interp) { return new (interp) ReverseNodeListObj(this); } long NodeListObj::nodeListLength(EvalContext &context, Interpreter &interp) { NodeListObj *nl = this; long n = 0; ELObjDynamicRoot protect(interp, nl); for (;;) { NodePtr nd(nl->nodeListFirst(context, interp)); if (!nd) break; bool chunk; nl = nl->nodeListChunkRest(context, interp, chunk); protect = nl; GroveString str; if (chunk && nd->charChunk(interp, str) == accessOK) n += str.size(); else n += 1; } return n; } bool NodeListObj::suppressError() { return 0; } bool NodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &ptr) { NodeListObj *nl = this; for (;;) { ELObjDynamicRoot protect(interp, nl); NodePtr nd(nl->nodeListFirst(context, interp)); if (!nd) return 0; if (*nd == *ptr) return 1; ComponentName::Id cls1, cls2; nd->getClassName(cls1); ptr->getClassName(cls2); bool chunk; nl = (cls1 == cls2) ? nl->nodeListRest(context, interp) : nl->nodeListChunkRest(context, interp, chunk); } return 0; } bool NodeListObj::contains(EvalContext &context, Interpreter &interp, ComponentName::Id id) { NodeListObj *nl = this; for (;;) { ELObjDynamicRoot protect(interp, nl); NodePtr nd(nl->nodeListFirst(context, interp)); if (!nd) return 0; ComponentName::Id cls; nd->getClassName(cls); if (cls == id) return 1; bool chunk; nl = nl->nodeListChunkRest(context, interp, chunk); } return 0; } class OutputPropertyValue : public PropertyValue { public: // Does NOT own the OUtputCharsTream. OutputPropertyValue(OutputCharStream &os) : os_(os), className_(ComponentName::noId) { } // Set class name for next property value. void setClassName(ComponentName::Id id) { className_ = id; } // Print separator if something was output. void sep(const char *s) { if (className_ == ComponentName::noId) os_ << s; } // Print indication of null value, can't do it inside set, // since set isn't called for null values void nullValue() { flush(); os_ << "#"; } void set(const NodePtr &) { flush(); os_ << "#"; } void set(const NodeListPtr &) { flush(); os_ << "#"; } void set(const NamedNodeListPtr &) { flush(); os_ << "#"; } void set(bool b) { flush(); os_ << (b ? "#t" : "#f"); } void set(GroveChar gc) { flush(); // FIXME. os_ << "#\\"; os_.put(gc); } void set(GroveString gs) { flush(); // FIXME. os_ << '\"'; os_.write(gs.data(), gs.size()); os_ << '\"'; } void set(ComponentName::Id id) { flush(); // Issue: Use RCS name or SDQL name? Compact vs. readable output. os_ << ComponentName::sdqlName(id); } void set(const GroveStringListPtr &gsl) { flush(); // FIXME. os_ << '('; bool first = true; for(ConstGroveStringListIter iter(gsl->iter());!iter.done();iter.next()) { if (!first) os_ << ' '; os_ << '\"'; os_.write(iter.cur().data(), iter.cur().size()); os_ << '\"'; first = false; } os_ << ')'; } void set(const ComponentName::Id *idp) { flush(); os_ << '('; bool first = true; while (*idp != ComponentName::noId) { if (!first) os_ << ' '; os_ << ComponentName::sdqlName(*idp++); first = false; } os_ << ')'; } void set(long l) { flush(); if (l < 0) os_ << '-' << (unsigned long)-l; else os_ << (unsigned long)l; } // FIXME: add mechanism to limit number of items printed. private: void flush() { if (className_ != ComponentName::noId) { os_ << ComponentName::sdqlName(className_) << ": "; className_ = ComponentName::noId; } } OutputCharStream &os_; ComponentName::Id className_; }; void NodeListObj::print(Interpreter &interp, OutputCharStream &os) { // This is very verbose at the moment. // FIXME: This EvalContext may not be correct in every case... EvalContext ec; NodeListObj *nl = this; ELObjDynamicRoot protect(interp, nl); OutputPropertyValue outProp(os); os << "#node-list("; for(;;) { NodePtr nd(nl->nodeListFirst(ec, interp)); if (!nd) break; os << "< "; // Print the properties. const ComponentName::Id *idp; if (nd->getAllPropertyNames(idp) != accessOK) CANNOT_HAPPEN(); while (*idp != ComponentName::noId) { switch (*idp) { case ComponentName::idAllPropertyNames: ++idp; continue; } outProp.setClassName(*idp); if (nd->property(*idp, interp, outProp) == accessNull) outProp.nullValue(); outProp.sep(" "); ++idp; } os << "> "; nl = nl->nodeListRest(ec, interp); protect = nl; } os << ')'; } NamedNodeListObj *NamedNodeListObj::asNamedNodeList() { return this; } NodePtrNodeListObj::NodePtrNodeListObj() { } NodePtrNodeListObj::NodePtrNodeListObj(const NodePtr &node) : node_(node) { } bool NodePtrNodeListObj::optSingletonNodeList(EvalContext &, Interpreter &, NodePtr &node) { node = node_; return 1; } NodePtr NodePtrNodeListObj::nodeListFirst(EvalContext &, Interpreter &) { return node_; } NodeListObj *NodePtrNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { if (node_) return new (interp) NodePtrNodeListObj; else return this; } NodeListPtrNodeListObj::NodeListPtrNodeListObj(const NodeListPtr &nodeList) : nodeList_(nodeList) { } NodePtr NodeListPtrNodeListObj::nodeListFirst(EvalContext &, Interpreter &) { NodePtr nd; if (nodeList_->first(nd) == accessOK) return nd; else return NodePtr(); } NodeListObj *NodeListPtrNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { NodeListPtr nl; if (nodeList_->rest(nl) == accessOK) return new (interp) NodeListPtrNodeListObj(nl); else return interp.makeEmptyNodeList(); } NodeListObj *NodeListPtrNodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { NodeListPtr nl; if (nodeList_->chunkRest(nl) == accessOK) { chunk = 1; return new (interp) NodeListPtrNodeListObj(nl); } else { chunk = 0; return interp.makeEmptyNodeList(); } } NodePtr NodeListPtrNodeListObj::nodeListRef(long i, EvalContext &, Interpreter &interp) { NodePtr nd; if (i < 0 || nodeList_->ref(i, nd) != accessOK) return NodePtr(); return nd; } NamedNodeListPtrNodeListObj ::NamedNodeListPtrNodeListObj(const NamedNodeListPtr &nnl) : namedNodeList_(nnl) { } NodePtr NamedNodeListPtrNodeListObj::namedNode(const Char *s, size_t n) { NodePtr node; if (namedNodeList_->namedNode(GroveString(s, n), node) != accessOK) node.clear(); return node; } bool NamedNodeListPtrNodeListObj::nodeName(const NodePtr &nd, GroveString &str) { return namedNodeList_->nodeName(nd, str) == accessOK; } size_t NamedNodeListPtrNodeListObj::normalize(Char *s, size_t n) { return namedNodeList_->normalize(s, n); } NodePtr NamedNodeListPtrNodeListObj::nodeListFirst(EvalContext &, Interpreter &) { if (!nodeList_) nodeList_ = namedNodeList_->nodeList(); NodePtr nd; if (nodeList_->first(nd) == accessOK) return nd; else return NodePtr(); } NodeListObj *NamedNodeListPtrNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { if (!nodeList_) nodeList_ = namedNodeList_->nodeList(); NodeListPtr nl; if (nodeList_->rest(nl) == accessOK) return new (interp) NodeListPtrNodeListObj(nl); else return new (interp) NodePtrNodeListObj; } NodeListObj *NamedNodeListPtrNodeListObj::nodeListNoOrder(Collector &c) { return new (c) NodeListPtrNodeListObj(namedNodeList_->nodeListNoOrder()); } PairNodeListObj::PairNodeListObj(NodeListObj *head, NodeListObj *tail) : head_(head), tail_(tail) { hasSubObjects_ = 1; } NodePtr PairNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { if (head_) { NodePtr nd(head_->nodeListFirst(context, interp)); if (nd) return nd; head_ = 0; } return tail_->nodeListFirst(context, interp); } NodeListObj *PairNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { if (!head_ || !head_->nodeListFirst(context, interp)) return tail_->nodeListRest(context, interp); NodeListObj *tem = head_->nodeListRest(context, interp); ELObjDynamicRoot protect(interp, tem); return new (interp) PairNodeListObj(tem, tail_); } NodeListObj *PairNodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { if (!head_ || !head_->nodeListFirst(context, interp)) return tail_->nodeListChunkRest(context, interp, chunk); NodeListObj *tem = head_->nodeListChunkRest(context, interp, chunk); ELObjDynamicRoot protect(interp, tem); return new (interp) PairNodeListObj(tem, tail_); } void PairNodeListObj::traceSubObjects(Collector &c) const { c.trace(head_); c.trace(tail_); } bool PairNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &nd) { return (head_ && head_->contains(context, interp, nd)) || tail_->contains(context, interp, nd); } ReverseNodeListObj::ReverseNodeListObj(NodeListObj *nl) : nl_(nl), reversed_(0) { hasSubObjects_ = 1; } NodePtr ReverseNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { return reversed(context, interp)->nodeListFirst(context, interp); } NodeListObj *ReverseNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { return reversed(context, interp)->nodeListRest(context, interp); } NodePtr ReverseNodeListObj::nodeListRef(long n, EvalContext &context, Interpreter &interp) { if (reversed_) return reversed_->nodeListRef(n, context, interp); if (n < 0) return NodePtr(); size_t len = nl_->nodeListLength(context, interp); if (n >= len) return 0; return nl_->nodeListRef(len - n - 1, context, interp); } NodeListObj *ReverseNodeListObj::reversed(EvalContext &context, Interpreter &interp) { if (!reversed_) { NodePtr nd(nl_->nodeListFirst(context, interp)); if (nd) { reversed_ = new (interp) NodePtrNodeListObj(nd); NodeListObj *tem = nl_; ELObjDynamicRoot protect(interp, tem); ELObjDynamicRoot protect2(interp, reversed_); for (;;) { tem = tem->nodeListRest(context, interp); protect = tem; nd = tem->nodeListFirst(context, interp); if (!nd) break; NodeListObj *single = new (interp) NodePtrNodeListObj(nd); protect2 = single; reversed_ = new (interp) PairNodeListObj(single, reversed_); } } else reversed_ = nl_; } return reversed_; } NodeListObj *ReverseNodeListObj::nodeListReverse(EvalContext &, Interpreter &) { return nl_; } long ReverseNodeListObj::nodeListLength(EvalContext &context, Interpreter &interp) { return nl_->nodeListLength(context, interp); } void ReverseNodeListObj::traceSubObjects(Collector &c) const { c.trace(nl_); c.trace(reversed_); } bool ReverseNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &nd) { return nl_->contains(context, interp, nd); } SubgroveSpecObj *ELObj::asSubgroveSpec() { return 0; } SubgroveSpecObj::SubgroveSpecObj(NodePtr node, NodePtr subgrove, SymbolObj *cls, ELObj *add, ELObj *null, ELObj *remove, ELObj *sub, ELObj *children, ELObj *label, FunctionObj *sort) { spec_ = new SubgroveSpec; spec_->node = node; spec_->subgrove = subgrove; spec_->cls = cls; spec_->add = add; spec_->null = null; spec_->remove = remove; spec_->sub = sub; spec_->children = children; spec_->label = label; spec_->sort = sort; } SubgroveSpecObj::~SubgroveSpecObj() { delete spec_; } SubgroveSpecObj *SubgroveSpecObj::asSubgroveSpec() { return this; } void SubgroveSpecObj::traceSubObjects(Collector &c) const { c.trace(spec_->cls); c.trace(spec_->add); c.trace(spec_->null); c.trace(spec_->remove); c.trace(spec_->sub); c.trace(spec_->children); c.trace(spec_->label); c.trace(spec_->sort); } CreateSpecObj *ELObj::asCreateSpec() { return 0; } CreateSpecObj::CreateSpecObj(CreateSpecObj::Type t, ELObj *id, NodePtr node, SubgroveSpecObj *sg, StringObj *property, ELObj *label, FunctionObj *resultPath, bool optional, bool unique) { spec_ = new CreateSpec; spec_->type = t; spec_->groveId = id; spec_->node = node; spec_->sg = sg; spec_->property = property; spec_->label = label; spec_->resultPath = resultPath; spec_->optional = optional; spec_->unique = unique; } CreateSpecObj::~CreateSpecObj() { delete spec_; } CreateSpecObj *CreateSpecObj::asCreateSpec() { return this; } void CreateSpecObj::traceSubObjects(Collector &c) const { c.trace(spec_->groveId); c.trace(spec_->sg); c.trace(spec_->label); c.trace(spec_->property); c.trace(spec_->resultPath); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/ELObj.h0000644000021000000240000004044407067706551012012 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef ELObj_INCLUDED #define ELObj_INCLUDED 1 #include #include "Collector.h" #include #include #include #include "Node.h" #include "FOTBuilder.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Interpreter; class EvalContext; class Unit; class PairObj; class FunctionObj; class SymbolObj; class KeywordObj; class BoxObj; class StringObj; class SosofoObj; class ColorObj; class ColorSpaceObj; class StyleObj; class AddressObj; class NodeListObj; class NamedNodeListObj; class Identifier; class LengthSpec; class DisplaySpaceObj; class InlineSpaceObj; class GlyphSubstTableObj; class VectorObj; class LanguageObj; class SubgroveSpecObj; class CreateSpecObj; class ELObj : public Collector::Object { public: ELObj(); void *operator new(size_t, Collector &c) { return c.allocateObject(0); } #ifdef SP_HAVE_PLACEMENT_OPERATOR_DELETE private: void operator delete(void *p) { } public: void operator delete(void *p, Collector &c) { c.unallocateObject(p); } #endif virtual bool isNil() const; virtual bool isList() const; virtual bool isTrue() const; virtual PairObj *asPair(); virtual SymbolObj *asSymbol(); virtual KeywordObj *asKeyword(); virtual FunctionObj *asFunction(); virtual SosofoObj *asSosofo(); virtual ColorObj *asColor(); virtual ColorSpaceObj *asColorSpace(); virtual StyleObj *asStyle(); virtual AddressObj *asAddress(); virtual DisplaySpaceObj *asDisplaySpace(); virtual InlineSpaceObj *asInlineSpace(); virtual GlyphSubstTableObj *asGlyphSubstTable(); virtual NodeListObj *asNodeList(); virtual NamedNodeListObj *asNamedNodeList(); virtual StringObj *convertToString(); // either symbol or string virtual BoxObj *asBox(); virtual VectorObj *asVector(); virtual LanguageObj *asLanguage(); virtual SubgroveSpecObj *asSubgroveSpec(); virtual CreateSpecObj *asCreateSpec(); virtual bool charValue(Char &); virtual bool stringData(const Char *&, size_t &); virtual void print(Interpreter &, OutputCharStream &); virtual void print(Interpreter &, OutputCharStream &, unsigned); virtual bool exactIntegerValue(long &); virtual bool realValue(double &); virtual bool inexactRealValue(double &); virtual bool lengthValue(long &); virtual const FOTBuilder::GlyphId *glyphId() const; virtual const LengthSpec *lengthSpec() const; enum QuantityType { noQuantity, longQuantity, doubleQuantity }; virtual QuantityType quantityValue(long &, double &, int &); virtual ELObj *resolveQuantities(bool force, Interpreter &, const Location &); virtual bool optSingletonNodeList(EvalContext &, Interpreter &, NodePtr &); static bool equal(ELObj &, ELObj &); // Note that in DSSSL2 unlike Scheme eqv? for lists and strings is the same // as equal?. Only for vectors do they differ. static bool eqv(ELObj &, ELObj &); protected: // This checks for equality of *distinct* objects. virtual bool isEqual(ELObj &); // This checks for equivalence of *distinct* objects. virtual bool isEquiv(ELObj &); }; class ErrorObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); private: ErrorObj(); friend class Interpreter; }; class UnspecifiedObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); private: UnspecifiedObj(); friend class Interpreter; }; class NilObj : public ELObj { public: bool isNil() const; bool isList() const; void print(Interpreter &, OutputCharStream &); private: NilObj(); friend class Interpreter; }; class TrueObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); private: TrueObj(); friend class Interpreter; }; class FalseObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); bool isTrue() const; private: FalseObj(); friend class Interpreter; }; class StringObj; class CharObj; class SymbolObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); SymbolObj *asSymbol(); StringObj *convertToString(); StringObj *name() const; void traceSubObjects(Collector &) const; FOTBuilder::Symbol cValue() const; void setCValue(FOTBuilder::Symbol); static const StringC &key(const SymbolObj &); private: SymbolObj(StringObj *); StringObj *name_; FOTBuilder::Symbol cValue_; friend class Interpreter; }; class Identifier; class KeywordObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); KeywordObj *asKeyword(); const Identifier *identifier() const; bool isEqual(ELObj &); private: KeywordObj(const Identifier *); const Identifier *ident_; friend class Interpreter; }; class PairObj : public ELObj { public: PairObj(ELObj *car, ELObj *cdr); ELObj *car(); ELObj *cdr(); void setCar(ELObj *); void setCdr(ELObj *); PairObj *asPair(); bool isList() const; void print(Interpreter &, OutputCharStream &); void traceSubObjects(Collector &) const; ELObj *resolveQuantities(bool force, Interpreter &, const Location &); bool isEqual(ELObj &); bool isEquiv(ELObj &); private: ELObj *car_; ELObj *cdr_; }; class VectorObj : public ELObj, public Vector { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } VectorObj(); VectorObj(Vector &v); void traceSubObjects(Collector &) const; VectorObj *asVector(); bool isEqual(ELObj &); bool isEquiv(ELObj &); void print(Interpreter &, OutputCharStream &); ELObj *resolveQuantities(bool force, Interpreter &, const Location &); }; class CharObj : public ELObj { public: Char ch(); void print(Interpreter &, OutputCharStream &); void display(Interpreter &, OutputCharStream &) const; bool isEqual(ELObj &); bool charValue(Char &); private: CharObj(Char); Char ch_; friend class Interpreter; }; class StringObj : public ELObj, public StringC { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } StringObj(); StringObj(const StringC &str); StringObj(const Char *, size_t); void print(Interpreter &, OutputCharStream &); StringObj *convertToString(); bool stringData(const Char *&, size_t &); bool isEqual(ELObj &); }; class IntegerObj : public ELObj { public: void print(Interpreter &, OutputCharStream &); void print(Interpreter &, OutputCharStream &, unsigned); bool exactIntegerValue(long &); bool realValue(double &); QuantityType quantityValue(long &, double &, int &); bool isEqual(ELObj &); private: friend class Interpreter; IntegerObj(); IntegerObj(long); long n_; }; class RealObj : public ELObj { public: RealObj(double); bool realValue(double &); bool inexactRealValue(double &); QuantityType quantityValue(long &, double &, int &); bool isEqual(ELObj &); void print(Interpreter &, OutputCharStream &); private: double n_; }; class LengthObj : public ELObj { public: LengthObj(long units); bool lengthValue(long &); QuantityType quantityValue(long &, double &, int &); void print(Interpreter &, OutputCharStream &); bool isEqual(ELObj &); private: long n_; }; class QuantityObj : public ELObj { public: QuantityObj(double, int); QuantityType quantityValue(long &, double &, int &); void print(Interpreter &, OutputCharStream &); bool isEqual(ELObj &); bool realValue(double &); bool inexactRealValue(double &); private: // This is in units per inch. double val_; int dim_; }; class LengthSpec { public: enum Unknown { displaySize = 1, tableUnit }; LengthSpec(); LengthSpec(double); LengthSpec(Unknown, double); void operator+=(const LengthSpec &); void operator+=(double d) { val_[0] += d; } void operator-=(const LengthSpec &); void operator-=(double d) { val_[0] -= d; } void operator*=(double); void operator/=(double); bool convert(FOTBuilder::LengthSpec &) const; bool convert(FOTBuilder::TableLengthSpec &) const; private: enum { nVals = 3 }; double val_[nVals]; }; class LengthSpecObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LengthSpecObj(const LengthSpec &); const LengthSpec *lengthSpec() const; private: Owner lengthSpec_; }; class DisplaySpaceObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } DisplaySpaceObj(const FOTBuilder::DisplaySpace &); const FOTBuilder::DisplaySpace &displaySpace() const; DisplaySpaceObj *asDisplaySpace(); private: Owner displaySpace_; }; class InlineSpaceObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } InlineSpaceObj(const FOTBuilder::InlineSpace &); const FOTBuilder::InlineSpace &inlineSpace() const; InlineSpaceObj *asInlineSpace(); private: Owner inlineSpace_; }; class UnresolvedQuantityObj : public ELObj { public: UnresolvedQuantityObj(double, Unit *, int); ELObj *resolveQuantities(bool force, Interpreter &, const Location &); private: double val_; Unit *unit_; int unitExp_; }; class UnresolvedLengthObj : public ELObj { public: UnresolvedLengthObj(long val, int valExp, Unit *); ELObj *resolveQuantities(bool force, Interpreter &, const Location &); private: long val_; Unit *unit_; int valExp_; }; class GlyphIdObj : public ELObj { public: GlyphIdObj(const FOTBuilder::GlyphId &); const FOTBuilder::GlyphId *glyphId() const; bool isEqual(ELObj &); private: FOTBuilder::GlyphId glyphId_; }; class GlyphSubstTableObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } GlyphSubstTableObj(const ConstPtr &); GlyphSubstTableObj *asGlyphSubstTable(); const ConstPtr &glyphSubstTable() const; private: ConstPtr table_; }; class AddressObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } AddressObj(FOTBuilder::Address::Type, const NodePtr & = NodePtr(), const StringC & = StringC(), const StringC & = StringC(), const StringC & = StringC()); AddressObj *asAddress(); const FOTBuilder::Address &address() const; private: Owner address_; }; class NodeListObj : public ELObj { public: NodeListObj *asNodeList(); bool optSingletonNodeList(EvalContext &, Interpreter &, NodePtr &); virtual NodePtr nodeListFirst(EvalContext &, Interpreter &) = 0; virtual NodeListObj *nodeListRest(EvalContext &, Interpreter &) = 0; virtual NodeListObj *nodeListNoOrder(Collector &); // If this node contains all the node in the chunk of the first node, then // this *may* return the node list containing the nodes following the chunk; // If so chunk, will be set to 1. Otherwise return nodeListRest() and set // chunk to 0. If charChunk() returns a string of length n, then // the chunk of the node is the node together with the n - 1 following siblings; // otherwise the chunk of the node is the node itself. virtual NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &chunk); virtual NodePtr nodeListRef(long, EvalContext &, Interpreter &); virtual NodeListObj *nodeListReverse(EvalContext &, Interpreter &); virtual long nodeListLength(EvalContext &, Interpreter &); virtual bool suppressError(); virtual bool contains(EvalContext &, Interpreter &, const NodePtr &); // check for a node of class id virtual bool contains(EvalContext &, Interpreter &, ComponentName::Id id); void print(Interpreter &, OutputCharStream &); }; class NamedNodeListObj : public NodeListObj { public: NamedNodeListObj *asNamedNodeList(); virtual NodePtr namedNode(const Char *, size_t) = 0; virtual bool nodeName(const NodePtr &, GroveString &) = 0; virtual size_t normalize(Char *, size_t) = 0; }; class NodePtrNodeListObj : public NodeListObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } NodePtrNodeListObj(); NodePtrNodeListObj(const NodePtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); bool optSingletonNodeList(EvalContext &, Interpreter &, NodePtr &); bool chunkComplete(); private: // Null for no node. NodePtr node_; }; class NodeListPtrNodeListObj : public NodeListObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } NodeListPtrNodeListObj(const NodeListPtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &); NodePtr nodeListRef(long, EvalContext &, Interpreter &); private: // never null NodeListPtr nodeList_; }; class NamedNodeListPtrNodeListObj : public NamedNodeListObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } NamedNodeListPtrNodeListObj(const NamedNodeListPtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodePtr namedNode(const Char *, size_t); bool nodeName(const NodePtr &, GroveString &); size_t normalize(Char *, size_t); NodeListObj *nodeListNoOrder(Collector &); private: NamedNodeListPtr namedNodeList_; // cached node list, null if not yet computed NodeListPtr nodeList_; }; class PairNodeListObj : public NodeListObj { public: PairNodeListObj(NodeListObj *, NodeListObj *); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &); void traceSubObjects(Collector &) const; bool contains(EvalContext &, Interpreter &, const NodePtr &); private: NodeListObj *head_; // may be null NodeListObj *tail_; }; class SubgroveSpecObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } SubgroveSpecObj(NodePtr node, NodePtr subgrove, SymbolObj *cls, ELObj *add, ELObj *null, ELObj *remove, ELObj *sub, ELObj *children, ELObj *label, FunctionObj *sort); SubgroveSpecObj *asSubgroveSpec(); ~SubgroveSpecObj(); void traceSubObjects(Collector &) const; private: struct SubgroveSpec { NodePtr node; NodePtr subgrove; SymbolObj *cls; ELObj *add; ELObj *null; ELObj *remove; ELObj *sub; ELObj *children; ELObj *label; FunctionObj *sort; }; SubgroveSpec *spec_; }; class CreateSpecObj : public ELObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } enum Type { root, sub, preced, follow, }; CreateSpecObj(Type t, ELObj *id, NodePtr node, SubgroveSpecObj *sg, StringObj *property, ELObj *label, FunctionObj *resultPath, bool optional, bool unique); ~CreateSpecObj(); CreateSpecObj *asCreateSpec(); void traceSubObjects(Collector &) const; private: struct CreateSpec { Type type; ELObj *groveId; NodePtr node; SubgroveSpecObj *sg; StringObj *property; ELObj *label; FunctionObj *resultPath; bool optional; bool unique; }; CreateSpec *spec_; }; inline bool ELObj::equal(ELObj &obj1, ELObj &obj2) { return &obj1 == &obj2 || obj1.isEqual(obj2); } inline bool ELObj::eqv(ELObj &obj1, ELObj &obj2) { return &obj1 == &obj2 || obj1.isEquiv(obj2); } inline ELObj *PairObj::car() { return car_; } inline ELObj *PairObj::cdr() { return cdr_; } inline void PairObj::setCar(ELObj *car) { car_ = car; } inline void PairObj::setCdr(ELObj *cdr) { cdr_ = cdr; } inline StringObj *SymbolObj::name() const { return name_; } inline FOTBuilder::Symbol SymbolObj::cValue() const { return cValue_; } inline void SymbolObj::setCValue(FOTBuilder::Symbol sym) { cValue_ = sym; } inline Char CharObj::ch() { return ch_; } inline const StringC &SymbolObj::key(const SymbolObj &sym) { return *sym.name(); } inline const Identifier *KeywordObj::identifier() const { return ident_; } inline const FOTBuilder::Address &AddressObj::address() const { return *address_; } inline const ConstPtr & GlyphSubstTableObj::glyphSubstTable() const { return table_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not ELObj_INCLUDED */ OpenJade-1.4devel/style/ELObjMessageArg.cxx0000644000021000000240000000111607025631170014301 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "ELObjMessageArg.h" #include "Interpreter.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif ELObjMessageArg::ELObjMessageArg(ELObj *obj, Interpreter &interp) : StringMessageArg(convert(obj, interp)) { } StringC ELObjMessageArg::convert(ELObj *obj, Interpreter &interp) { StrOutputCharStream os; obj->print(interp, os); StringC result; os.extractString(result); return result; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/ELObjMessageArg.h0000644000021000000240000000100307025631170013721 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef ELObjMessageArg_INCLUDED #define ELObjMessageArg_INCLUDED 1 #include "ELObj.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ELObjMessageArg : public StringMessageArg { public: ELObjMessageArg(ELObj *, Interpreter &); private: static StringC convert(ELObj *obj, Interpreter &interp); }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not ELObjMessageArg_INCLUDED */ OpenJade-1.4devel/style/ELObjPropVal.h0000644000021000000240000000500107025631170013270 // Copyright (c) 1999 Matthias Clasen // See the file copying.txt for copying permission. #ifndef ELObjPropVal_INCLUDED #define ELObjPropVal_INCLUDED 1 #include "Node.h" #include "ELObj.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ELObjPropertyValue : public PropertyValue { public: ELObjPropertyValue(Interpreter &interp, bool rcs) : interp_(&interp), rcs_(rcs), obj(0) { } void set(const NodePtr &nd) { obj = new (*interp_) NodePtrNodeListObj(nd); } void set(const NodeListPtr &nl) { obj = new (*interp_) NodeListPtrNodeListObj(nl); } void set(const NamedNodeListPtr &nnl) { obj = new (*interp_) NamedNodeListPtrNodeListObj(nnl); } void set(bool b) { if (b) obj = interp_->makeTrue(); else obj = interp_->makeFalse(); } void set(GroveChar c) { obj = interp_->makeChar(c); } void set(GroveString s) { obj = new (*interp_) StringObj(s.data(), s.size()); } void set(ComponentName::Id id) { const char *s = rcs_ ? ComponentName::rcsName(id) : ComponentName::sdqlName(id); obj = interp_->makeSymbol(interp_->makeStringC(s)); } void set(const GroveStringListPtr &gsListPtr) { PairObj *head = new (*interp_) PairObj(0, 0); ELObjDynamicRoot protect(*interp_, head); PairObj *tail = head; ConstGroveStringListIter sgListIter(*gsListPtr); while (!sgListIter.done()) { StringObj *gs = new (*interp_) StringObj(sgListIter.cur().data(), sgListIter.cur().size()); tail->setCdr(gs); PairObj *tem = new (*interp_) PairObj(gs, 0); tail->setCdr(tem); tail = tem; sgListIter.next(); } tail->setCdr(interp_->makeNil()); obj = head->cdr(); } void set(const ComponentName::Id *names) { PairObj *head = new (*interp_) PairObj(0, 0); ELObjDynamicRoot protect(*interp_, head); PairObj *tail = head; for (int i = 0; names[i] != ComponentName::noId; i++) { const char *s = (rcs_ ? ComponentName::rcsName(names[i]) : ComponentName::sdqlName(names[i])); SymbolObj *sym = interp_->makeSymbol(interp_->makeStringC(s)); tail->setCdr(sym); // in case we ever gc symbols PairObj *tem = new (*interp_) PairObj(sym, 0); tail->setCdr(tem); tail = tem; } tail->setCdr(interp_->makeNil()); obj = head->cdr(); } void set(long l) { obj = interp_->makeInteger(l); } ELObj *obj; private: Interpreter *interp_; bool rcs_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not ELObjPropVal_INCLUDED */ OpenJade-1.4devel/style/EvalContext.h0000644000021000000240000000307307025631170013274 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef EvalContext_INCLUDED #define EvalContext_INCLUDED 1 #include #include "Node.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class StyleStack; class StyleObj; class ProcessingMode; class LanguageObj; class EvalContext { public: class CurrentNodeSetter { public: CurrentNodeSetter(const NodePtr &, const ProcessingMode *, EvalContext &); ~CurrentNodeSetter(); private: EvalContext *ec_; NodePtr saveCurrentNode_; const ProcessingMode *saveProcessingMode_; }; EvalContext(); StyleStack *styleStack; unsigned specLevel; // level of the specification flow object in the style stack StyleObj *overridingStyle; Vector *actualDependencies; NodePtr currentNode; const ProcessingMode *processingMode; LanguageObj *currentLanguage; }; inline EvalContext::EvalContext() : styleStack(0), overridingStyle(0), actualDependencies(0), processingMode(0), currentLanguage(0) { } inline EvalContext::CurrentNodeSetter::CurrentNodeSetter(const NodePtr &node, const ProcessingMode *mode, EvalContext &ec) : ec_(&ec), saveCurrentNode_(ec.currentNode), saveProcessingMode_(ec.processingMode) { ec.currentNode = node; ec.processingMode = mode; } inline EvalContext::CurrentNodeSetter::~CurrentNodeSetter() { ec_->currentNode = saveCurrentNode_; ec_->processingMode = saveProcessingMode_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not EvalContext_INCLUDED */ OpenJade-1.4devel/style/Expression.cxx0000644000021000000240000012713507025631170013560 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "Insn.h" #include "Insn2.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "ELObjMessageArg.h" #include "Expression.h" #include "Style.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif Expression::Expression(const Location &loc) : loc_(loc) { } void Expression::optimize(Interpreter &, const Environment &, Owner &) { } ELObj *Expression::constantValue() const { return 0; } const Identifier *Expression::keyword() const { return 0; } void Expression::markBoundVars(BoundVarList &, bool) { } ConstantExpression::ConstantExpression(ELObj *obj, const Location &loc) : Expression(loc), obj_(obj) { } InsnPtr ConstantExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { return new ConstantInsn(obj_, new ResolveQuantitiesInsn(location(), next)); } void ConstantExpression::optimize(Interpreter &interp, const Environment &, Owner &expr) { ELObj *tem = obj_->resolveQuantities(0, interp, location()); if (tem) { interp.makePermanent(tem); expr = new ResolvedConstantExpression(tem, location()); } } bool ConstantExpression::canEval(bool) const { return 0; } const Identifier *ConstantExpression::keyword() const { const KeywordObj *k = obj_->asKeyword(); if (k) return k->identifier(); else return 0; } ResolvedConstantExpression::ResolvedConstantExpression(ELObj *obj, const Location &loc) : Expression(loc), obj_(obj) { } InsnPtr ResolvedConstantExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { return new ConstantInsn(obj_, next); } ELObj *ResolvedConstantExpression::constantValue() const { return obj_; } bool ResolvedConstantExpression::canEval(bool) const { return 1; } CallExpression::CallExpression(Owner &op, NCVector > &args, const Location &loc) : Expression(loc) { op.swap(op_); args.swap(args_); } bool CallExpression::canEval(bool) const { if (!op_->canEval(1)) return 0; for (size_t i = 0; i < args_.size(); i++) if (!args_[i]->canEval(1)) return 0; return 1; } int CallExpression::nArgs() { return args_.size(); } InsnPtr CallExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { op_->optimize(interp, env, op_); ELObj *value = op_->constantValue(); InsnPtr result; if (value) { FunctionObj *func = value->asFunction(); if (!func) { interp.setNextLocation(location()); interp.message(InterpreterMessages::callNonFunction, ELObjMessageArg(value, interp)); return new ErrorInsn; } if (nArgs() < func->nRequiredArgs()) { interp.setNextLocation(location()); interp.message(InterpreterMessages::missingArg); return new ErrorInsn; } if (nArgs() - func->nRequiredArgs() > func->nOptionalArgs()) { if (func->nKeyArgs()) { if ((nArgs() - func->nRequiredArgs() - func->nOptionalArgs()) & 1) { interp.setNextLocation(location()); interp.message(InterpreterMessages::oddKeyArgs); args_.resize(func->nRequiredArgs() + func->nOptionalArgs()); } } else if (!func->restArg()) { interp.setNextLocation(location()); interp.message(InterpreterMessages::tooManyArgs); args_.resize(func->nRequiredArgs() + func->nOptionalArgs()); } } int callerArgs; if (!next.isNull() && next->isReturn(callerArgs) && !interp.debugMode()) result = func->makeTailCallInsn(nArgs(), interp, location(), callerArgs); else result = func->makeCallInsn(nArgs(), interp, location(), next); } else { int n = nArgs(); int callerArgs; if (!next.isNull() && next->isReturn(callerArgs) && !interp.debugMode()) result = new TailApplyInsn(callerArgs, n, location()); else result = new ApplyInsn(n, location(), next); result = op_->compile(interp, env, stackPos + n, result); } for (size_t i = args_.size(); i > 0; i--) result = optimizeCompile(args_[i - 1], interp, env, stackPos + i - 1, result); return result; } void CallExpression::markBoundVars(BoundVarList &vars, bool shared) { op_->markBoundVars(vars, shared); for (size_t i = 0; i < args_.size(); i++) args_[i]->markBoundVars(vars, shared); } VariableExpression::VariableExpression(const Identifier *ident, const Location &loc) : Expression(loc), ident_(ident), isTop_(0) { } InsnPtr VariableExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { bool isFrame; int index; unsigned flags; if (env.lookup(ident_, isFrame, index, flags)) { bool boxed = BoundVar::flagsBoxed(flags); InsnPtr tem; int n; if (isFrame && !next.isNull() && next->isPopBindings(n, tem) && n == 1 && index - stackPos == -1) { if (flags & BoundVar::uninitFlag) tem = new CheckInitInsn(ident_, location(), tem); // This happens with named let. if (boxed) return new UnboxInsn(tem); else return tem; } if (flags & BoundVar::uninitFlag) tem = new CheckInitInsn(ident_, location(), next); else tem = next; if (boxed) tem = new UnboxInsn(tem); if (isFrame) return new StackRefInsn(index - stackPos, index, tem); else return new ClosureRefInsn(index, tem); } isTop_ = 1; Location loc; unsigned part; if (!ident_->defined(part, loc)) { interp.setNextLocation(location()); interp.message(InterpreterMessages::undefinedVariableReference, StringMessageArg(ident_->name())); return new ErrorInsn; } ident_->requireFeature(interp, location()); ELObj *val = ident_->computeValue(0, interp); if (!val) return new TopRefInsn(ident_, next); if (interp.isError(val)) return new ErrorInsn; return new ConstantInsn(val, next); } void VariableExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { bool isFrame; int index; unsigned flags; if (env.lookup(ident_, isFrame, index, flags)) return; isTop_ = 1; Location loc; unsigned part; if (ident_->defined(part, loc)) { ident_->requireFeature(interp, location()); ELObj *obj = ident_->computeValue(0, interp); if (obj && !interp.isError(obj)) { interp.makePermanent(obj); expr = new ConstantExpression(obj, location()); expr->optimize(interp, env, expr); } } } bool VariableExpression::canEval(bool) const { return !isTop_ || ident_->evaluated(); } void VariableExpression::markBoundVars(BoundVarList &vars, bool shared) { vars.mark(ident_, BoundVar::usedFlag | (shared ? BoundVar::sharedFlag : 0)); } IfExpression::IfExpression(Owner &test, Owner &consequent, Owner &alternate, const Location &loc) : Expression(loc) { test.swap(test_); consequent.swap(consequent_); alternate.swap(alternate_); } bool IfExpression::canEval(bool maybeCall) const { return (test_->canEval(maybeCall) && consequent_->canEval(maybeCall) && alternate_->canEval(maybeCall)); } void IfExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { test_->optimize(interp, env, test_); ELObj *obj = test_->constantValue(); if (obj) { if (obj->isTrue()) { expr = consequent_.extract(); expr->optimize(interp, env, expr); } else { expr = alternate_.extract(); expr->optimize(interp, env, expr); } } } InsnPtr IfExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { alternate_->optimize(interp, env, alternate_); if (alternate_->constantValue() == interp.makeFalse()) return test_->compile(interp, env, stackPos, new AndInsn(optimizeCompile(consequent_, interp, env, stackPos, next), next)); else return test_->compile(interp, env, stackPos, new TestInsn(optimizeCompile(consequent_, interp, env, stackPos, next), alternate_->compile(interp, env, stackPos, next))); } void IfExpression::markBoundVars(BoundVarList &vars, bool shared) { test_->markBoundVars(vars, shared); consequent_->markBoundVars(vars, shared); alternate_->markBoundVars(vars, shared); } OrExpression::OrExpression(Owner &test1, Owner &test2, const Location &loc) : Expression(loc) { test1.swap(test1_); test2.swap(test2_); } bool OrExpression::canEval(bool maybeCall) const { return (test1_->canEval(maybeCall) && test2_->canEval(maybeCall)); } void OrExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { test1_->optimize(interp, env, test1_); ELObj *obj = test1_->constantValue(); if (obj) { if (obj->isTrue()) expr = test1_.extract(); else { expr = test2_.extract(); expr->optimize(interp, env, expr); } } } InsnPtr OrExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { return test1_->compile(interp, env, stackPos, new OrInsn(optimizeCompile(test2_, interp, env, stackPos, next), next)); } void OrExpression::markBoundVars(BoundVarList &vars, bool shared) { test1_->markBoundVars(vars, shared); test2_->markBoundVars(vars, shared); } CondFailExpression::CondFailExpression(const Location &loc) : Expression(loc) { } InsnPtr CondFailExpression::compile(Interpreter &, const Environment &, int, const InsnPtr &) { return new CondFailInsn(location()); } bool CondFailExpression::canEval(bool maybeCall) const { return 1; } CaseExpression::CaseExpression(Owner &key, NCVector &cases, Owner &elseClause, const Location &loc) : Expression(loc) { key.swap(key_); cases.swap(cases_); elseClause.swap(else_); } InsnPtr CaseExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { InsnPtr finish; if (else_) finish = new PopInsn(else_->compile(interp, env, stackPos, next)); else finish = new CaseFailInsn(location()); for (size_t i = 0; i < cases_.size(); i++) { InsnPtr match = cases_[i].expr->compile(interp, env, stackPos, next); for (size_t j = 0; j < nResolved_[i]; j++) finish = new CaseInsn(cases_[i].datums[j], match, finish); } // FIXME handle unresolved quantities return key_->compile(interp, env, stackPos, finish); } void CaseExpression::markBoundVars(BoundVarList &vars, bool shared) { key_->markBoundVars(vars, shared); for (size_t i = 0; i < cases_.size(); i++) cases_[i].expr->markBoundVars(vars, shared); if (else_) else_->markBoundVars(vars, shared); } bool CaseExpression::canEval(bool maybeCall) const { if (!key_->canEval(maybeCall)) return 0; if (else_ && !else_->canEval(maybeCall)) return 0; for (size_t i = 0; i < cases_.size(); i++) { if (!cases_[i].expr->canEval(maybeCall)) return 0; if (nResolved_[i] == cases_[i].datums.size()) return 0; } return 1; } void CaseExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { key_->optimize(interp, env, key_); ELObj *k = key_->constantValue(); nResolved_.assign(cases_.size(), 0); bool unresolved = 0; for (size_t i = 0; i < cases_.size(); i++) { cases_[i].expr->optimize(interp, env, cases_[i].expr); int nResolved = 0; for (size_t j = 0; j < cases_[i].datums.size(); j++) { ELObj *tem = cases_[i].datums[j]->resolveQuantities(0, interp, location()); if (tem) { if (k && ELObj::eqv(*k, *tem)) { expr = cases_[i].expr.extract(); return; } if (j != nResolved) cases_[i].datums[j] = cases_[i].datums[nResolved]; cases_[i].datums[nResolved++] = tem; } else unresolved = 1; } nResolved_[i] = nResolved; } if (else_) { else_->optimize(interp, env, else_); if (k && !unresolved) expr = else_.extract(); } else if (k && !unresolved) { interp.setNextLocation(location()); interp.message(InterpreterMessages::caseFail, ELObjMessageArg(k, interp)); } if (unresolved) { interp.setNextLocation(location()); interp.message(InterpreterMessages::caseUnresolvedQuantities); } } LambdaExpression::LambdaExpression(Vector &formals, NCVector > &inits, int nOptional, bool hasRest, int nKey, Owner &body, const Location &loc) : Expression(loc) { formals.swap(formals_); inits.swap(inits_); body.swap(body_); sig_.nRequiredArgs = formals_.size() - nOptional - nKey - hasRest; sig_.nOptionalArgs = nOptional; sig_.restArg = hasRest; sig_.nKeyArgs = nKey; sig_.keys = formals_.begin() + formals_.size() - nKey; } bool LambdaExpression::canEval(bool maybeCall) const { if (!maybeCall) return 1; if (!body_->canEval(1)) return 0; for (size_t i = 0; i < inits_.size(); i++) if (inits_[i] && !inits_[i]->canEval(1)) return 0; return 1; } InsnPtr LambdaExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { BoundVarList boundVars; env.boundVars(boundVars); markBoundVars(boundVars, 0); boundVars.removeUnused(); BoundVarList formalVars(formals_, sig_.nRequiredArgs); for (int i = 0; i < sig_.nOptionalArgs + sig_.nKeyArgs; i++) { if (inits_[i]) inits_[i]->markBoundVars(formalVars, 0); formalVars.append(formals_[sig_.nRequiredArgs + i], 0); } if (sig_.restArg) formalVars.append(formals_.back(), 0); ASSERT(formalVars.size() == formals_.size()); body_->markBoundVars(formalVars, 0); InsnPtr code = optimizeCompile(body_, interp, Environment(formalVars, boundVars), formals_.size(), new ReturnInsn(formals_.size())); if (sig_.nOptionalArgs || sig_.restArg || sig_.nKeyArgs) { Vector entryPoints(sig_.nOptionalArgs + (sig_.restArg || sig_.nKeyArgs) + 1); // First entry point is for only required args supplied // Next entry is for one optional arg supplied, no rest arg // Next entry is for two optional args, no rest arg // .. // Next entry is for all optional args, no other args // Last entry is for all optional args supplied, and other args // (for this entry point all args are pushed; unspecified // keyword args are bound to 0). entryPoints.back() = code; // Box the rest arg if necessary. if (sig_.restArg && formalVars.back().boxed()) entryPoints.back() = new BoxStackInsn(-1 - sig_.nKeyArgs, entryPoints.back()); if (sig_.nKeyArgs) { // For each keyword argument test whether it is 0, // and if so initialize it. for (int i = sig_.nOptionalArgs + sig_.nKeyArgs - 1; i >= sig_.nOptionalArgs; i--) { int offset = i - (sig_.nOptionalArgs + sig_.nKeyArgs); InsnPtr &next = entryPoints.back(); InsnPtr set(new SetKeyArgInsn(offset, next)); if (formalVars[sig_.nRequiredArgs + i].boxed()) set = new BoxInsn(set); if (inits_[i]) { BoundVarList f(formalVars); f.resize(sig_.nRequiredArgs + i + sig_.restArg); set = optimizeCompile(inits_[i], interp, Environment(f, boundVars), formals_.size(), set); } else set = new ConstantInsn(interp.makeFalse(), set); next = new TestNullInsn(offset, set, next); } } if (sig_.restArg || sig_.nKeyArgs) { for (int i = sig_.nOptionalArgs + sig_.nKeyArgs - 1; i >= sig_.nOptionalArgs; i--) { if (formalVars[sig_.nRequiredArgs + i].boxed()) code = new BoxInsn(code); if (inits_[i]) { BoundVarList f(formalVars); f.resize(sig_.nRequiredArgs + i + sig_.restArg); code = optimizeCompile(inits_[i], interp, Environment(f, boundVars), f.size(), code); } else code = new ConstantInsn(interp.makeFalse(), code); } if (sig_.restArg) { if (formalVars.back().boxed()) code = new BoxInsn(code); code = new ConstantInsn(interp.makeNil(), code); } entryPoints[sig_.nOptionalArgs] = code; } for (int i = sig_.nOptionalArgs - 1; i >= 0; i--) { InsnPtr tem(entryPoints[i + 1]); if (formalVars[sig_.nRequiredArgs + i].boxed()) tem = new BoxInsn(tem); if (inits_[i]) { BoundVarList f(formalVars); f.resize(sig_.nRequiredArgs + i); entryPoints[i] = optimizeCompile(inits_[i], interp, Environment(f, boundVars), f.size(), tem); } else entryPoints[i] = new ConstantInsn(interp.makeFalse(), tem); } for (int i = 0; i < sig_.nOptionalArgs; i++) { if (formalVars[sig_.nRequiredArgs + i].boxed()) { for (int j = i; j < sig_.nOptionalArgs; j++) entryPoints[j + 1] = new BoxArgInsn(i + sig_.nRequiredArgs, entryPoints[j + 1]); if (sig_.nKeyArgs || sig_.restArg) entryPoints.back() = new BoxStackInsn(i - sig_.nKeyArgs - sig_.restArg - sig_.nOptionalArgs, entryPoints.back()); } } code = new VarargsInsn(sig_, entryPoints, location()); } for (int i = 0; i < sig_.nRequiredArgs; i++) if (formalVars[i].boxed()) code = new BoxArgInsn(i, code); return compilePushVars(interp, env, stackPos, boundVars, 0, new ClosureInsn(&sig_, code, boundVars.size(), next)); } InsnPtr Expression::compilePushVars(Interpreter &interp, const Environment &env, int stackPos, const BoundVarList &vars, size_t varIndex, const InsnPtr &next) { if (varIndex >= vars.size()) return next; bool isFrame; int index; unsigned flags; if (!env.lookup(vars[varIndex].ident, isFrame, index, flags)) CANNOT_HAPPEN(); if (isFrame) return new FrameRefInsn(index, compilePushVars(interp, env, stackPos + 1, vars, varIndex + 1, next)); else return new ClosureRefInsn(index, compilePushVars(interp, env, stackPos + 1, vars, varIndex + 1, next)); } void LambdaExpression::markBoundVars(BoundVarList &vars, bool shared) { for (int i = 0; i < sig_.nOptionalArgs + sig_.nKeyArgs; i++) if (inits_[i]) { Vector f(formals_); f.resize(sig_.nRequiredArgs + i + (sig_.restArg && i >= sig_.nOptionalArgs)); vars.rebind(f); inits_[i]->markBoundVars(vars, 1); vars.unbind(f); } vars.rebind(formals_); body_->markBoundVars(vars, 1); vars.unbind(formals_); } LetExpression::LetExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &loc) : Expression(loc) { vars.swap(vars_); inits.swap(inits_); body.swap(body_); } bool LetExpression::canEval(bool maybeCall) const { if (!body_->canEval(maybeCall)) return 0; for (size_t i = 0; i < inits_.size(); i++) if (!inits_[i]->canEval(1)) return 0; return 1; } InsnPtr LetExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { int nVars = vars_.size(); Environment bodyEnv(env); BoundVarList boundVars(vars_); body_->markBoundVars(boundVars, 0); bodyEnv.augmentFrame(boundVars, stackPos); return compileInits(interp, env, boundVars, 0, stackPos, optimizeCompile(body_, interp, bodyEnv, stackPos + nVars, PopBindingsInsn::make(nVars, next))); } InsnPtr LetExpression::compileInits(Interpreter &interp, const Environment &env, const BoundVarList &initVars, size_t initIndex, int stackPos, const InsnPtr &next) { if (initIndex >= inits_.size()) return next; InsnPtr tem = compileInits(interp, env, initVars, initIndex + 1, stackPos + 1, next); if (initVars[initIndex].boxed()) tem = new BoxInsn(tem); return optimizeCompile(inits_[initIndex], interp, env, stackPos, tem); } void LetExpression::markBoundVars(BoundVarList &vars, bool shared) { for (size_t i = 0; i < inits_.size(); i++) inits_[i]->markBoundVars(vars, shared); vars.rebind(vars_); body_->markBoundVars(vars, shared); vars.unbind(vars_); } LetStarExpression::LetStarExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &loc) : LetExpression(vars, inits, body, loc) { } InsnPtr LetStarExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { int nVars = vars_.size(); Environment bodyEnv(env); BoundVarList vars; for (int i = 0; i < nVars; i++) { if (i > 0) inits_[i]->markBoundVars(vars, 0); vars.append(vars_[i], 0); } body_->markBoundVars(vars, 0); bodyEnv.augmentFrame(vars, stackPos); return compileInits(interp, env, vars, 0, stackPos, optimizeCompile(body_, interp, bodyEnv, stackPos + vars_.size(), PopBindingsInsn::make(nVars, next))); } InsnPtr LetStarExpression::compileInits(Interpreter &interp, const Environment &env, const BoundVarList &initVars, size_t initIndex, int stackPos, const InsnPtr &next) { if (initIndex >= inits_.size()) return next; Environment nextEnv(env); BoundVarList vars; vars.append(initVars[initIndex].ident, initVars[initIndex].flags); nextEnv.augmentFrame(vars, stackPos); InsnPtr tem = compileInits(interp, nextEnv, initVars, initIndex + 1, stackPos + 1, next); if (initVars[initIndex].boxed()) tem = new BoxInsn(tem); return optimizeCompile(inits_[initIndex], interp, env, stackPos, tem); } LetrecExpression::LetrecExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &loc) : Expression(loc) { vars.swap(vars_); inits.swap(inits_); body.swap(body_); } bool LetrecExpression::canEval(bool maybeCall) const { if (!body_->canEval(maybeCall)) return 0; for (size_t i = 0; i < inits_.size(); i++) if (!inits_[i]->canEval(1)) return 0; return 1; } InsnPtr LetrecExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { int nVars = vars_.size(); BoundVarList vars(vars_, nVars, BoundVar::assignedFlag); Environment bodyEnv(env); for (size_t i = 0; i < nVars; i++) inits_[i]->markBoundVars(vars, 0); body_->markBoundVars(vars, 0); bodyEnv.augmentFrame(vars, stackPos); InsnPtr tem = optimizeCompile(body_, interp, bodyEnv, stackPos + nVars, PopBindingsInsn::make(nVars, next)); for (size_t i = 0; i < nVars; i++) vars[i].flags |= BoundVar::uninitFlag; for (int i = 0; i < nVars; i++) { if (vars[i].boxed()) tem = new SetBoxInsn(nVars, tem); else tem = new SetImmediateInsn(nVars, tem); } tem = compileInits(interp, bodyEnv, 0, stackPos + nVars, tem); for (int i = nVars; i > 0; --i) { if (vars[i - 1].boxed()) tem = new BoxInsn(tem); tem = new ConstantInsn(0, tem); } return tem; } InsnPtr LetrecExpression::compileInits(Interpreter &interp, const Environment &env, size_t initIndex, int stackPos, const InsnPtr &next) { if (initIndex >= inits_.size()) return next; return optimizeCompile(inits_[initIndex], interp, env, stackPos, compileInits(interp, env, initIndex + 1, stackPos + 1, next)); } void LetrecExpression::markBoundVars(BoundVarList &vars, bool shared) { vars.rebind(vars_); for (size_t i = 0; i < inits_.size(); i++) inits_[i]->markBoundVars(vars, shared); body_->markBoundVars(vars, shared); vars.unbind(vars_); } QuasiquoteExpression::QuasiquoteExpression(NCVector > &members, Vector &spliced, Type type, const Location &loc) : Expression(loc), spliced_(spliced), type_(type) { members.swap(members_); } InsnPtr QuasiquoteExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { InsnPtr tem(next); size_t n = members_.size(); if (type_ == vectorType) { bool splicy = 0; for (size_t i = 0; i < n; i++) { if (spliced_[i]) { splicy = 1; break; } } if (!splicy) { tem = new VectorInsn(n, tem); for (size_t i = n; i > 0; i--) tem = members_[i - 1]->compile(interp, env, stackPos + (i - 1), tem); return tem; } tem = new ListToVectorInsn(tem); } else if (type_ == improperType) n--; for (size_t i = 0; i < n; i++) { if (spliced_[i]) tem = new AppendInsn(location(), tem); else tem = new ConsInsn(tem); tem = members_[i]->compile(interp, env, stackPos + 1, tem); } if (type_ == improperType) tem = members_.back()->compile(interp, env, stackPos, tem); else tem = new ConstantInsn(interp.makeNil(), tem); return tem; } void QuasiquoteExpression::markBoundVars(BoundVarList &vars, bool shared) { for (size_t i = 0; i < members_.size(); i++) members_[i]->markBoundVars(vars, shared); } bool QuasiquoteExpression::canEval(bool maybeCall) const { for (size_t i = 0; i < members_.size(); i++) if (!members_[i]->canEval(maybeCall)) return 0; return 1; } void QuasiquoteExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { for (size_t i = 0; i < members_.size(); i++) members_[i]->optimize(interp, env, members_[i]); if (type_ == vectorType) return; if (members_.size() == 0) { expr = new ResolvedConstantExpression(interp.makeNil(), location()); return; } ELObj *tail = members_.back()->constantValue(); if (!tail) return; ASSERT(!(spliced_.back() && type_ == improperType)); if (type_ != improperType && !spliced_.back()) { tail = interp.makePair(tail, interp.makeNil()); interp.makePermanent(tail); } for (size_t i = members_.size() - 1; i-- > 0;) { ELObj *tem = members_[i]->constantValue(); // FIXME optimize splice as well if (!tem || spliced_[i]) { members_.resize(i + 2); type_ = improperType; members_[i + 1] = new ResolvedConstantExpression(tail, location()); return; } tail = interp.makePair(tem, tail); interp.makePermanent(tail); } expr = new ResolvedConstantExpression(tail, location()); } SequenceExpression::SequenceExpression(NCVector > &sequence, const Location &loc) : Expression(loc) { ASSERT(sequence.size() > 0); sequence.swap(sequence_); } InsnPtr SequenceExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { // FIXME optimize this InsnPtr result(sequence_.back()->compile(interp, env, stackPos, next)); for (size_t i = sequence_.size() - 1; i > 0; i--) result = sequence_[i - 1]->compile(interp, env, stackPos, new PopInsn(result)); return result; } void SequenceExpression::markBoundVars(BoundVarList &vars, bool shared) { for (size_t i = 0; i < sequence_.size(); i++) sequence_[i]->markBoundVars(vars, shared); } bool SequenceExpression::canEval(bool maybeCall) const { for (size_t i = 0; i < sequence_.size(); i++) if (!sequence_[i]->canEval(maybeCall)) return 0; return 1; } void SequenceExpression::optimize(Interpreter &interp, const Environment &env, Owner &expr) { size_t j = 0; for (size_t i = 0;; i++) { if (j != i) sequence_[j].swap(sequence_[i]); sequence_[j]->optimize(interp, env, sequence_[j]); if (i == sequence_.size() - 1) break; if (!sequence_[j]->constantValue()) j++; } if (j == 0) sequence_[0].swap(expr); else sequence_.resize(j + 1); } AssignmentExpression::AssignmentExpression(const Identifier *var, Owner &value, const Location &loc) : Expression(loc), var_(var) { value.swap(value_); } InsnPtr AssignmentExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { bool isFrame; int index; unsigned flags; if (!env.lookup(var_, isFrame, index, flags)) { interp.setNextLocation(location()); unsigned part; Location loc; if (var_->defined(part, loc)) interp.message(InterpreterMessages::topLevelAssignment, StringMessageArg(var_->name())); else interp.message(InterpreterMessages::undefinedVariableReference, StringMessageArg(var_->name())); return new ErrorInsn; } InsnPtr result; if (flags & BoundVar::uninitFlag) result = new CheckInitInsn(var_, location(), next); else result = next; if (isFrame) { if (BoundVar::flagsBoxed(flags)) result = new StackSetBoxInsn(index - (stackPos + 1), index, location(), result); else result = new StackSetInsn(index - (stackPos + 1), index, result); } else { ASSERT(BoundVar::flagsBoxed(flags)); result = new ClosureSetBoxInsn(index, location(), result); } return optimizeCompile(value_, interp, env, stackPos, result); } void AssignmentExpression::markBoundVars(BoundVarList &vars, bool shared) { vars.mark(var_, (BoundVar::usedFlag |BoundVar::assignedFlag |(shared ? BoundVar::sharedFlag : 0))); value_->markBoundVars(vars, shared); } bool AssignmentExpression::canEval(bool maybeCall) const { return value_->canEval(maybeCall); } WithModeExpression::WithModeExpression(const ProcessingMode *mode, Owner &expr, const Location &loc) : Expression(loc), mode_(mode) { expr.swap(expr_); } InsnPtr WithModeExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { if (!mode_->defined()) { interp.setNextLocation(location()); interp.message(InterpreterMessages::undefinedMode, StringMessageArg(mode_->name())); } return new PushModeInsn(mode_, optimizeCompile(expr_, interp, env, stackPos, new PopModeInsn(next))); } void WithModeExpression::markBoundVars(BoundVarList &vars, bool shared) { expr_->markBoundVars(vars, shared); } bool WithModeExpression::canEval(bool maybeCall) const { return expr_->canEval(maybeCall); } StyleExpression::StyleExpression(Vector &keys, NCVector > &exprs, const Location &loc) : Expression(loc) { keys.swap(keys_); exprs.swap(exprs_); } // Interpret keywords in the following order of preference // 1. non-inherited characteristics // 2. DSSSL defined meaning (use: content-map:) etc // 3. inherited characteristics InsnPtr StyleExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { Vector > ics; Vector > forceIcs; Vector forceKeys(keys_.size()); for (size_t i = 0; i < keys_.size(); i++) { forceKeys[i] = 0; if (keys_[i]->name().size() > 6) { StringC prefix(keys_[i]->name().data(), 6); if (prefix == interp.makeStringC("force!")) { StringC name(keys_[i]->name().data() + 6, keys_[i]->name().size() - 6); forceKeys[i] = interp.lookup(name); } } } bool hasUse = 0; size_t useIndex; BoundVarList boundVars; env.boundVars(boundVars); for (size_t i = 0; i < keys_.size(); i++) { Identifier::SyntacticKey sk; if (forceKeys[i] && maybeStyleKeyword(forceKeys[i]) && !forceKeys[i]->inheritedC().isNull()) { forceIcs.resize(forceIcs.size() + 1); exprs_[i]->markBoundVars(boundVars, 0); } else if (maybeStyleKeyword(keys_[i]) && !(keys_[i]->syntacticKey(sk) && sk == Identifier::keyUse) && !keys_[i]->inheritedC().isNull()) { ics.resize(ics.size() + 1); exprs_[i]->markBoundVars(boundVars, 0); } } // FIXME optimize case where ics.size() == 0 boundVars.removeUnused(); BoundVarList noVars; Environment newEnv(noVars, boundVars); size_t j = 0; size_t k = 0; for (size_t i = 0; i < keys_.size(); i++) { Identifier::SyntacticKey sk; if (forceKeys[i] && maybeStyleKeyword(forceKeys[i]) && !forceKeys[i]->inheritedC().isNull()) { exprs_[i]->optimize(interp, newEnv, exprs_[i]); ELObj *val = exprs_[i]->constantValue(); if (val) { interp.makePermanent(val); forceIcs[k] = forceKeys[i]->inheritedC()->make(val, exprs_[i]->location(), interp); if (forceIcs[k].isNull()) forceIcs.resize(forceIcs.size() - 1); else k++; } else { forceIcs[k++] = new VarInheritedC(forceKeys[i]->inheritedC(), exprs_[i]->compile(interp, newEnv, 0, InsnPtr()), exprs_[i]->location()); } } else if (!maybeStyleKeyword(keys_[i])) ; else if (keys_[i]->syntacticKey(sk) && sk == Identifier::keyUse) { if (!hasUse) { hasUse = 1; useIndex = i; } } else if (!keys_[i]->inheritedC().isNull()) { exprs_[i]->optimize(interp, newEnv, exprs_[i]); ELObj *val = exprs_[i]->constantValue(); if (val) { interp.makePermanent(val); ics[j] = keys_[i]->inheritedC()->make(val, exprs_[i]->location(), interp); if (ics[j].isNull()) ics.resize(ics.size() - 1); else j++; } else { ics[j++] = new VarInheritedC(keys_[i]->inheritedC(), exprs_[i]->compile(interp, newEnv, 0, InsnPtr()), exprs_[i]->location()); } } else unknownStyleKeyword(keys_[i], interp, location()); } InsnPtr result = compilePushVars(interp, env, stackPos + hasUse, boundVars, 0, new VarStyleInsn(new StyleSpec(forceIcs, ics), boundVars.size(), hasUse, new MaybeOverrideStyleInsn(next))); if (!hasUse) return result; else { result = new CheckStyleInsn(location(), result); return optimizeCompile(exprs_[useIndex], interp, env, stackPos, result); } } void StyleExpression::markBoundVars(BoundVarList &vars, bool shared) { for (size_t i = 0; i < exprs_.size(); i++) exprs_[i]->markBoundVars(vars, 1); } bool StyleExpression::canEval(bool maybeCall) const { for (size_t i = 0; i < exprs_.size(); i++) if (!exprs_[i]->canEval(maybeCall)) return 0; return 1; } void StyleExpression::unknownStyleKeyword(const Identifier *ident, Interpreter &interp, const Location &loc) const { interp.setNextLocation(loc); StringC tem(ident->name()); tem += Char(':'); interp.message(InterpreterMessages::invalidStyleKeyword, StringMessageArg(tem)); } bool StyleExpression::maybeStyleKeyword(const Identifier *ident) const { return 1; } MakeExpression::MakeExpression(const Identifier *foc, Vector &keys, NCVector > &exprs, const Location &loc) : foc_(foc), StyleExpression(keys, exprs, loc) { } InsnPtr MakeExpression::compile(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { FlowObj *flowObj = foc_->flowObj(); if (!flowObj) { interp.setNextLocation(location()); interp.message(InterpreterMessages::unknownFlowObjectClass, StringMessageArg(foc_->name())); flowObj = new (interp) SequenceFlowObj; interp.makePermanent(flowObj); } foc_->requireFeature(interp, location(), 1); Owner *contentMapExpr = 0; InsnPtr rest(next); for (size_t i = 0; i < keys_.size(); i++) { Identifier::SyntacticKey syn; if (!flowObj->hasNonInheritedC(keys_[i]) && keys_[i]->syntacticKey(syn)) { if (syn == Identifier::keyLabel) rest = optimizeCompile(exprs_[i], interp, env, stackPos + 1, new LabelSosofoInsn(exprs_[i]->location(), rest)); else if (syn == Identifier::keyContentMap) contentMapExpr = &exprs_[i]; } } flowObj = applyConstNonInheritedCs(flowObj, interp, env); size_t nContent = exprs_.size() - keys_.size(); CompoundFlowObj *cFlowObj = flowObj->asCompoundFlowObj(); if (!cFlowObj && nContent > 0) { interp.setNextLocation(location()); interp.message(InterpreterMessages::atomicContent, StringMessageArg(foc_->name())); nContent = 0; } rest = compileNonInheritedCs(interp, env, stackPos + 1, rest); for (size_t i = 0; i < keys_.size(); i++) { if (flowObj->hasPseudoNonInheritedC(keys_[i]) && !exprs_[i]->constantValue()) { rest = exprs_[i]->compile(interp, env, stackPos + 1, new SetPseudoNonInheritedCInsn(keys_[i], exprs_[i]->location(), rest)); } } // FIXME optimize case where there are no non-inherited styles. rest = StyleExpression::compile(interp, env, stackPos + 1, new SetStyleInsn(rest)); if (nContent == 0 && !contentMapExpr) { if (cFlowObj) return new SetDefaultContentInsn(cFlowObj, location(), rest); else return new CopyFlowObjInsn(flowObj, location(), rest); } rest = new SetContentInsn(cFlowObj, location(), rest); if (contentMapExpr) { rest = optimizeCompile(*contentMapExpr, interp, env, stackPos + 1, new ContentMapSosofoInsn((*contentMapExpr)->location(), rest)); if (nContent == 0) return new MakeDefaultContentInsn(location(), rest); } // FIXME get rid of CheckSosofoInsn if we can guarantee result is a SosofoObj. if (nContent == 1) return optimizeCompile(exprs_.back(), interp, env, stackPos, new CheckSosofoInsn(exprs_.back()->location(), rest)); rest = new SosofoAppendInsn(nContent, rest); for (size_t i = 1; i <= nContent; i++) rest = optimizeCompile(exprs_[exprs_.size() - i], interp, env, stackPos + nContent - i, new CheckSosofoInsn(exprs_[exprs_.size() - i]->location(), rest)); return rest; } FlowObj *MakeExpression::applyConstNonInheritedCs(FlowObj *flowObj, Interpreter &interp, const Environment &env) { FlowObj *result = flowObj; for (size_t i = 0; i < keys_.size(); i++) if (flowObj->hasNonInheritedC(keys_[i]) || flowObj->hasPseudoNonInheritedC(keys_[i])) { exprs_[i]->optimize(interp, env, exprs_[i]); ELObj *val = exprs_[i]->constantValue(); if (val) { if (result == flowObj) { result = flowObj->copy(interp); interp.makePermanent(result); } result->setNonInheritedC(keys_[i], val, exprs_[i]->location(), interp); } } return result; } // Have a copied flow object on the stack. // Generate code to set its non-constant, non-inherited characteristics. InsnPtr MakeExpression::compileNonInheritedCs(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { FlowObj *flowObj = foc_->flowObj(); if (!flowObj) return next; bool gotOne = flowObj->isCharacter(); BoundVarList boundVars; env.boundVars(boundVars); for (size_t i = 0; i < keys_.size(); i++) { if (flowObj->hasNonInheritedC(keys_[i]) && !exprs_[i]->constantValue()) { exprs_[i]->markBoundVars(boundVars, 0); gotOne = 1; } } if (!gotOne) return next; boundVars.removeUnused(); BoundVarList noVars; Environment newEnv(noVars, boundVars); InsnPtr code; for (size_t i = 0; i < keys_.size(); i++) if (flowObj->hasNonInheritedC(keys_[i]) && !exprs_[i]->constantValue()) code = exprs_[i]->compile(interp, newEnv, 1, new SetNonInheritedCInsn(keys_[i], exprs_[i]->location(), code)); InsnPtr rest(new SetNonInheritedCsSosofoInsn(code, boundVars.size(), next)); if (flowObj->isCharacter()) rest = new SetImplicitCharInsn(location(), rest); return compilePushVars(interp, env, stackPos, boundVars, 0, rest); } void MakeExpression::unknownStyleKeyword(const Identifier *ident, Interpreter &interp, const Location &loc) const { FlowObj *flowObj = foc_->flowObj(); if (!flowObj) return; Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch(key) { case Identifier::keyLabel: case Identifier::keyContentMap: return; default: break; } } if (flowObj->hasNonInheritedC(ident) || flowObj->hasPseudoNonInheritedC(ident)) return; interp.setNextLocation(loc); StringC tem(ident->name()); tem += Char(':'); interp.message(InterpreterMessages::invalidMakeKeyword, StringMessageArg(tem), StringMessageArg(foc_->name())); } bool MakeExpression::maybeStyleKeyword(const Identifier *ident) const { FlowObj *flowObj = foc_->flowObj(); if (!flowObj) return 1; return (!flowObj->hasNonInheritedC(ident) && !flowObj->hasPseudoNonInheritedC(ident)); } Environment::Environment() : closureVars_(0) { } Environment::Environment(const BoundVarList &frameVars, const BoundVarList &closureVars) : closureVars_(&closureVars) { FrameVarList *tem = new FrameVarList; frameVarList_ = tem; tem->vars = &frameVars; tem->stackPos = 0; } void Environment::boundVars(BoundVarList &result) const { if (closureVars_) { for (size_t i = 0; i < closureVars_->size(); i++) result.append((*closureVars_)[i].ident, (*closureVars_)[i].flags); } for (const FrameVarList *f = frameVarList_.pointer(); f; f = f->next.pointer()) { for (size_t i = 0; i < f->vars->size(); i++) result.append((*f->vars)[i].ident, (*f->vars)[i].flags); } } bool Environment::lookup(const Identifier *ident, bool &isFrame, int &index, unsigned &flags) const { for (const FrameVarList *p = frameVarList_.pointer(); p; p = p->next.pointer()) { for (size_t i = 0; i < p->vars->size(); i++) if ((*p->vars)[i].ident == ident) { isFrame = true; index = i + p->stackPos; flags = (*p->vars)[i].flags; return true; } } if (closureVars_) { for (size_t i = 0; i < closureVars_->size(); i++) if ((*closureVars_)[i].ident == ident) { isFrame = false; index = i; flags = (*closureVars_)[i].flags; return true; } } return false; } void Environment::augmentFrame(const BoundVarList &vars, int stackPos) { FrameVarList *tem = new FrameVarList; tem->stackPos = stackPos; tem->vars = &vars; tem->next = frameVarList_; frameVarList_ = tem; } BoundVarList::BoundVarList(const Vector &idents) : Vector(idents.size()) { for (size_t i = 0; i < size(); i++) { BoundVar &tem = (*this)[i]; tem.ident = idents[i]; tem.reboundCount = 0; tem.flags = 0; } } BoundVarList::BoundVarList(const Vector &idents, size_t n, unsigned flags) : Vector(n) { for (size_t i = 0; i < n; i++) { BoundVar &tem = (*this)[i]; tem.ident = idents[i]; tem.reboundCount = 0; tem.flags = (flags & ~BoundVar::usedFlag); } } void BoundVarList::append(const Identifier *id, unsigned flags) { resize(size() + 1); BoundVar &tem = back(); tem.ident = id; tem.flags = (flags & ~BoundVar::usedFlag); tem.reboundCount = 0; } void BoundVarList::remove(const Vector &idents) { size_t j = 0; for (size_t i = 0; i < size(); i++) { const Identifier *ident = (*this)[i].ident; for (size_t k = 0;; k++) { if (k >= idents.size()) { if (j != i) (*this)[j] = (*this)[i]; j++; break; } if (idents[k] == ident) break; // skip it } } resize(j); } void BoundVarList::removeUnused() { size_t j = 0; for (size_t i = 0; i < size(); i++) { if ((*this)[i].flags & BoundVar::usedFlag) { if (j != i) (*this)[j] = (*this)[i]; j++; } } resize(j); } void BoundVarList::mark(const Identifier *ident, unsigned flags) { BoundVar *bv = find(ident); if (bv && !bv->reboundCount) bv->flags |= flags; } void BoundVarList::rebind(const Vector &idents) { for (size_t i = 0; i < idents.size(); i++) { BoundVar *bv = find(idents[i]); if (bv) bv->reboundCount += 1; } } void BoundVarList::unbind(const Vector &idents) { for (size_t i = 0; i < idents.size(); i++) { BoundVar *bv = find(idents[i]); if (bv) bv->reboundCount -= 1; } } BoundVar *BoundVarList::find(const Identifier *ident) { for (size_t i = 0; i < size(); i++) if ((*this)[i].ident == ident) return &(*this)[i]; return 0; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Expression.h0000644000021000000240000002710607025631170013202 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Expression_INCLUDED #define Expression_INCLUDED 1 #include "ELObj.h" #include #include #include #include #include #include "Insn.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Interpreter; class Identifier; struct BoundVar { const Identifier *ident; enum { usedFlag = 01, assignedFlag = 02, sharedFlag = 04, uninitFlag = 010, boxedFlags = assignedFlag|sharedFlag }; static bool flagsBoxed(unsigned f) { return (f & boxedFlags) == boxedFlags; } bool boxed() const { return flagsBoxed(flags); } unsigned flags; unsigned reboundCount; }; class BoundVarList : public Vector { public: BoundVarList() { } BoundVarList(const Vector &); BoundVarList(const Vector &, size_t, unsigned flags = 0); void append(const Identifier *, unsigned flags); void mark(const Identifier *, unsigned flags); void removeUnused(); void remove(const Vector &); void rebind(const Vector &); void unbind(const Vector &); BoundVar *find(const Identifier *); }; class Environment { public: Environment(); Environment(const BoundVarList &frameVars, const BoundVarList &closureVars); void boundVars(BoundVarList &) const; bool lookup(const Identifier *var, bool &isFrame, int &index, unsigned &flags) const; void augmentFrame(const BoundVarList &, int stackPos); private: struct FrameVarList : public Resource { int stackPos; const BoundVarList *vars; ConstPtr next; }; ConstPtr frameVarList_; const BoundVarList *closureVars_; }; class Expression { public: Expression(const Location &); virtual ~Expression() { } virtual InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &) = 0; static InsnPtr optimizeCompile(Owner &, Interpreter &, const Environment &, int, const InsnPtr &); virtual void markBoundVars(BoundVarList &vars, bool); virtual void optimize(Interpreter &, const Environment &, Owner &); virtual ELObj *constantValue() const; virtual bool canEval(bool maybeCall) const = 0; virtual const Identifier *keyword() const; const Location &location() const; protected: static InsnPtr compilePushVars(Interpreter &interp, const Environment &env, int stackPos, const BoundVarList &vars, size_t varIndex, const InsnPtr &next); private: Location loc_; }; class ConstantExpression : public Expression { public: ConstantExpression(ELObj *, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void optimize(Interpreter &, const Environment &, Owner &); bool canEval(bool maybeCall) const; const Identifier *keyword() const; private: ELObj *obj_; // must be permanent }; class ResolvedConstantExpression : public Expression { public: ResolvedConstantExpression(ELObj *, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); bool canEval(bool maybeCall) const; ELObj *constantValue() const; private: ELObj *obj_; }; class CallExpression : public Expression { public: CallExpression(Owner &, NCVector > &, const Location &loc); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); int nArgs(); bool canEval(bool maybeCall) const; private: Owner op_; NCVector > args_; }; class VariableExpression : public Expression { public: VariableExpression(const Identifier *, const Location &loc); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void optimize(Interpreter &, const Environment &, Owner &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; private: const Identifier *ident_; bool isTop_; }; class IfExpression : public Expression { public: IfExpression(Owner &, Owner &, Owner &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; void optimize(Interpreter &, const Environment &, Owner &); private: Owner test_; Owner consequent_; Owner alternate_; }; class OrExpression : public Expression { public: OrExpression(Owner &, Owner &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; void optimize(Interpreter &, const Environment &, Owner &); private: Owner test1_; Owner test2_; }; class CondFailExpression : public Expression { public: CondFailExpression(const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); bool canEval(bool maybeCall) const; }; class CaseExpression : public Expression { public: struct Case { Vector datums; Owner expr; }; CaseExpression(Owner &, NCVector &, Owner &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; void optimize(Interpreter &, const Environment &, Owner &); private: Owner key_; NCVector cases_; Vector nResolved_; Owner else_; }; class LambdaExpression : public Expression { public: LambdaExpression(Vector &vars, NCVector > &inits, int nOptional, bool hasRest, int nKey, Owner &body, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; private: Vector formals_; NCVector > inits_; Signature sig_; Owner body_; }; class LetExpression : public Expression { public: LetExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; protected: InsnPtr compileInits(Interpreter &interp, const Environment &env, const BoundVarList &initVars, size_t initIndex, int stackPos, const InsnPtr &next); Vector vars_; NCVector > inits_; Owner body_; }; class LetStarExpression : public LetExpression { public: LetStarExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); private: InsnPtr compileInits(Interpreter &interp, const Environment &env, const BoundVarList &initVars, size_t initIndex, int stackPos, const InsnPtr &next); }; class LetrecExpression : public Expression { public: LetrecExpression(Vector &vars, NCVector > &inits, Owner &body, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; private: InsnPtr compileInits(Interpreter &interp, const Environment &env, size_t initIndex, int stackPos, const InsnPtr &next); Vector vars_; NCVector > inits_; Owner body_; }; class QuasiquoteExpression : public Expression { public: enum Type { listType, improperType, vectorType }; QuasiquoteExpression(NCVector > &, Vector &spliced, Type type, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; void optimize(Interpreter &, const Environment &, Owner &); private: NCVector > members_; Vector spliced_; Type type_; }; class SequenceExpression : public Expression { public: SequenceExpression(NCVector > &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; void optimize(Interpreter &, const Environment &, Owner &); private: NCVector > sequence_; }; class AssignmentExpression : public Expression { public: AssignmentExpression(const Identifier *, Owner &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; private: const Identifier *var_; Owner value_; }; class ProcessingMode; class WithModeExpression : public Expression { public: WithModeExpression(const ProcessingMode *, Owner &, const Location &); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; private: const ProcessingMode *mode_; Owner expr_; }; class StyleExpression : public Expression { public: StyleExpression(Vector &, NCVector > &, const Location &loc); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); void markBoundVars(BoundVarList &vars, bool); bool canEval(bool maybeCall) const; protected: virtual void unknownStyleKeyword(const Identifier *ident, Interpreter &interp, const Location &loc) const; virtual bool maybeStyleKeyword(const Identifier *ident) const; Vector keys_; NCVector > exprs_; }; class FlowObj; class MakeExpression : public StyleExpression { public: MakeExpression(const Identifier *, Vector &, NCVector > &, const Location &loc); InsnPtr compile(Interpreter &, const Environment &, int, const InsnPtr &); private: InsnPtr compileNonInheritedCs(Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next); FlowObj *applyConstNonInheritedCs(FlowObj *, Interpreter &, const Environment &); void unknownStyleKeyword(const Identifier *ident, Interpreter &interp, const Location &loc) const; bool maybeStyleKeyword(const Identifier *ident) const; const Identifier *foc_; }; inline const Location &Expression::location() const { return loc_; } inline InsnPtr Expression::optimizeCompile(Owner &expr, Interpreter &interp, const Environment &env, int stackPos, const InsnPtr &next) { expr->optimize(interp, env, expr); return expr->compile(interp, env, stackPos, next); } #ifdef DSSSL_NAMESPACE } #endif #endif /* not Expression_INCLUDED */ OpenJade-1.4devel/style/FOTBuilder.cxx0000644000021000000240000013640207067711555013371 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "FOTBuilder.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif const char *FOTBuilder::symbolName(Symbol sym) { if (sym < 2 || sym >= int(nSymbols)) return 0; // These must match the order in Symbol static const char *names[] = { "not-applicable", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "ultra-light", "extra-light", "light", "semi-light", "medium", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", "semi-bold", "bold", "extra-bold", "ultra-bold", "upright", "oblique", "back-slanted-oblique", "italic", "back-slanted-italic", "start", "end", "center", "justify", "spread-inside", "spread-outside", "page-inside", "page-outside", "initial", "final", "wrap", "asis", "asis-wrap", "asis-truncate", "none", "indent", "before", "through", "after", "top-to-bottom", "left-to-right", "bottom-to-top", "right-to-left", "inside", "outside", "horizontal", "vertical", "escapement", "line-progression", "math", "ordinary", "operator", "binary", "relation", "opening", "closing", "punctuation", "inner", "space", "page", "page-region", "column-set", "column", "max", "max-uniform", "miter", "round", "join", "butt", "square", "loose", "normal", "kern", "tight", "touch", "preserve", "collapse", "ignore", "relative", "display", "inline", "border", "background", "both", "base", "font", "top", "bottom", "spread", "solid", "outline", "with", "against", "force", "independent", "pile", "sup-out", "sub-out", "lead-edge", "trail-edge", "explicit", "row-major", "column-major", "uppercase", "lowercase", "capitalize", }; ASSERT(SIZEOF(names) == nSymbols - 2); return names[sym - 2]; } SaveFOTBuilder *FOTBuilder::asSaveFOTBuilder() { return 0; } FOTBuilder::~FOTBuilder() { } void FOTBuilder::start() { } void FOTBuilder::end() { } void FOTBuilder::atomic() { start(); end(); } void FOTBuilder::characters(const Char *, size_t) { } void FOTBuilder::characters(const Vector &v) { // This is really slow. A FOTBuilder should either override this or // set Description::wantCharPropertyNICs=false. Char s[v.size()]; size_t j(0); for (size_t i = 0; i< v.size(); ++i) if (v[i].specifiedC & (1 << CharacterNIC::cChar)) s[j++] = v[i].ch; characters(s, j); } void FOTBuilder::charactersFromNode(const NodePtr &, const Char *s, size_t n) { characters(s, n); } void FOTBuilder::character(const CharacterNIC &nic) { if (nic.specifiedC & FOTBuilder::CharacterNIC::cChar) characters(&nic.ch, 1); atomic(); } void FOTBuilder::startSequence() { start(); } void FOTBuilder::endSequence() { end(); } void FOTBuilder::startLineField(const LineFieldNIC &) { start(); } void FOTBuilder::endLineField() { end(); } void FOTBuilder::paragraphBreak(const ParagraphNIC &) { atomic(); } void FOTBuilder::externalGraphic(const ExternalGraphicNIC &) { atomic(); } void FOTBuilder::rule(const RuleNIC &) { atomic(); } void FOTBuilder::alignmentPoint() { atomic(); } void FOTBuilder::formattingInstruction(const StringC &) { atomic(); } void FOTBuilder::startParagraph(const ParagraphNIC &) { start(); } void FOTBuilder::endParagraph() { end(); } void FOTBuilder::startDisplayGroup(const DisplayGroupNIC &) { start(); } void FOTBuilder::endDisplayGroup() { end(); } void FOTBuilder::startScroll() { start(); } void FOTBuilder::endScroll() { end(); } void FOTBuilder::startLink(const Address &) { start(); } void FOTBuilder::endLink() { end(); } void FOTBuilder::startMarginalia() { start(); } void FOTBuilder::endMarginalia() { end(); } void FOTBuilder::startMultiMode(const FOTBuilder::MultiMode *, const Vector &, Vector &ports) { start(); for (size_t i = 0; i < ports.size(); i++) ports[i] = this; } void FOTBuilder::endMultiMode() { end(); } void FOTBuilder::startScore(Symbol) { start(); } void FOTBuilder::startScore(Char) { start(); } void FOTBuilder::startScore(const LengthSpec &) { start(); } void FOTBuilder::endScore() { end(); } void FOTBuilder::startLeader(const LeaderNIC &) { start(); } void FOTBuilder::endLeader() { end(); } void FOTBuilder::startBox(const BoxNIC &) { start(); } void FOTBuilder::endBox() { end(); } void FOTBuilder::startSideBySide(const DisplayNIC&) { start(); } void FOTBuilder::endSideBySide() { end(); } void FOTBuilder::startSideBySideItem() { start(); } void FOTBuilder::endSideBySideItem() { end(); } void FOTBuilder::startSideline() { } void FOTBuilder::endSideline() { } void FOTBuilder::startSimplePageSequence(FOTBuilder* headerFooter[nHF]) { for ( unsigned i = 0; i < nHF; ++i ) headerFooter[i] = this; start(); } void FOTBuilder::endSimplePageSequenceHeaderFooter() { } void FOTBuilder::endSimplePageSequence() { end(); } void FOTBuilder::pageNumber() { } void FOTBuilder::startTable(const TableNIC &) { start(); } void FOTBuilder::endTable() { end(); } void FOTBuilder::tableBeforeRowBorder() { atomic(); } void FOTBuilder::tableAfterRowBorder() { atomic(); } void FOTBuilder::tableBeforeColumnBorder() { atomic(); } void FOTBuilder::tableAfterColumnBorder() { atomic(); } void FOTBuilder::startTablePart(const TablePartNIC &, FOTBuilder *&header, FOTBuilder *&footer) { start(); header = footer = this; } void FOTBuilder::endTablePart() { end(); } void FOTBuilder::tableColumn(const TableColumnNIC &) { atomic(); } void FOTBuilder::startTableRow() { start(); } void FOTBuilder::endTableRow() { end(); } void FOTBuilder::startTableCell(const TableCellNIC &) { start(); } void FOTBuilder::endTableCell() { end(); } void FOTBuilder::tableCellBeforeRowBorder() { atomic(); } void FOTBuilder::tableCellAfterRowBorder() { atomic(); } void FOTBuilder::tableCellBeforeColumnBorder() { atomic(); } void FOTBuilder::tableCellAfterColumnBorder() { atomic(); } void FOTBuilder::startMathSequence() { start(); } void FOTBuilder::endMathSequence() { end(); } void FOTBuilder::startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator) { start(); numerator = denominator = this; } void FOTBuilder::endFraction() { end(); } void FOTBuilder::fractionBar() { atomic(); } void FOTBuilder::startUnmath() { start(); } void FOTBuilder::endUnmath() { end(); } void FOTBuilder::startSuperscript() { start(); } void FOTBuilder::endSuperscript() { end(); } void FOTBuilder::startSubscript() { start(); } void FOTBuilder::endSubscript() { end(); } void FOTBuilder::startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub) { start(); preSup = preSub = postSup = postSub = midSup = midSub = this; } void FOTBuilder::endScript() { end(); } void FOTBuilder::startMark(FOTBuilder *&overMark, FOTBuilder *&underMark) { start(); overMark = underMark = this; } void FOTBuilder::endMark() { end(); } void FOTBuilder::startFence(FOTBuilder *&open, FOTBuilder *&close) { start(); open = close = this; } void FOTBuilder::endFence() { end(); } void FOTBuilder::startRadical(FOTBuilder *°ree) { start(); degree = this; } void FOTBuilder::endRadical() { end(); } void FOTBuilder::radicalRadical(const CharacterNIC &) { atomic(); } void FOTBuilder::radicalRadicalDefaulted() { } void FOTBuilder::startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit) { start(); oper = lowerLimit = upperLimit = this; } void FOTBuilder::endMathOperator() { end(); } void FOTBuilder::startGrid(const GridNIC &) { start(); } void FOTBuilder::endGrid() { end(); } void FOTBuilder::startGridCell(const GridCellNIC &) { start(); } void FOTBuilder::endGridCell() { end(); } void FOTBuilder::extension(const ExtensionFlowObj &, const NodePtr &) { atomic(); } void FOTBuilder::startExtension(const CompoundExtensionFlowObj &, const NodePtr &, Vector &ports) { for (size_t i = 0; i < ports.size(); i++) ports[i] = this; start(); } void FOTBuilder::endExtension(const CompoundExtensionFlowObj &) { end(); } void FOTBuilder::setFontSize(Length) { } void FOTBuilder::setFontFamilyName(const StringC &) { } void FOTBuilder::setFontWeight(Symbol) { } void FOTBuilder::setFontPosture(Symbol) { } void FOTBuilder::setStartIndent(const LengthSpec &) { } void FOTBuilder::setEndIndent(const LengthSpec &) { } void FOTBuilder::setFirstLineStartIndent(const LengthSpec &) { } void FOTBuilder::setLastLineEndIndent(const LengthSpec &) { } void FOTBuilder::setLineSpacing(const LengthSpec &) { } void FOTBuilder::setFieldWidth(const LengthSpec &) { } void FOTBuilder::setQuadding(Symbol) { } void FOTBuilder::setDisplayAlignment(Symbol) { } void FOTBuilder::setFieldAlign(Symbol) { } void FOTBuilder::setLines(Symbol) { } void FOTBuilder::setColor(const DeviceRGBColor &) { } void FOTBuilder::setBackgroundColor(const DeviceRGBColor &) { } void FOTBuilder::setBackgroundColor() { } void FOTBuilder::setPageWidth(Length) { } void FOTBuilder::setPageHeight(Length) { } void FOTBuilder::setLeftMargin(Length) { } void FOTBuilder::setRightMargin(Length) { } void FOTBuilder::setTopMargin(Length) { } void FOTBuilder::setBottomMargin(Length) { } void FOTBuilder::setHeaderMargin(Length) { } void FOTBuilder::setFooterMargin(Length) { } void FOTBuilder::setBorderPresent(bool) { } void FOTBuilder::setLineThickness(Length) { } void FOTBuilder::setCellBeforeRowMargin(Length) { } void FOTBuilder::setCellAfterRowMargin(Length) { } void FOTBuilder::setCellBeforeColumnMargin(Length) { } void FOTBuilder::setCellAfterColumnMargin(Length) { } void FOTBuilder::setLineSep(Length) { } void FOTBuilder::setBoxSizeBefore(Length) { } void FOTBuilder::setBoxSizeAfter(Length) { } void FOTBuilder::setSideBySideOverlapControl(Symbol) { } void FOTBuilder::setSideBySidePreAlign(Symbol) { } void FOTBuilder::setSideBySidePostAlign(Symbol) { } void FOTBuilder::setPositionPointShift(const LengthSpec &) { } void FOTBuilder::setStartMargin(const LengthSpec &) { } void FOTBuilder::setEndMargin(const LengthSpec &) { } void FOTBuilder::setSidelineSep(const LengthSpec &) { } void FOTBuilder::setAsisWrapIndent(const LengthSpec &) { } void FOTBuilder::setLineNumberSep(const LengthSpec &) { } void FOTBuilder::setLastLineJustifyLimit(const LengthSpec &) { } void FOTBuilder::setJustifyGlyphSpaceMaxAdd(const LengthSpec &) { } void FOTBuilder::setJustifyGlyphSpaceMaxRemove(const LengthSpec &) { } void FOTBuilder::setTableCornerRadius(const LengthSpec &) { } void FOTBuilder::setBoxCornerRadius(const LengthSpec &) { } void FOTBuilder::setMarginaliaSep(const LengthSpec &) { } void FOTBuilder::setMinPreLineSpacing(const OptLengthSpec &) { } void FOTBuilder::setMinPostLineSpacing(const OptLengthSpec &) { } void FOTBuilder::setMinLeading(const OptLengthSpec &) { } void FOTBuilder::setInhibitLineBreaks(bool) { } void FOTBuilder::setHyphenate(bool) { } void FOTBuilder::setKern(bool) { } void FOTBuilder::setLigature(bool) { } void FOTBuilder::setScoreSpaces(bool) { } void FOTBuilder::setFloatOutMarginalia(bool) { } void FOTBuilder::setFloatOutSidelines(bool) { } void FOTBuilder::setFloatOutLineNumbers(bool) { } void FOTBuilder::setCellBackground(bool) { } void FOTBuilder::setSpanWeak(bool) { } void FOTBuilder::setIgnoreRecordEnd(bool) { } void FOTBuilder::setNumberedLines(bool) { } void FOTBuilder::setHangingPunct(bool) { } void FOTBuilder::setBoxOpenEnd(bool) { } void FOTBuilder::setTruncateLeader(bool) { } void FOTBuilder::setAlignLeader(bool) { } void FOTBuilder::setTablePartOmitMiddleHeader(bool) { } void FOTBuilder::setTablePartOmitMiddleFooter(bool) { } void FOTBuilder::setBorderOmitAtBreak(bool) { } void FOTBuilder::setPrincipalModeSimultaneous(bool) { } void FOTBuilder::setMarginaliaKeepWithPrevious(bool) { } void FOTBuilder::setGridEquidistantRows(bool) { } void FOTBuilder::setGridEquidistantColumns(bool) { } void FOTBuilder::setLineJoin(Symbol) { } void FOTBuilder::setLineCap(Symbol) { } void FOTBuilder::setLineNumberSide(Symbol) { } void FOTBuilder::setKernMode(Symbol) { } void FOTBuilder::setInputWhitespaceTreatment(Symbol) { } void FOTBuilder::setFillingDirection(Symbol) { } void FOTBuilder::setWritingMode(Symbol) { } void FOTBuilder::setLastLineQuadding(Symbol) { } void FOTBuilder::setMathDisplayMode(Symbol) { } void FOTBuilder::setScriptPreAlign(Symbol) { } void FOTBuilder::setScriptPostAlign(Symbol) { } void FOTBuilder::setScriptMidSupAlign(Symbol) { } void FOTBuilder::setScriptMidSubAlign(Symbol) { } void FOTBuilder::setNumeratorAlign(Symbol) { } void FOTBuilder::setDenominatorAlign(Symbol) { } void FOTBuilder::setGridPositionCellType(Symbol) { } void FOTBuilder::setGridColumnAlignment(Symbol) { } void FOTBuilder::setGridRowAlignment(Symbol) { } void FOTBuilder::setBoxType(Symbol) { } void FOTBuilder::setGlyphAlignmentMode(Symbol) { } void FOTBuilder::setBoxBorderAlignment(Symbol) { } void FOTBuilder::setCellRowAlignment(Symbol) { } void FOTBuilder::setBorderAlignment(Symbol) { } void FOTBuilder::setSidelineSide(Symbol) { } void FOTBuilder::setHyphenationKeep(Symbol) { } void FOTBuilder::setFontStructure(Symbol) { } void FOTBuilder::setFontProportionateWidth(Symbol) { } void FOTBuilder::setCellCrossed(Symbol) { } void FOTBuilder::setMarginaliaSide(Symbol) { } void FOTBuilder::setLayer(long) { } void FOTBuilder::setBackgroundLayer(long) { } void FOTBuilder::setBorderPriority(long) { } void FOTBuilder::setLineRepeat(long) { } void FOTBuilder::setSpan(long) { } void FOTBuilder::setMinLeaderRepeat(long) { } void FOTBuilder::setHyphenationRemainCharCount(long) { } void FOTBuilder::setHyphenationPushCharCount(long) { } void FOTBuilder::setWidowCount(long) { } void FOTBuilder::setOrphanCount(long) { } void FOTBuilder::setExpandTabs(long) { } void FOTBuilder::setHyphenationLadderCount(long) { } void FOTBuilder::setBackgroundTile(PublicId) { } void FOTBuilder::setLineBreakingMethod(PublicId) { } void FOTBuilder::setLineCompositionMethod(PublicId) { } void FOTBuilder::setImplicitBidiMethod(PublicId) { } void FOTBuilder::setGlyphSubstMethod(PublicId) { } void FOTBuilder::setGlyphReorderMethod(PublicId) { } void FOTBuilder::setHyphenationMethod(PublicId) { } void FOTBuilder::setTableAutoWidthMethod(PublicId) { } void FOTBuilder::setFontName(PublicId) { } void FOTBuilder::setLanguage(Letter2) { } void FOTBuilder::setCountry(Letter2) { } void FOTBuilder::setEscapementSpaceBefore(const InlineSpace &) { } void FOTBuilder::setEscapementSpaceAfter(const InlineSpace &) { } void FOTBuilder::setInlineSpaceSpace(const OptInlineSpace &) { } void FOTBuilder::setCharMap(Symbol) { } void FOTBuilder::setGlyphSubstTable(const Vector > &) { } void FOTBuilder::startNode(const NodePtr &, const StringC &) { } void FOTBuilder::endNode() { } void FOTBuilder::currentNodePageNumber(const NodePtr &) { } void FOTBuilder::extensionSet(void (FOTBuilder::*func)(bool), bool arg) { (this->*func)(arg); } void FOTBuilder::extensionSet(void (FOTBuilder::*func)(const StringC &), const StringC &arg) { (this->*func)(arg); } void FOTBuilder::extensionSet(void (FOTBuilder::*func)(long), long arg) { (this->*func)(arg); } FOTBuilder::DisplayNIC::DisplayNIC() : positionPreference(symbolFalse), keep(symbolFalse), breakBefore(symbolFalse), breakAfter(symbolFalse), keepWithPrevious(0), keepWithNext(0), mayViolateKeepBefore(0), mayViolateKeepAfter(0) { } FOTBuilder::DisplayGroupNIC::DisplayGroupNIC() : hasCoalesceId(0) { } FOTBuilder::InlineNIC::InlineNIC() : breakBeforePriority(0), breakAfterPriority(0) { } FOTBuilder::ExternalGraphicNIC::ExternalGraphicNIC() : scaleType(symbolMaxUniform), isDisplay(0), hasMaxWidth(0), hasMaxHeight(0), escapementDirection(symbolFalse) { } FOTBuilder::BoxNIC::BoxNIC() : isDisplay(0) { } FOTBuilder::RuleNIC::RuleNIC() : orientation(symbolHorizontal), hasLength(0) { } FOTBuilder::LeaderNIC::LeaderNIC() : hasLength(0) { } FOTBuilder::CharacterNIC::CharacterNIC() : specifiedC(0), stretchFactor(1.0) { } FOTBuilder::TableNIC::TableNIC() : widthType(widthFull) { } FOTBuilder::TableColumnNIC::TableColumnNIC() : columnIndex(0), nColumnsSpanned(1), hasWidth(0) { } FOTBuilder::TableCellNIC::TableCellNIC() : columnIndex(0), nColumnsSpanned(1), nRowsSpanned(1), missing(0) { } FOTBuilder::GridNIC::GridNIC() : nColumns(0), nRows(0) { } FOTBuilder::GridCellNIC::GridCellNIC() : columnNumber(0), rowNumber(0) { } FOTBuilder::MultiMode::MultiMode() : hasDesc(0) { } FOTBuilder::GlyphId FOTBuilder::GlyphSubstTable::subst(const FOTBuilder::GlyphId &gid) const { for (size_t i = 0; i < pairs.size(); i += 2) if (gid == pairs[i]) return pairs[i + 1]; return gid; } SaveFOTBuilder::SaveFOTBuilder() : calls_(0), tail_(&calls_) { } SaveFOTBuilder::SaveFOTBuilder(const SaveFOTBuilder& other) : calls_(0), tail_(&calls_) { for (Call* call = other.calls_; call; call = call->next) { *tail_ = call->clone(); tail_ = &(*tail_)->next; } } NodeSaveFOTBuilder::NodeSaveFOTBuilder(const NodePtr ¤tNode, const StringC &processingMode) : currentNode_(currentNode), processingMode_(processingMode) { } void NodeSaveFOTBuilder::emit(FOTBuilder& fotb) const { if (currentNode_) fotb.startNode(currentNode_, processingMode_); SaveFOTBuilder::emit(fotb); if (currentNode_) fotb.endNode(); } SaveFOTBuilder::~SaveFOTBuilder() { clear(); } SaveFOTBuilder& SaveFOTBuilder::operator=(const SaveFOTBuilder& other) { if (this != &other) { clear(); for (Call* call = other.calls_; call; call = call->next) { *tail_ = call->clone(); tail_ = &(*tail_)->next; } } return *this; } void SaveFOTBuilder::clear() { while (calls_) { Call *tem = calls_; calls_ = calls_->next; delete tem; } } SaveFOTBuilder *SaveFOTBuilder::asSaveFOTBuilder() { return this; } void SaveFOTBuilder::emit(FOTBuilder &fotb) const { #if 0 SaveFOTBuilder *save = fotb.asSaveFOTBuilder(); if (save) { if (calls_) { *save->tail_ = calls_; save->tail_ = tail_; calls_ = 0; tail_ = &calls_; } } else #endif { for (const Call* tem = calls_; tem; tem = tem->next) tem->emit(fotb); } } #define NO_ARG_CALL(F) \ void SaveFOTBuilder::F() { \ *tail_ = new NoArgCall(&FOTBuilder::F); \ tail_ = &(*tail_)->next; } #define ONEARG_CALL(F, T) \ void SaveFOTBuilder::F(T a) { \ *tail_ = new OneArgCall(&FOTBuilder::F, a); \ tail_ = &(*tail_)->next; } #define ONEREFARG_CALL(F, T) \ void SaveFOTBuilder::F(const T& a) { \ *tail_ = new OneRefArgCall(&FOTBuilder::F, a); \ tail_ = &(*tail_)->next; } NO_ARG_CALL(startSequence) NO_ARG_CALL(endSequence) NO_ARG_CALL(endLineField) NO_ARG_CALL(endParagraph) NO_ARG_CALL(endDisplayGroup) NO_ARG_CALL(alignmentPoint) NO_ARG_CALL(startScroll) NO_ARG_CALL(endScroll) NO_ARG_CALL(endLeader) NO_ARG_CALL(endLink) NO_ARG_CALL(startMarginalia) NO_ARG_CALL(endMarginalia) NO_ARG_CALL(endMultiMode) NO_ARG_CALL(endScore) NO_ARG_CALL(endBox) NO_ARG_CALL(endSideBySide); NO_ARG_CALL(startSideBySideItem); NO_ARG_CALL(endSideBySideItem); NO_ARG_CALL(startSideline) NO_ARG_CALL(endSideline) NO_ARG_CALL(endNode) NO_ARG_CALL(endSimplePageSequenceHeaderFooter) NO_ARG_CALL(endSimplePageSequence) NO_ARG_CALL(pageNumber) NO_ARG_CALL(endTable) NO_ARG_CALL(tableBeforeRowBorder) NO_ARG_CALL(tableAfterRowBorder) NO_ARG_CALL(tableBeforeColumnBorder) NO_ARG_CALL(tableAfterColumnBorder) NO_ARG_CALL(endTablePart) NO_ARG_CALL(startTableRow) NO_ARG_CALL(endTableRow) NO_ARG_CALL(endTableCell) NO_ARG_CALL(tableCellBeforeRowBorder) NO_ARG_CALL(tableCellAfterRowBorder) NO_ARG_CALL(tableCellBeforeColumnBorder) NO_ARG_CALL(tableCellAfterColumnBorder) NO_ARG_CALL(startMathSequence) NO_ARG_CALL(endMathSequence) NO_ARG_CALL(endFraction) NO_ARG_CALL(fractionBar) NO_ARG_CALL(startUnmath) NO_ARG_CALL(endUnmath) NO_ARG_CALL(startSuperscript) NO_ARG_CALL(endSuperscript) NO_ARG_CALL(startSubscript) NO_ARG_CALL(endSubscript) NO_ARG_CALL(endScript) NO_ARG_CALL(endMark) NO_ARG_CALL(endFence) NO_ARG_CALL(endRadical) NO_ARG_CALL(radicalRadicalDefaulted) NO_ARG_CALL(endMathOperator) NO_ARG_CALL(endGrid) NO_ARG_CALL(endGridCell) #define LENGTH_SPEC_ARG_CALL(F) ONEREFARG_CALL(F, LengthSpec) LENGTH_SPEC_ARG_CALL(setStartIndent) LENGTH_SPEC_ARG_CALL(setEndIndent) LENGTH_SPEC_ARG_CALL(setFirstLineStartIndent) LENGTH_SPEC_ARG_CALL(setLastLineEndIndent) LENGTH_SPEC_ARG_CALL(setLineSpacing) LENGTH_SPEC_ARG_CALL(setFieldWidth) LENGTH_SPEC_ARG_CALL(setPositionPointShift) LENGTH_SPEC_ARG_CALL(setStartMargin) LENGTH_SPEC_ARG_CALL(setEndMargin) LENGTH_SPEC_ARG_CALL(setSidelineSep) LENGTH_SPEC_ARG_CALL(setAsisWrapIndent) LENGTH_SPEC_ARG_CALL(setLineNumberSep) LENGTH_SPEC_ARG_CALL(setLastLineJustifyLimit) LENGTH_SPEC_ARG_CALL(setJustifyGlyphSpaceMaxAdd) LENGTH_SPEC_ARG_CALL(setJustifyGlyphSpaceMaxRemove) LENGTH_SPEC_ARG_CALL(setTableCornerRadius) LENGTH_SPEC_ARG_CALL(setBoxCornerRadius) LENGTH_SPEC_ARG_CALL(setMarginaliaSep) #define OPT_LENGTH_SPEC_ARG_CALL(F) ONEREFARG_CALL(F, OptLengthSpec) OPT_LENGTH_SPEC_ARG_CALL(setMinPreLineSpacing) OPT_LENGTH_SPEC_ARG_CALL(setMinPostLineSpacing) OPT_LENGTH_SPEC_ARG_CALL(setMinLeading) #define LONG_ARG_CALL(F) ONEARG_CALL(F, long) LONG_ARG_CALL(setFontSize) LONG_ARG_CALL(setPageWidth) LONG_ARG_CALL(setPageHeight) LONG_ARG_CALL(setLeftMargin) LONG_ARG_CALL(setRightMargin) LONG_ARG_CALL(setTopMargin) LONG_ARG_CALL(setBottomMargin) LONG_ARG_CALL(setHeaderMargin) LONG_ARG_CALL(setFooterMargin) LONG_ARG_CALL(setLineThickness) LONG_ARG_CALL(setCellBeforeRowMargin) LONG_ARG_CALL(setCellAfterRowMargin) LONG_ARG_CALL(setCellBeforeColumnMargin) LONG_ARG_CALL(setCellAfterColumnMargin) LONG_ARG_CALL(setLineSep) LONG_ARG_CALL(setBoxSizeBefore) LONG_ARG_CALL(setBoxSizeAfter) LONG_ARG_CALL(setLayer) LONG_ARG_CALL(setBackgroundLayer) LONG_ARG_CALL(setBorderPriority) LONG_ARG_CALL(setLineRepeat) LONG_ARG_CALL(setSpan) LONG_ARG_CALL(setMinLeaderRepeat) LONG_ARG_CALL(setHyphenationRemainCharCount) LONG_ARG_CALL(setHyphenationPushCharCount) LONG_ARG_CALL(setWidowCount) LONG_ARG_CALL(setOrphanCount) LONG_ARG_CALL(setExpandTabs) LONG_ARG_CALL(setHyphenationLadderCount) #define BOOL_ARG_CALL(F) ONEARG_CALL(F, bool) BOOL_ARG_CALL(setBorderPresent) BOOL_ARG_CALL(setInhibitLineBreaks) BOOL_ARG_CALL(setHyphenate) BOOL_ARG_CALL(setKern) BOOL_ARG_CALL(setLigature) BOOL_ARG_CALL(setScoreSpaces) BOOL_ARG_CALL(setFloatOutMarginalia) BOOL_ARG_CALL(setFloatOutSidelines) BOOL_ARG_CALL(setFloatOutLineNumbers) BOOL_ARG_CALL(setCellBackground) BOOL_ARG_CALL(setSpanWeak) BOOL_ARG_CALL(setIgnoreRecordEnd) BOOL_ARG_CALL(setNumberedLines) BOOL_ARG_CALL(setHangingPunct) BOOL_ARG_CALL(setBoxOpenEnd) BOOL_ARG_CALL(setTruncateLeader) BOOL_ARG_CALL(setAlignLeader) BOOL_ARG_CALL(setTablePartOmitMiddleHeader) BOOL_ARG_CALL(setTablePartOmitMiddleFooter) BOOL_ARG_CALL(setBorderOmitAtBreak) BOOL_ARG_CALL(setPrincipalModeSimultaneous) BOOL_ARG_CALL(setMarginaliaKeepWithPrevious) BOOL_ARG_CALL(setGridEquidistantRows) BOOL_ARG_CALL(setGridEquidistantColumns) #define SYMBOL_ARG_CALL(F) ONEARG_CALL(F, Symbol) SYMBOL_ARG_CALL(setFontWeight) SYMBOL_ARG_CALL(setFontPosture) SYMBOL_ARG_CALL(setLines) SYMBOL_ARG_CALL(setQuadding) SYMBOL_ARG_CALL(setDisplayAlignment) SYMBOL_ARG_CALL(setFieldAlign) SYMBOL_ARG_CALL(setLineJoin) SYMBOL_ARG_CALL(setLineCap) SYMBOL_ARG_CALL(setLineNumberSide) SYMBOL_ARG_CALL(setKernMode) SYMBOL_ARG_CALL(setInputWhitespaceTreatment) SYMBOL_ARG_CALL(setFillingDirection) SYMBOL_ARG_CALL(setWritingMode) SYMBOL_ARG_CALL(setLastLineQuadding) SYMBOL_ARG_CALL(setMathDisplayMode) SYMBOL_ARG_CALL(setScriptPreAlign) SYMBOL_ARG_CALL(setScriptPostAlign) SYMBOL_ARG_CALL(setScriptMidSupAlign) SYMBOL_ARG_CALL(setScriptMidSubAlign) SYMBOL_ARG_CALL(setNumeratorAlign) SYMBOL_ARG_CALL(setDenominatorAlign) SYMBOL_ARG_CALL(setGridPositionCellType) SYMBOL_ARG_CALL(setGridColumnAlignment) SYMBOL_ARG_CALL(setGridRowAlignment) SYMBOL_ARG_CALL(setBoxType) SYMBOL_ARG_CALL(setSideBySideOverlapControl) SYMBOL_ARG_CALL(setSideBySidePreAlign) SYMBOL_ARG_CALL(setSideBySidePostAlign) SYMBOL_ARG_CALL(setGlyphAlignmentMode) SYMBOL_ARG_CALL(setBoxBorderAlignment) SYMBOL_ARG_CALL(setCellRowAlignment) SYMBOL_ARG_CALL(setBorderAlignment) SYMBOL_ARG_CALL(setSidelineSide) SYMBOL_ARG_CALL(setHyphenationKeep) SYMBOL_ARG_CALL(setFontStructure) SYMBOL_ARG_CALL(setFontProportionateWidth) SYMBOL_ARG_CALL(setCellCrossed) SYMBOL_ARG_CALL(setMarginaliaSide) #define PUBLIC_ID_ARG_CALL(F) ONEARG_CALL(F, PublicId) PUBLIC_ID_ARG_CALL(setBackgroundTile) PUBLIC_ID_ARG_CALL(setLineBreakingMethod) PUBLIC_ID_ARG_CALL(setLineCompositionMethod) PUBLIC_ID_ARG_CALL(setImplicitBidiMethod) PUBLIC_ID_ARG_CALL(setGlyphSubstMethod) PUBLIC_ID_ARG_CALL(setGlyphReorderMethod) PUBLIC_ID_ARG_CALL(setHyphenationMethod) PUBLIC_ID_ARG_CALL(setTableAutoWidthMethod) PUBLIC_ID_ARG_CALL(setFontName) #define UNSIGNED_ARG_CALL(F) ONEARG_CALL(F, unsigned) UNSIGNED_ARG_CALL(setLanguage) UNSIGNED_ARG_CALL(setCountry) #define STRING_ARG_CALL(F) ONEREFARG_CALL(F, StringC) STRING_ARG_CALL(setFontFamilyName) STRING_ARG_CALL(formattingInstruction) #define INLINE_SPACE_ARG_CALL(F) ONEREFARG_CALL(F, InlineSpace) INLINE_SPACE_ARG_CALL(setEscapementSpaceBefore) INLINE_SPACE_ARG_CALL(setEscapementSpaceAfter) ONEREFARG_CALL(setInlineSpaceSpace, OptInlineSpace); SYMBOL_ARG_CALL(setCharMap); SaveFOTBuilder::Call::~Call() { } void SaveFOTBuilder::NoArgCall::emit(FOTBuilder &fotb) const { (fotb.*func)(); } void SaveFOTBuilder::charactersFromNode(const NodePtr &node, const Char *s, size_t n) { *tail_ = new CharactersFromNodeCall(node, s, n); tail_ = &(*tail_)->next; } SaveFOTBuilder::CharactersFromNodeCall::CharactersFromNodeCall(const NodePtr &nd, const Char *s, size_t n) : data(s), size(n), node(nd) { } void SaveFOTBuilder::CharactersFromNodeCall::emit(FOTBuilder &fotb) const { fotb.charactersFromNode(node, data, size); } void SaveFOTBuilder::characters(const Char *s, size_t n) { *tail_ = new CharactersCall(s, n); tail_ = &(*tail_)->next; } ONEREFARG_CALL(characters, Vector); ONEREFARG_CALL(character, CharacterNIC); SaveFOTBuilder::StartNodeCall::StartNodeCall(const NodePtr &nd, const StringC &m) : node(nd), mode(m) { } void SaveFOTBuilder::StartNodeCall::emit(FOTBuilder &fotb) const { fotb.startNode(node, mode); } void SaveFOTBuilder::startNode(const NodePtr &node, const StringC &mode) { *tail_ = new StartNodeCall(node, mode); tail_ = &(*tail_)->next; } ONEREFARG_CALL(currentNodePageNumber, NodePtr) ONEREFARG_CALL(setColor, DeviceRGBColor) ONEREFARG_CALL(setBackgroundColor, DeviceRGBColor) NO_ARG_CALL(setBackgroundColor) ONEREFARG_CALL(startParagraph, ParagraphNIC) ONEREFARG_CALL(paragraphBreak, ParagraphNIC) ONEREFARG_CALL(startDisplayGroup, DisplayGroupNIC) ONEREFARG_CALL(externalGraphic, ExternalGraphicNIC) ONEREFARG_CALL(rule, RuleNIC) ONEREFARG_CALL(startLeader, LeaderNIC) ONEREFARG_CALL(startLink, Address) ONEARG_CALL(startScore, Symbol) ONEARG_CALL(startScore, Char) ONEREFARG_CALL(startScore, LengthSpec) ONEREFARG_CALL(startLineField, LineFieldNIC) ONEREFARG_CALL(startBox, BoxNIC) ONEREFARG_CALL(startSideBySide, DisplayNIC) typedef Vector > VectorConstPtrFOTBuilderGlyphSubstTable; ONEREFARG_CALL(setGlyphSubstTable, VectorConstPtrFOTBuilderGlyphSubstTable) void SaveFOTBuilder::startSimplePageSequence(FOTBuilder* headerFooter[nHF]) { *tail_ = new StartSimplePageSequenceCall(headerFooter); tail_ = &(*tail_)->next; } ONEREFARG_CALL(startTable, TableNIC) void SaveFOTBuilder::startTablePart(const TablePartNIC &nic, FOTBuilder *&header, FOTBuilder *&footer) { *tail_ = new StartTablePartCall(nic, header, footer); tail_ = &(*tail_)->next; } ONEREFARG_CALL(tableColumn, TableColumnNIC) ONEREFARG_CALL(startTableCell, TableCellNIC) void SaveFOTBuilder::startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator) { *tail_ = new StartFractionCall(numerator, denominator); tail_ = &(*tail_)->next; } void SaveFOTBuilder::startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub) { *tail_ = new StartScriptCall(preSup, preSub, postSup, postSub, midSup, midSub); tail_ = &(*tail_)->next; } void SaveFOTBuilder::startMark(FOTBuilder *&overMark, FOTBuilder *&underMark) { *tail_ = new StartMarkCall(overMark, underMark); tail_ = &(*tail_)->next; } void SaveFOTBuilder::startFence(FOTBuilder *&open, FOTBuilder *&close) { *tail_ = new StartFenceCall(open, close); tail_ = &(*tail_)->next; } void SaveFOTBuilder::startRadical(FOTBuilder *°ree) { *tail_ = new StartRadicalCall(degree); tail_ = &(*tail_)->next; } ONEREFARG_CALL(radicalRadical, CharacterNIC) void SaveFOTBuilder::startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit) { *tail_ = new StartMathOperatorCall(oper, lowerLimit, upperLimit); tail_ = &(*tail_)->next; } ONEREFARG_CALL(startGrid, GridNIC) ONEREFARG_CALL(startGridCell, GridCellNIC) void SaveFOTBuilder::startMultiMode(const MultiMode *principalMode, const Vector &namedModes, Vector &namedPorts) { *tail_ = new StartMultiModeCall(principalMode, namedModes, namedPorts); tail_ = &(*tail_)->next; } void SaveFOTBuilder::extensionSet(void (FOTBuilder::*func)(bool), bool arg) { typedef OneArgCall ExtensionBoolArgCall; *tail_ = new ExtensionBoolArgCall(func, arg); tail_ = &(*tail_)->next; } void SaveFOTBuilder::extensionSet(void (FOTBuilder::*func)(const StringC &), const StringC &arg) { typedef OneRefArgCall ExtensionStringArgCall; *tail_ = new ExtensionStringArgCall(func, arg); tail_ = &(*tail_)->next; } void SaveFOTBuilder::extensionSet(void (FOTBuilder::*func)(long), long arg) { typedef OneArgCall ExtensionLongArgCall; *tail_ = new ExtensionLongArgCall(func, arg); tail_ = &(*tail_)->next; } void SaveFOTBuilder::startExtension(const CompoundExtensionFlowObj &fo, const NodePtr &node, Vector &ports) { *tail_ = new StartExtensionCall(fo, node, ports); tail_ = &(*tail_)->next; } void SaveFOTBuilder::endExtension(const CompoundExtensionFlowObj &fo) { *tail_ = new EndExtensionCall(fo); tail_ = &(*tail_)->next; } void SaveFOTBuilder::extension(const ExtensionFlowObj &fo, const NodePtr &node) { *tail_ = new ExtensionCall(fo, node); tail_ = &(*tail_)->next; } SaveFOTBuilder::CharactersCall::CharactersCall(const Char *s, size_t n) : str(s, n) { } void SaveFOTBuilder::CharactersCall::emit(FOTBuilder &fotb) const { fotb.characters(str.data(), str.size()); } StartSimplePageSequenceCall::StartSimplePageSequenceCall(FOTBuilder* hf[FOTBuilder::nHF]) { for ( unsigned i = 0; i < FOTBuilder::nHF; ++i ) hf[i] = &headerFooter[i]; } void StartSimplePageSequenceCall::emit(FOTBuilder& fotb) const { FOTBuilder* hf[FOTBuilder::nHF]; fotb.startSimplePageSequence(hf); for ( unsigned i = 0; i < FOTBuilder::nHF; ++i ) headerFooter[i].emit(*hf[i]); } StartFractionCall::StartFractionCall(FOTBuilder *&n, FOTBuilder *&d) { n = &numerator; d = &denominator; } void StartFractionCall::emit(FOTBuilder &fotb) const { FOTBuilder *n, *d; fotb.startFraction(n, d); numerator.emit(*n); denominator.emit(*d); } StartScriptCall::StartScriptCall(FOTBuilder *&p0, FOTBuilder *&p1, FOTBuilder *&p2, FOTBuilder *&p3, FOTBuilder *&p4, FOTBuilder *&p5) { p0 = &preSup; p1 = &preSub; p2 = &postSup; p3 = &postSub; p4 = &midSup; p5 = &midSub; } void StartScriptCall::emit(FOTBuilder &fotb) const { FOTBuilder *v[6]; fotb.startScript(v[0], v[1], v[2], v[3], v[4], v[5]); preSup.emit(*v[0]); preSub.emit(*v[1]); postSup.emit(*v[2]); postSub.emit(*v[3]); midSup.emit(*v[4]); midSub.emit(*v[5]); } StartMarkCall::StartMarkCall(FOTBuilder *&o, FOTBuilder *&u) { o = &overMark; u = &underMark; } void StartMarkCall::emit(FOTBuilder &fotb) const { FOTBuilder *o, *u; fotb.startMark(o, u); overMark.emit(*o); underMark.emit(*u); } StartFenceCall::StartFenceCall(FOTBuilder *&o, FOTBuilder *&c) { o = &open; c = &close; } void StartFenceCall::emit(FOTBuilder &fotb) const { FOTBuilder *o, *c; fotb.startFence(o, c); open.emit(*o); close.emit(*c); } StartRadicalCall::StartRadicalCall(FOTBuilder *&d) { d = °ree; } void StartRadicalCall::emit(FOTBuilder &fotb) const { FOTBuilder *d; fotb.startRadical(d); degree.emit(*d); } StartMathOperatorCall::StartMathOperatorCall(FOTBuilder *&o, FOTBuilder *&l, FOTBuilder *&u) { o = &oper; l = &lowerLimit; u = &upperLimit; } void StartMathOperatorCall::emit(FOTBuilder &fotb) const { FOTBuilder *o, *l, *u; fotb.startMathOperator(o, l, u); oper.emit(*o); lowerLimit.emit(*l); upperLimit.emit(*u); } StartMultiModeCall::StartMultiModeCall(const FOTBuilder::MultiMode *pm, const Vector &nm, Vector &v) : namedModes(nm) { if (pm) { hasPrincipalMode = 1; principalMode = *pm; } else hasPrincipalMode = 0; for (size_t i = v.size(); i > 0; i--) { ports.insert(new SaveFOTBuilder); v[i - 1] = ports.head(); } } StartMultiModeCall::StartMultiModeCall(const StartMultiModeCall& other) : principalMode(other.principalMode) , hasPrincipalMode(other.hasPrincipalMode) , namedModes(other.namedModes) , ports() { for (IListIter p(other.ports); !p.done(); p.next() ) ports.append(new SaveFOTBuilder(*p.cur())); } void StartMultiModeCall::emit(FOTBuilder &fotb) const { Vector v(namedModes.size()); fotb.startMultiMode(hasPrincipalMode ? &principalMode : 0, namedModes, v); IListIter p(ports); for (size_t i = 0; i < v.size(); i++) { p.cur()->emit(*v[i]); p.next(); } } StartTablePartCall::StartTablePartCall(const SaveFOTBuilder::TablePartNIC &nic, FOTBuilder *&h, FOTBuilder *&f) : arg(nic) { h = &header; f = &footer; } void StartTablePartCall::emit(FOTBuilder &fotb) const { FOTBuilder *h, *f; fotb.startTablePart(arg, h, f); header.emit(*h); footer.emit(*f); } SaveFOTBuilder::ExtensionCall::ExtensionCall(const ExtensionCall& other) : arg ( other.arg->copy()->asCompoundExtensionFlowObj() ) , node ( other.node ) { } void SaveFOTBuilder::ExtensionCall::emit(FOTBuilder &fotb) const { fotb.extension(*arg, node); } SaveFOTBuilder::EndExtensionCall::EndExtensionCall(const EndExtensionCall& other) : arg ( other.arg->copy()->asCompoundExtensionFlowObj() ) { } void SaveFOTBuilder::EndExtensionCall::emit(FOTBuilder &fotb) const { fotb.endExtension(*arg); } StartExtensionCall::StartExtensionCall(const FOTBuilder::CompoundExtensionFlowObj &fo, const NodePtr &nd, Vector &v) : flowObj(fo.copy()->asCompoundExtensionFlowObj()), node(nd) { for (size_t i = v.size(); i > 0; i--) { ports.insert(new SaveFOTBuilder); v[i - 1] = ports.head(); } } StartExtensionCall::StartExtensionCall(const StartExtensionCall& other) : ports() , node(other.node) , flowObj(other.flowObj->copy()->asCompoundExtensionFlowObj()) { for (IListIter p(other.ports); !p.done(); p.next() ) ports.append(new SaveFOTBuilder(*p.cur())); } void StartExtensionCall::emit(FOTBuilder &fotb) const { Vector portNames; flowObj->portNames(portNames); Vector v(portNames.size()); fotb.startExtension(*flowObj, node, v); IListIter p(ports); for (size_t i = 0; i < v.size(); i++) { p.cur()->emit(*v[i]); p.next(); } } SerialFOTBuilder::SerialFOTBuilder() { } void SerialFOTBuilder::startSimplePageSequence(FOTBuilder* headerFooter[FOTBuilder::nHF]) { for ( unsigned i = 0; i < nHF; ++i ) { save_.insert(new SaveFOTBuilder); headerFooter[nHF-1-i] = save_.head(); } startSimplePageSequenceSerial(); } void SerialFOTBuilder::endSimplePageSequenceHeaderFooter() { Owner hf[nHF]; for ( unsigned k = 0; k < nHF; ++k ) hf[k] = save_.get(); // output all 24 parts, but in same order as 1.2.1, for regression testing // replace with single loop later. // sorry about all those constants :( for (int i = 0; i < (1 << 2); i++) { for (int j = 0; j < 6; j++) { unsigned k = i | (j << 2); startSimplePageSequenceHeaderFooter(k); hf[k]->emit(*this); endSimplePageSequenceHeaderFooter(k); } } endAllSimplePageSequenceHeaderFooter(); } void SerialFOTBuilder::endSimplePageSequence() { endSimplePageSequenceSerial(); } void SerialFOTBuilder::startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator) { save_.insert(new SaveFOTBuilder); denominator = save_.head(); save_.insert(new SaveFOTBuilder); numerator = save_.head(); startFractionSerial(); } void SerialFOTBuilder::endFraction() { { Owner numerator(save_.get()); startFractionNumerator(); numerator->emit(*this); endFractionNumerator(); } { Owner denominator(save_.get()); startFractionDenominator(); denominator->emit(*this); endFractionDenominator(); } endFractionSerial(); } void SerialFOTBuilder::startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub) { save_.insert(new SaveFOTBuilder); midSub = save_.head(); save_.insert(new SaveFOTBuilder); midSup = save_.head(); save_.insert(new SaveFOTBuilder); postSub = save_.head(); save_.insert(new SaveFOTBuilder); postSup = save_.head(); save_.insert(new SaveFOTBuilder); preSub = save_.head(); save_.insert(new SaveFOTBuilder); preSup = save_.head(); startScriptSerial(); } void SerialFOTBuilder::endScript() { { Owner tem(save_.get()); startScriptPreSup(); tem->emit(*this); endScriptPreSup(); } { Owner tem(save_.get()); startScriptPreSub(); tem->emit(*this); endScriptPreSub(); } { Owner tem(save_.get()); startScriptPostSup(); tem->emit(*this); endScriptPostSup(); } { Owner tem(save_.get()); startScriptPostSub(); tem->emit(*this); endScriptPostSub(); } { Owner tem(save_.get()); startScriptMidSup(); tem->emit(*this); endScriptMidSup(); } { Owner tem(save_.get()); startScriptMidSub(); tem->emit(*this); endScriptMidSub(); } endScriptSerial(); } void SerialFOTBuilder::startMark(FOTBuilder *&overMark, FOTBuilder *&underMark) { save_.insert(new SaveFOTBuilder); underMark = save_.head(); save_.insert(new SaveFOTBuilder); overMark = save_.head(); startMarkSerial(); } void SerialFOTBuilder::endMark() { { Owner tem(save_.get()); startMarkOver(); tem->emit(*this); endMarkOver(); } { Owner tem(save_.get()); startMarkUnder(); tem->emit(*this); endMarkUnder(); } endMarkSerial(); } void SerialFOTBuilder::startFence(FOTBuilder *&open, FOTBuilder *&close) { save_.insert(new SaveFOTBuilder); close = save_.head(); save_.insert(new SaveFOTBuilder); open = save_.head(); startFenceSerial(); } void SerialFOTBuilder::endFence() { { Owner tem(save_.get()); startFenceOpen(); tem->emit(*this); endFenceOpen(); } { Owner tem(save_.get()); startFenceClose(); tem->emit(*this); endFenceClose(); } endFenceSerial(); } void SerialFOTBuilder::startRadical(FOTBuilder *°ree) { save_.insert(new SaveFOTBuilder); degree = save_.head(); startRadicalSerial(); } void SerialFOTBuilder::endRadical() { Owner tem(save_.get()); startRadicalDegree(); tem->emit(*this); endRadicalDegree(); endRadicalSerial(); } void SerialFOTBuilder::startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit) { save_.insert(new SaveFOTBuilder); upperLimit = save_.head(); save_.insert(new SaveFOTBuilder); lowerLimit = save_.head(); save_.insert(new SaveFOTBuilder); oper = save_.head(); startMathOperatorSerial(); } void SerialFOTBuilder::endMathOperator() { { Owner tem(save_.get()); startMathOperatorOperator(); tem->emit(*this); endMathOperatorOperator(); } { Owner tem(save_.get()); startMathOperatorLowerLimit(); tem->emit(*this); endMathOperatorLowerLimit(); } { Owner tem(save_.get()); startMathOperatorUpperLimit(); tem->emit(*this); endMathOperatorUpperLimit(); } endMathOperatorSerial(); } void SerialFOTBuilder::startSimplePageSequenceSerial() { start(); } void SerialFOTBuilder::endSimplePageSequenceSerial() { end(); } void SerialFOTBuilder::startSimplePageSequenceHeaderFooter(unsigned) { start(); } void SerialFOTBuilder::endSimplePageSequenceHeaderFooter(unsigned) { end(); } void SerialFOTBuilder::endAllSimplePageSequenceHeaderFooter() { } void SerialFOTBuilder::startFractionSerial() { start(); } void SerialFOTBuilder::endFractionSerial() { end(); } void SerialFOTBuilder::startFractionNumerator() { } void SerialFOTBuilder::endFractionNumerator() { } void SerialFOTBuilder::startFractionDenominator() { } void SerialFOTBuilder::endFractionDenominator() { } void SerialFOTBuilder::startScriptSerial() { start(); } void SerialFOTBuilder::endScriptSerial() { end(); } void SerialFOTBuilder::startScriptPreSup() { } void SerialFOTBuilder::endScriptPreSup() { } void SerialFOTBuilder::startScriptPreSub() { } void SerialFOTBuilder::endScriptPreSub() { } void SerialFOTBuilder::startScriptPostSup() { } void SerialFOTBuilder::endScriptPostSup() { } void SerialFOTBuilder::startScriptPostSub() { } void SerialFOTBuilder::endScriptPostSub() { } void SerialFOTBuilder::startScriptMidSup() { } void SerialFOTBuilder::endScriptMidSup() { } void SerialFOTBuilder::startScriptMidSub() { } void SerialFOTBuilder::endScriptMidSub() { } void SerialFOTBuilder::startMarkSerial() { start(); } void SerialFOTBuilder::endMarkSerial() { end(); } void SerialFOTBuilder::startMarkOver() { } void SerialFOTBuilder::endMarkOver() { } void SerialFOTBuilder::startMarkUnder() { } void SerialFOTBuilder::endMarkUnder() { } void SerialFOTBuilder::startFenceSerial() { start(); } void SerialFOTBuilder::endFenceSerial() { end(); } void SerialFOTBuilder::startFenceOpen() { } void SerialFOTBuilder::endFenceOpen() { } void SerialFOTBuilder::startFenceClose() { } void SerialFOTBuilder::endFenceClose() { } void SerialFOTBuilder::startRadicalSerial() { start(); } void SerialFOTBuilder::endRadicalSerial() { end(); } void SerialFOTBuilder::startRadicalDegree() { } void SerialFOTBuilder::endRadicalDegree() { } void SerialFOTBuilder::startMathOperatorSerial() { start(); } void SerialFOTBuilder::endMathOperatorSerial() { end(); } void SerialFOTBuilder::startMathOperatorOperator() { } void SerialFOTBuilder::endMathOperatorOperator() { } void SerialFOTBuilder::startMathOperatorLowerLimit() { } void SerialFOTBuilder::endMathOperatorLowerLimit() { } void SerialFOTBuilder::startMathOperatorUpperLimit() { } void SerialFOTBuilder::endMathOperatorUpperLimit() { } void SerialFOTBuilder::startTablePart(const FOTBuilder::TablePartNIC &nic, FOTBuilder *&header, FOTBuilder *&footer) { save_.insert(new SaveFOTBuilder); footer = save_.head(); save_.insert(new SaveFOTBuilder); header = save_.head(); startTablePartSerial(nic); } void SerialFOTBuilder::endTablePart() { Owner header(save_.get()); startTablePartHeader(); header->emit(*this); endTablePartHeader(); Owner footer(save_.get()); startTablePartFooter(); footer->emit(*this); endTablePartFooter(); endTablePartSerial(); } void SerialFOTBuilder::startTablePartSerial(const TablePartNIC &) { start(); } void SerialFOTBuilder::endTablePartSerial() { end(); } void SerialFOTBuilder::startTablePartHeader() { } void SerialFOTBuilder::endTablePartHeader() { } void SerialFOTBuilder::startTablePartFooter() { } void SerialFOTBuilder::endTablePartFooter() { } void SerialFOTBuilder::startMultiMode(const MultiMode *principalMode, const Vector &namedModes, Vector &namedPorts) { for (size_t i = namedModes.size(); i > 0; i--) { save_.insert(new SaveFOTBuilder); namedPorts[i - 1] = save_.head(); } multiModeStack_.push_back(namedModes); startMultiModeSerial(principalMode); } void SerialFOTBuilder::endMultiMode() { const Vector &namedModes = multiModeStack_.back(); for (size_t i = 0; i < namedModes.size(); i++) { Owner mode(save_.get()); startMultiModeMode(namedModes[i]); mode->emit(*this); endMultiModeMode(); } endMultiModeSerial(); multiModeStack_.resize(multiModeStack_.size() - 1); } void SerialFOTBuilder::startMultiModeSerial(const MultiMode *) { start(); } void SerialFOTBuilder::endMultiModeSerial() { end(); } void SerialFOTBuilder::startMultiModeMode(const MultiMode &) { } void SerialFOTBuilder::endMultiModeMode() { } void SerialFOTBuilder::startExtension(const CompoundExtensionFlowObj &flowObj, const NodePtr &nd, Vector &ports) { for (size_t i = ports.size(); i > 0; i--) { save_.insert(new SaveFOTBuilder); ports[i - 1] = save_.head(); } startExtensionSerial(flowObj, nd); } void SerialFOTBuilder::endExtension(const CompoundExtensionFlowObj &flowObj) { Vector portNames; flowObj.portNames(portNames); for (size_t i = 0; i < portNames.size(); i++) { Owner stream(save_.get()); startExtensionStream(portNames[i]); stream->emit(*this); endExtensionStream(portNames[i]); } endExtensionSerial(flowObj); } void SerialFOTBuilder::startExtensionSerial(const CompoundExtensionFlowObj &, const NodePtr &) { start(); } void SerialFOTBuilder::endExtensionSerial(const CompoundExtensionFlowObj &) { end(); } void SerialFOTBuilder::startExtensionStream(const StringC &) { } void SerialFOTBuilder::endExtensionStream(const StringC &) { } FOTBuilder::ExtensionFlowObj::~ExtensionFlowObj() { } FOTBuilder::CompoundExtensionFlowObj * FOTBuilder::ExtensionFlowObj::asCompoundExtensionFlowObj() { return 0; } const FOTBuilder::CompoundExtensionFlowObj * FOTBuilder::ExtensionFlowObj::asCompoundExtensionFlowObj() const { return 0; } bool FOTBuilder::ExtensionFlowObj::hasNIC(const StringC &) const { return 0; } void FOTBuilder::ExtensionFlowObj::setNIC(const StringC &, const Value &) { CANNOT_HAPPEN(); } FOTBuilder::CompoundExtensionFlowObj * FOTBuilder::CompoundExtensionFlowObj::asCompoundExtensionFlowObj() { return this; } const FOTBuilder::CompoundExtensionFlowObj * FOTBuilder::CompoundExtensionFlowObj::asCompoundExtensionFlowObj() const { return this; } bool FOTBuilder::CompoundExtensionFlowObj::hasPrincipalPort() const { return 1; } void FOTBuilder::CompoundExtensionFlowObj::portNames(Vector &) const { } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/FOTBuilder.h0000644000021000000240000012775707037165456013033 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #ifndef FOTBuilder_INCLUDED #define FOTBuilder_INCLUDED 1 #include #include #include #include "Node.h" #include #include #include #include #include #include #include #include #include "dsssl_ns.h" // This is a work around for a bug in Sun C++ 4.1. // The class local typedef of PublicId will cause it to reject a // subsequent declaration of the class PublicId, but it's happy // if it sees the class first. #ifdef __SUNPRO_CC #include #endif #ifdef SP_USE_DLL #ifdef BUILD_LIBSTYLE #define STYLE_API SP_DLLEXPORT #else #define STYLE_API SP_DLLIMPORT #endif #else /* not SP_USE_DLL */ #define STYLE_API /* as nothing */ #endif /* not SP_USE_DLL */ #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class SaveFOTBuilder; class STYLE_API FOTBuilder { public: enum Symbol { symbolFalse, symbolTrue, symbolNotApplicable, // These are guaranteed to be in increasing order of weight, // and expansion. symbolUltraCondensed, symbolExtraCondensed, symbolCondensed, symbolSemiCondensed, symbolUltraLight, symbolExtraLight, symbolLight, symbolSemiLight, symbolMedium, symbolSemiExpanded, symbolExpanded, symbolExtraExpanded, symbolUltraExpanded, symbolSemiBold, symbolBold, symbolExtraBold, symbolUltraBold, symbolUpright, symbolOblique, symbolBackSlantedOblique, symbolItalic, symbolBackSlantedItalic, symbolStart, symbolEnd, symbolCenter, symbolJustify, symbolSpreadInside, symbolSpreadOutside, symbolPageInside, symbolPageOutside, symbolInitial, symbolFinal, symbolWrap, symbolAsis, symbolAsisWrap, symbolAsisTruncate, symbolNone, symbolIndent, symbolBefore, symbolThrough, symbolAfter, symbolTopToBottom, symbolLeftToRight, symbolBottomToTop, symbolRightToLeft, symbolInside, symbolOutside, symbolHorizontal, symbolVertical, symbolEscapement, symbolLineProgression, symbolMath, symbolOrdinary, symbolOperator, symbolBinary, symbolRelation, symbolOpening, symbolClosing, symbolPunctuation, symbolInner, symbolSpace, symbolPage, symbolPageRegion, symbolColumnSet, symbolColumn, symbolMax, symbolMaxUniform, symbolMiter, symbolRound, symbolBevel, symbolButt, symbolSquare, symbolLoose, symbolNormal, symbolKern, symbolTight, symbolTouch, symbolPreserve, symbolCollapse, symbolIgnore, symbolRelative, symbolDisplay, symbolInline, symbolBorder, symbolBackground, symbolBoth, symbolBase, symbolFont, symbolTop, symbolBottom, symbolSpread, symbolSolid, symbolOutline, symbolWith, symbolAgainst, symbolForce, symbolIndependent, symbolPile, symbolSupOut, symbolSubOut, symbolLeadEdge, symbolTrailEdge, symbolExplicit, symbolRowMajor, symbolColumnMajor, symbolUppercase, symbolLowercase, symbolCapitalize }; enum { nSymbols = symbolCapitalize + 1 }; typedef const char *PublicId; struct STYLE_API GlyphId { GlyphId() : publicId(0), suffix(0) { } GlyphId(const char *s, unsigned long n = 0) : publicId(s), suffix(n) { } PublicId publicId; // If suffix is non-zero, then add a double-colon plus // the suffix in decimal onto publicId to get the complete // public identifier of the glyph id. unsigned long suffix; }; struct STYLE_API GlyphSubstTable : public Resource { unsigned uniqueId; Vector pairs; GlyphId subst(const GlyphId &) const; }; // SP_LETTER2('U', 'K') #define SP_LETTER2(c1, c2) (((c1) << 8) | (c2)) typedef unsigned Letter2; typedef long Length; struct LengthSpec { LengthSpec(long len = 0) : length(len), displaySizeFactor(0.0) { } long length; double displaySizeFactor; operator bool() const { return length != 0 || displaySizeFactor != 0.0; } }; struct STYLE_API TableLengthSpec : LengthSpec { TableLengthSpec() : tableUnitFactor(0.0) { } double tableUnitFactor; }; struct STYLE_API OptLengthSpec { OptLengthSpec() : hasLength(0) { } bool hasLength; LengthSpec length; }; struct STYLE_API DisplaySpace { DisplaySpace() : priority(0), conditional(1), force(0) { } LengthSpec nominal; LengthSpec min; LengthSpec max; long priority; bool conditional; bool force; }; struct STYLE_API InlineSpace { LengthSpec nominal; LengthSpec min; LengthSpec max; }; struct STYLE_API OptInlineSpace { OptInlineSpace() : hasSpace(0) { } bool hasSpace; InlineSpace space; }; // non-inherited characteristics for all displayed flow objects struct STYLE_API DisplayNIC { DisplayNIC(); DisplaySpace spaceBefore; DisplaySpace spaceAfter; Symbol positionPreference; Symbol keep; Symbol breakBefore; Symbol breakAfter; bool keepWithPrevious; bool keepWithNext; bool mayViolateKeepBefore; bool mayViolateKeepAfter; }; struct STYLE_API InlineNIC { InlineNIC(); long breakBeforePriority; long breakAfterPriority; }; struct STYLE_API DisplayGroupNIC : DisplayNIC { DisplayGroupNIC(); bool hasCoalesceId; StringC coalesceId; }; struct STYLE_API ExternalGraphicNIC : DisplayNIC, InlineNIC { ExternalGraphicNIC(); bool isDisplay; Symbol scaleType; // symbolFalse if not a symbol double scale[2]; // if scaleType == symbolFalse StringC entitySystemId; StringC notationSystemId; bool hasMaxWidth; LengthSpec maxWidth; bool hasMaxHeight; LengthSpec maxHeight; // These apply only if !isDisplay // symbolFalse if no escapementDirection Symbol escapementDirection; LengthSpec positionPointX; LengthSpec positionPointY; }; struct STYLE_API BoxNIC : DisplayNIC, InlineNIC { BoxNIC(); bool isDisplay; }; struct STYLE_API RuleNIC : DisplayNIC, InlineNIC { RuleNIC(); Symbol orientation; bool hasLength; LengthSpec length; }; struct STYLE_API LeaderNIC : InlineNIC { LeaderNIC(); bool hasLength; LengthSpec length; }; // A paragraph has the same non-inherited characteristics // as a display-group. typedef DisplayNIC ParagraphNIC; struct STYLE_API CharacterNIC { CharacterNIC(); enum { cIsDropAfterLineBreak, cIsDropUnlessBeforeLineBreak, cIsPunct, cIsInputWhitespace, cIsInputTab, cIsRecordEnd, cIsSpace, cChar, cGlyphId, cScript, cMathClass, cMathFontPosture, cBreakBeforePriority, cBreakAfterPriority }; unsigned specifiedC; Char ch; GlyphId glyphId; long breakBeforePriority; long breakAfterPriority; Symbol mathClass; Symbol mathFontPosture; PublicId script; bool isDropAfterLineBreak; bool isDropUnlessBeforeLineBreak; bool isPunct; bool isInputWhitespace; bool isInputTab; bool isRecordEnd; bool isSpace; // This doesn't have a flag in specifiedC, // because it has a fixed default. double stretchFactor; }; typedef InlineNIC LineFieldNIC; struct STYLE_API TableNIC : public DisplayNIC { TableNIC(); enum WidthType { widthFull, widthMinimum, widthExplicit }; WidthType widthType; LengthSpec width; }; typedef DisplayNIC TablePartNIC; struct STYLE_API TableColumnNIC { TableColumnNIC(); unsigned columnIndex; // zero-based unsigned nColumnsSpanned; bool hasWidth; TableLengthSpec width; }; struct STYLE_API TableCellNIC { TableCellNIC(); // If true, this isn't a real table cell. // Rather it's one that can be used to fill in cells missing in this row. bool missing; unsigned columnIndex; // zero-based unsigned nColumnsSpanned; unsigned nRowsSpanned; }; struct STYLE_API DeviceRGBColor { unsigned char red; unsigned char green; unsigned char blue; }; struct STYLE_API MultiMode { MultiMode(); bool hasDesc; StringC name; StringC desc; }; struct STYLE_API Address { enum Type { // An address of #f none, // An address that was resolved by the front-end to a node // Only the node member is valid. resolvedNode, // node contains current node, params[0] is string. idref, entity, sgmlDocument, hytimeLinkend, tei, html }; Type type; // Gives current node or resolved node. NodePtr node; StringC params[3]; }; virtual SaveFOTBuilder *asSaveFOTBuilder(); virtual ~FOTBuilder(); // Default for compound flow objects virtual void start(); virtual void end(); // Default for atomic flow objects: defaults to start(); end(); virtual void atomic(); // Atomic flow objects virtual void characters(const Char *, size_t); virtual void characters(const Vector &); // Like characters(), but data comes from charChunk() on a NodePtr. // If you are building a tree, then the NodePtr can be saved instead // of the data. The default implementation calls characters(). virtual void charactersFromNode(const NodePtr &, const Char *, size_t); virtual void character(const CharacterNIC &); virtual void paragraphBreak(const ParagraphNIC &); virtual void externalGraphic(const ExternalGraphicNIC &); virtual void rule(const RuleNIC &); virtual void alignmentPoint(); // For flow object class public id // "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction" virtual void formattingInstruction(const StringC &); // Non-atomic flow objects virtual void startSequence(); virtual void endSequence(); virtual void startLineField(const LineFieldNIC &); virtual void endLineField(); virtual void startParagraph(const ParagraphNIC &); virtual void endParagraph(); virtual void startDisplayGroup(const DisplayGroupNIC &); virtual void endDisplayGroup(); virtual void startScroll(); virtual void endScroll(); virtual void startLink(const Address &); virtual void endLink(); virtual void startMarginalia(); virtual void endMarginalia(); virtual void startMultiMode(const MultiMode *principalPort, // null if no principal port const Vector &namedPorts, Vector &); virtual void endMultiMode(); virtual void startScore(Char); virtual void startScore(const LengthSpec &); virtual void startScore(Symbol); virtual void endScore(); virtual void startLeader(const LeaderNIC &); virtual void endLeader(); virtual void startSideline(); virtual void endSideline(); virtual void startBox(const BoxNIC &); virtual void endBox(); virtual void startSideBySide(const DisplayNIC&); virtual void endSideBySide(); virtual void startSideBySideItem(); virtual void endSideBySideItem(); // Tables virtual void startTable(const TableNIC &); virtual void endTable(); // A call for each border is made immediately // after startTable(), each preceded by any appropriate set*() calls. virtual void tableBeforeRowBorder(); virtual void tableAfterRowBorder(); virtual void tableBeforeColumnBorder(); virtual void tableAfterColumnBorder(); virtual void startTablePart(const TablePartNIC &, FOTBuilder *&header, FOTBuilder *&footer); virtual void endTablePart(); virtual void tableColumn(const TableColumnNIC &); virtual void startTableRow(); virtual void endTableRow(); virtual void startTableCell(const TableCellNIC &); virtual void endTableCell(); virtual void tableCellBeforeRowBorder(); virtual void tableCellAfterRowBorder(); virtual void tableCellBeforeColumnBorder(); virtual void tableCellAfterColumnBorder(); // Implementation must set numerator and denominator // must be set to non-null values. virtual void startMathSequence(); virtual void endMathSequence(); virtual void startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator); // startFraction is followed by call to fractionBar with set...() calls // intervening virtual void fractionBar(); virtual void endFraction(); virtual void startUnmath(); virtual void endUnmath(); virtual void startSuperscript(); virtual void endSuperscript(); virtual void startSubscript(); virtual void endSubscript(); virtual void startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub); virtual void endScript(); virtual void startMark(FOTBuilder *&overMark, FOTBuilder *&underMark); virtual void endMark(); virtual void startFence(FOTBuilder *&open, FOTBuilder *&close); virtual void endFence(); virtual void startRadical(FOTBuilder *°ree); // startRadical is followed by one of the following virtual void radicalRadical(const CharacterNIC &); virtual void radicalRadicalDefaulted(); virtual void endRadical(); virtual void startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit); virtual void endMathOperator(); struct STYLE_API GridNIC { GridNIC(); unsigned nColumns; unsigned nRows; }; virtual void startGrid(const GridNIC &); virtual void endGrid(); struct STYLE_API GridCellNIC { GridCellNIC(); unsigned columnNumber; unsigned rowNumber; }; virtual void startGridCell(const GridCellNIC &); virtual void endGridCell(); // Simple page // Headers and footers are treated like a separate port. // There are 24 different parts to the headers and footers // numbered 0 to 027; the numbers are computed by or'ing the // following flags. enum HF { // first page or other page firstHF = 01, otherHF = 0, // front page or back page frontHF = 02, backHF = 0, // header or footer headerHF = 04, footerHF = 0, // left, center or right part of header leftHF = 0, centerHF = 010, rightHF = 020, // number of different HF calls nHF = 030 }; virtual void startSimplePageSequence(FOTBuilder* headerFooter[nHF]); virtual void endSimplePageSequenceHeaderFooter(); virtual void endSimplePageSequence(); // page-number sosofo virtual void pageNumber(); // Inherited characteristics // Set the value of the characteristic for the next flow object. // Inherited characteristics that are not explicitly set have // the same value as the parent flow object. virtual void setFontSize(Length); virtual void setFontFamilyName(const StringC &); virtual void setFontWeight(Symbol); virtual void setFontPosture(Symbol); virtual void setStartIndent(const LengthSpec &); virtual void setEndIndent(const LengthSpec &); virtual void setFirstLineStartIndent(const LengthSpec &); virtual void setLastLineEndIndent(const LengthSpec &); virtual void setLineSpacing(const LengthSpec &); virtual void setFieldWidth(const LengthSpec &); virtual void setMarginaliaSep(const LengthSpec &); virtual void setLines(Symbol); virtual void setQuadding(Symbol); virtual void setDisplayAlignment(Symbol); virtual void setFieldAlign(Symbol); virtual void setColor(const DeviceRGBColor &); virtual void setBackgroundColor(); // background of #f virtual void setBackgroundColor(const DeviceRGBColor &); virtual void setBorderPresent(bool); virtual void setLineThickness(Length); virtual void setCellBeforeRowMargin(Length); virtual void setCellAfterRowMargin(Length); virtual void setCellBeforeColumnMargin(Length); virtual void setCellAfterColumnMargin(Length); virtual void setLineSep(Length); virtual void setBoxSizeBefore(Length); virtual void setBoxSizeAfter(Length); virtual void setSideBySideOverlapControl(Symbol); virtual void setSideBySidePreAlign(Symbol); virtual void setSideBySidePostAlign(Symbol); virtual void setPositionPointShift(const LengthSpec &); virtual void setStartMargin(const LengthSpec &); virtual void setEndMargin(const LengthSpec &); virtual void setSidelineSep(const LengthSpec &); virtual void setAsisWrapIndent(const LengthSpec &); virtual void setLineNumberSep(const LengthSpec &); virtual void setLastLineJustifyLimit(const LengthSpec &); virtual void setJustifyGlyphSpaceMaxAdd(const LengthSpec &); virtual void setJustifyGlyphSpaceMaxRemove(const LengthSpec &); virtual void setTableCornerRadius(const LengthSpec &); virtual void setBoxCornerRadius(const LengthSpec &); virtual void setMinPreLineSpacing(const OptLengthSpec &); virtual void setMinPostLineSpacing(const OptLengthSpec &); virtual void setMinLeading(const OptLengthSpec &); virtual void setInhibitLineBreaks(bool); virtual void setHyphenate(bool); virtual void setKern(bool); virtual void setLigature(bool); virtual void setScoreSpaces(bool); virtual void setFloatOutMarginalia(bool); virtual void setFloatOutSidelines(bool); virtual void setFloatOutLineNumbers(bool); virtual void setCellBackground(bool); virtual void setSpanWeak(bool); virtual void setIgnoreRecordEnd(bool); virtual void setNumberedLines(bool); virtual void setHangingPunct(bool); virtual void setBoxOpenEnd(bool); virtual void setTruncateLeader(bool); virtual void setAlignLeader(bool); virtual void setTablePartOmitMiddleHeader(bool); virtual void setTablePartOmitMiddleFooter(bool); virtual void setBorderOmitAtBreak(bool); virtual void setPrincipalModeSimultaneous(bool); virtual void setMarginaliaKeepWithPrevious(bool); virtual void setGridEquidistantRows(bool); virtual void setGridEquidistantColumns(bool); virtual void setLineJoin(Symbol); virtual void setLineCap(Symbol); virtual void setLineNumberSide(Symbol); virtual void setKernMode(Symbol); virtual void setInputWhitespaceTreatment(Symbol); virtual void setFillingDirection(Symbol); virtual void setWritingMode(Symbol); virtual void setLastLineQuadding(Symbol); virtual void setMathDisplayMode(Symbol); virtual void setScriptPreAlign(Symbol); virtual void setScriptPostAlign(Symbol); virtual void setScriptMidSupAlign(Symbol); virtual void setScriptMidSubAlign(Symbol); virtual void setNumeratorAlign(Symbol); virtual void setDenominatorAlign(Symbol); virtual void setGridPositionCellType(Symbol); virtual void setGridColumnAlignment(Symbol); virtual void setGridRowAlignment(Symbol); virtual void setBoxType(Symbol); virtual void setGlyphAlignmentMode(Symbol); virtual void setBoxBorderAlignment(Symbol); virtual void setCellRowAlignment(Symbol); virtual void setBorderAlignment(Symbol); virtual void setSidelineSide(Symbol); virtual void setHyphenationKeep(Symbol); virtual void setFontStructure(Symbol); virtual void setFontProportionateWidth(Symbol); virtual void setCellCrossed(Symbol); virtual void setMarginaliaSide(Symbol); virtual void setLayer(long); virtual void setBackgroundLayer(long); virtual void setBorderPriority(long); virtual void setLineRepeat(long); virtual void setSpan(long); virtual void setMinLeaderRepeat(long); virtual void setHyphenationRemainCharCount(long); virtual void setHyphenationPushCharCount(long); virtual void setWidowCount(long); virtual void setOrphanCount(long); // 0 means #f virtual void setExpandTabs(long); virtual void setHyphenationLadderCount(long); // public id or #f virtual void setBackgroundTile(PublicId); virtual void setLineBreakingMethod(PublicId); virtual void setLineCompositionMethod(PublicId); virtual void setImplicitBidiMethod(PublicId); virtual void setGlyphSubstMethod(PublicId); virtual void setGlyphReorderMethod(PublicId); virtual void setHyphenationMethod(PublicId); virtual void setTableAutoWidthMethod(PublicId); virtual void setFontName(PublicId); // Two-letter code virtual void setLanguage(Letter2); virtual void setCountry(Letter2); virtual void setEscapementSpaceBefore(const InlineSpace &); virtual void setEscapementSpaceAfter(const InlineSpace &); virtual void setInlineSpaceSpace(const OptInlineSpace &); // If a symbol or #f. (Set to #f if a procedure, since this case is handled // by the engine.) virtual void setCharMap(Symbol); // For simple page sequence virtual void setPageWidth(Length); virtual void setPageHeight(Length); virtual void setLeftMargin(Length); virtual void setRightMargin(Length); virtual void setTopMargin(Length); virtual void setBottomMargin(Length); virtual void setHeaderMargin(Length); virtual void setFooterMargin(Length); // Others virtual void setGlyphSubstTable(const Vector > &); // Backlinks // processingMode is empty for initial processing mode. virtual void startNode(const NodePtr &, const StringC &processingMode); virtual void endNode(); virtual void currentNodePageNumber(const NodePtr &); class CompoundExtensionFlowObj; class STYLE_API ExtensionFlowObj { public: virtual ~ExtensionFlowObj(); class Value { public: virtual bool convertString(StringC &) const = 0; virtual bool convertStringPairList(Vector &) const = 0; virtual bool convertStringList(Vector &) const = 0; virtual bool convertBoolean(bool &) const = 0; }; virtual CompoundExtensionFlowObj *asCompoundExtensionFlowObj(); virtual const CompoundExtensionFlowObj *asCompoundExtensionFlowObj() const; virtual bool hasNIC(const StringC &) const; virtual void setNIC(const StringC &, const Value &); virtual ExtensionFlowObj *copy() const = 0; }; class STYLE_API CompoundExtensionFlowObj : public ExtensionFlowObj { public: CompoundExtensionFlowObj *asCompoundExtensionFlowObj(); const CompoundExtensionFlowObj *asCompoundExtensionFlowObj() const; virtual bool hasPrincipalPort() const; virtual void portNames(Vector &) const; }; // extension inherited characteristics virtual void extensionSet(void (FOTBuilder::*)(bool), bool); virtual void extensionSet(void (FOTBuilder::*)(const StringC &), const StringC &); virtual void extensionSet(void (FOTBuilder::*)(long), long); // extension flow objects virtual void extension(const ExtensionFlowObj &, const NodePtr &); virtual void startExtension(const CompoundExtensionFlowObj &, const NodePtr &, Vector &ports); virtual void endExtension(const CompoundExtensionFlowObj &); struct STYLE_API Extension { const char *pubid; void (FOTBuilder::*boolSetter)(bool); void (FOTBuilder::*stringSetter)(const StringC &); void (FOTBuilder::*integerSetter)(long); void (FOTBuilder::*lengthSetter)(Length); const ExtensionFlowObj *flowObj; }; struct STYLE_API Feature { const char *name; bool partial; }; struct STYLE_API Description { // These must be zero-terminated lists const Extension *extensions; const Feature *features; // Set this if you want character NICs whose default values are the values // of character properties to be included correctly. This degrades per- // formance, so if you don't care (i.e. the formatter has its own // values), set to false. bool wantCharPropertyNICs; // A zero-terminated list of media type names according to // HTML 4.0 Specification. // Instead of putting "all" in there, leave the list empty // to match any media type. const char **media; }; static const char *symbolName(Symbol); }; class STYLE_API SaveFOTBuilder : public Link, public FOTBuilder { public: SaveFOTBuilder(); SaveFOTBuilder(const SaveFOTBuilder&); ~SaveFOTBuilder(); SaveFOTBuilder& operator = ( const SaveFOTBuilder& ); void clear(); SaveFOTBuilder *asSaveFOTBuilder(); virtual void emit(FOTBuilder &) const; class Emitter; void characters(const Char *, size_t); void characters(const Vector &); void charactersFromNode(const NodePtr &, const Char *, size_t); void character(const CharacterNIC &); void paragraphBreak(const ParagraphNIC &); void externalGraphic(const ExternalGraphicNIC &); void rule(const RuleNIC &); void alignmentPoint(); void formattingInstruction(const StringC &); void startSequence(); void endSequence(); void startLineField(const LineFieldNIC &); void endLineField(); void startParagraph(const ParagraphNIC &); void endParagraph(); void startDisplayGroup(const DisplayGroupNIC &); void endDisplayGroup(); void startScroll(); void endScroll(); void startLink(const Address &); void endLink(); void startMultiMode(const MultiMode *principalPort, const Vector &namedPorts, Vector &); void endMultiMode(); void startMarginalia(); void endMarginalia(); void startScore(Char); void startScore(const LengthSpec &); void startScore(Symbol); void endScore(); void startLeader(const LeaderNIC &); void endLeader(); void startSideline(); void endSideline(); void startBox(const BoxNIC &); void endBox(); void startSideBySide(const DisplayNIC&); void endSideBySide(); void startSideBySideItem(); void endSideBySideItem(); void startSimplePageSequence(FOTBuilder* headerFooter[nHF]); void endSimplePageSequenceHeaderFooter(); void endSimplePageSequence(); // page-number sosofo void pageNumber(); // math void startMathSequence(); void endMathSequence(); void startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator); void fractionBar(); void endFraction(); void startUnmath(); void endUnmath(); void startSuperscript(); void endSuperscript(); void startSubscript(); void endSubscript(); void startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub); void endScript(); void startMark(FOTBuilder *&overMark, FOTBuilder *&underMark); void endMark(); void startFence(FOTBuilder *&open, FOTBuilder *&close); void endFence(); void startRadical(FOTBuilder *°ree); void endRadical(); void radicalRadical(const CharacterNIC &); void radicalRadicalDefaulted(); void startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit); void endMathOperator(); void startGrid(const GridNIC &); void endGrid(); void startGridCell(const GridCellNIC &); void endGridCell(); // Tables void startTable(const TableNIC &); void endTable(); void tableBeforeRowBorder(); void tableAfterRowBorder(); void tableBeforeColumnBorder(); void tableAfterColumnBorder(); void startTablePart(const TablePartNIC &, FOTBuilder *&header, FOTBuilder *&footer); void endTablePart(); void tableColumn(const TableColumnNIC &); void startTableRow(); void endTableRow(); void startTableCell(const TableCellNIC &); void endTableCell(); void tableCellBeforeRowBorder(); void tableCellAfterRowBorder(); void tableCellBeforeColumnBorder(); void tableCellAfterColumnBorder(); // Inherited characteristics void setFontSize(Length); void setFontFamilyName(const StringC &); void setFontWeight(Symbol); void setFontPosture(Symbol); void setStartIndent(const LengthSpec &); void setEndIndent(const LengthSpec &); void setFirstLineStartIndent(const LengthSpec &); void setLastLineEndIndent(const LengthSpec &); void setLineSpacing(const LengthSpec &); void setFieldWidth(const LengthSpec &); void setLines(Symbol); void setQuadding(Symbol); void setDisplayAlignment(Symbol); void setFieldAlign(Symbol); void setColor(const DeviceRGBColor &); void setBackgroundColor(const DeviceRGBColor &); void setBackgroundColor(); void setPageWidth(Length); void setPageHeight(Length); void setLeftMargin(Length); void setRightMargin(Length); void setTopMargin(Length); void setBottomMargin(Length); void setHeaderMargin(Length); void setFooterMargin(Length); void setBorderPresent(bool); void setLineThickness(Length); void setCellBeforeRowMargin(Length); void setCellAfterRowMargin(Length); void setCellBeforeColumnMargin(Length); void setCellAfterColumnMargin(Length); void setLineSep(Length); void setBoxSizeBefore(Length); void setBoxSizeAfter(Length); void setSideBySideOverlapControl(Symbol); void setSideBySidePreAlign(Symbol); void setSideBySidePostAlign(Symbol); void setPositionPointShift(const LengthSpec &); void setStartMargin(const LengthSpec &); void setEndMargin(const LengthSpec &); void setSidelineSep(const LengthSpec &); void setAsisWrapIndent(const LengthSpec &); void setLineNumberSep(const LengthSpec &); void setLastLineJustifyLimit(const LengthSpec &); void setJustifyGlyphSpaceMaxAdd(const LengthSpec &); void setJustifyGlyphSpaceMaxRemove(const LengthSpec &); void setTableCornerRadius(const LengthSpec &); void setBoxCornerRadius(const LengthSpec &); void setMarginaliaSep(const LengthSpec &); void setMinPreLineSpacing(const OptLengthSpec &); void setMinPostLineSpacing(const OptLengthSpec &); void setMinLeading(const OptLengthSpec &); void setInhibitLineBreaks(bool); void setHyphenate(bool); void setKern(bool); void setLigature(bool); void setScoreSpaces(bool); void setFloatOutMarginalia(bool); void setFloatOutSidelines(bool); void setFloatOutLineNumbers(bool); void setCellBackground(bool); void setSpanWeak(bool); void setIgnoreRecordEnd(bool); void setNumberedLines(bool); void setHangingPunct(bool); void setBoxOpenEnd(bool); void setTruncateLeader(bool); void setAlignLeader(bool); void setTablePartOmitMiddleHeader(bool); void setTablePartOmitMiddleFooter(bool); void setBorderOmitAtBreak(bool); void setPrincipalModeSimultaneous(bool); void setMarginaliaKeepWithPrevious(bool); void setGridEquidistantRows(bool); void setGridEquidistantColumns(bool); void setLineJoin(Symbol); void setLineCap(Symbol); void setLineNumberSide(Symbol); void setKernMode(Symbol); void setInputWhitespaceTreatment(Symbol); void setFillingDirection(Symbol); void setWritingMode(Symbol); void setLastLineQuadding(Symbol); void setMathDisplayMode(Symbol); void setScriptPreAlign(Symbol); void setScriptPostAlign(Symbol); void setScriptMidSupAlign(Symbol); void setScriptMidSubAlign(Symbol); void setNumeratorAlign(Symbol); void setDenominatorAlign(Symbol); void setGridPositionCellType(Symbol); void setGridColumnAlignment(Symbol); void setGridRowAlignment(Symbol); void setBoxType(Symbol); void setGlyphAlignmentMode(Symbol); void setBoxBorderAlignment(Symbol); void setCellRowAlignment(Symbol); void setBorderAlignment(Symbol); void setSidelineSide(Symbol); void setHyphenationKeep(Symbol); void setFontStructure(Symbol); void setFontProportionateWidth(Symbol); void setCellCrossed(Symbol); void setMarginaliaSide(Symbol); void setLayer(long); void setBackgroundLayer(long); void setBorderPriority(long); void setLineRepeat(long); void setSpan(long); void setMinLeaderRepeat(long); void setHyphenationRemainCharCount(long); void setHyphenationPushCharCount(long); void setWidowCount(long); void setOrphanCount(long); void setExpandTabs(long); void setHyphenationLadderCount(long); void setBackgroundTile(PublicId); void setLineBreakingMethod(PublicId); void setLineCompositionMethod(PublicId); void setImplicitBidiMethod(PublicId); void setGlyphSubstMethod(PublicId); void setGlyphReorderMethod(PublicId); void setHyphenationMethod(PublicId); void setTableAutoWidthMethod(PublicId); void setFontName(PublicId); void setLanguage(Letter2); void setCountry(Letter2); void setEscapementSpaceBefore(const InlineSpace &); void setEscapementSpaceAfter(const InlineSpace &); void setInlineSpaceSpace(const OptInlineSpace &); void setCharMap(Symbol); void setGlyphSubstTable(const Vector > &); void startNode(const NodePtr &, const StringC &processingMode); void endNode(); void currentNodePageNumber(const NodePtr &); void extensionSet(void (FOTBuilder::*)(bool), bool); void extensionSet(void (FOTBuilder::*)(const StringC &), const StringC &); void extensionSet(void (FOTBuilder::*)(long), long); void extension(const ExtensionFlowObj &, const NodePtr &); void startExtension(const CompoundExtensionFlowObj &, const NodePtr &, Vector &ports); void endExtension(const CompoundExtensionFlowObj &); struct Call { Call() : next(0) {} virtual ~Call(); virtual Call* clone() const = 0; virtual void emit(FOTBuilder &) const = 0; Call *next; }; private: struct NoArgCall : Call { virtual Call* clone() const { return new NoArgCall(*this); } typedef void (FOTBuilder::*FuncPtr)(); NoArgCall(FuncPtr f) : func(f) { } void emit(FOTBuilder &) const; FuncPtr func; }; struct CharactersFromNodeCall : Call { CharactersFromNodeCall(const NodePtr &, const Char *, size_t); virtual Call* clone() const { return new CharactersFromNodeCall(*this); } void emit(FOTBuilder &) const; const Char *data; size_t size; NodePtr node; }; struct CharactersCall : Call { CharactersCall(const Char *, size_t); virtual Call* clone() const { return new CharactersCall(*this); } void emit(FOTBuilder &) const; StringC str; }; struct StartNodeCall : Call { StartNodeCall(const NodePtr &, const StringC &); virtual Call* clone() const { return new StartNodeCall(*this); } void emit(FOTBuilder &) const; NodePtr node; StringC mode; }; struct ExtensionCall : Call { ExtensionCall(const ExtensionFlowObj &fo, const NodePtr &nd) : arg(fo.copy()), node(nd) { } ExtensionCall(const ExtensionCall& other); virtual Call* clone() const { return new ExtensionCall(*this); } void emit(FOTBuilder &) const; Owner arg; NodePtr node; }; struct EndExtensionCall : Call { EndExtensionCall(const CompoundExtensionFlowObj &fo) : arg(fo.copy()->asCompoundExtensionFlowObj()) { } EndExtensionCall(const EndExtensionCall& other); virtual Call* clone() const { return new EndExtensionCall(*this); } void emit(FOTBuilder &) const; Owner arg; }; Call *calls_; Call **tail_; }; class STYLE_API NodeSaveFOTBuilder : public SaveFOTBuilder { public: NodeSaveFOTBuilder(const NodePtr &, const StringC &processingMode); virtual void emit(FOTBuilder&) const; private: NodePtr currentNode_; StringC processingMode_; }; class SaveFOTBuilder::Emitter { public: class Mark; Emitter(SaveFOTBuilder& source, FOTBuilder& sink); Emitter(Emitter& source, Mark from, Mark to, FOTBuilder& sink); void emit(); Mark mark() const; private: SaveFOTBuilder& source_; FOTBuilder& sink_; Call* from_; Call* to_; Call* where_; }; class SaveFOTBuilder::Emitter::Mark { public: private: typedef SaveFOTBuilder::Call Call; Mark(Call* where) : where_(where) {} Call* where_; friend class SaveFOTBuilder::Emitter; }; // Would like to make this a member of SaveFOTBuilder, but can't because // they would be member templates which are poorly supported under most // compilers. template class OneArgCall : public SaveFOTBuilder::Call { public: typedef void (FOTBuilder::*FuncPtr)(Arg1); OneArgCall(FuncPtr f, Arg1 arg1) : func_(f), arg1_(arg1) {} virtual SaveFOTBuilder::Call* clone() const { return new OneArgCall(*this); } virtual void emit(FOTBuilder& fotb) const { (fotb.*func_)(arg1_); } private: FuncPtr func_; Arg1 arg1_; }; template class OneRefArgCall : public SaveFOTBuilder::Call { public: typedef void (FOTBuilder::*FuncPtr)(const Arg1&); OneRefArgCall(FuncPtr f, const Arg1& arg1) : func_(f), arg1_(arg1) {} virtual SaveFOTBuilder::Call* clone() const { return new OneRefArgCall(*this); } virtual void emit(FOTBuilder& fotb) const { (fotb.*func_)(arg1_); } private: FuncPtr func_; Arg1 arg1_; }; // Would like to make this a member of SaveFOTBuilder, but can't because // it has members that are instances of SaveFOTBuilder. struct StartSimplePageSequenceCall : SaveFOTBuilder::Call { StartSimplePageSequenceCall(FOTBuilder* headerFooter[FOTBuilder::nHF]); virtual SaveFOTBuilder::Call* clone() const { return new StartSimplePageSequenceCall(*this); } void emit(FOTBuilder&) const; SaveFOTBuilder headerFooter[FOTBuilder::nHF]; }; struct StartFractionCall : SaveFOTBuilder::Call { StartFractionCall(FOTBuilder *&numerator, FOTBuilder *&denominator); virtual SaveFOTBuilder::Call* clone() const { return new StartFractionCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder numerator; SaveFOTBuilder denominator; }; struct StartScriptCall : SaveFOTBuilder::Call { StartScriptCall(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub); virtual SaveFOTBuilder::Call* clone() const { return new StartScriptCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder preSup; SaveFOTBuilder preSub; SaveFOTBuilder postSup; SaveFOTBuilder postSub; SaveFOTBuilder midSup; SaveFOTBuilder midSub; }; struct StartMarkCall : public SaveFOTBuilder::Call { StartMarkCall(FOTBuilder *&overMark, FOTBuilder *&underMark); virtual SaveFOTBuilder::Call* clone() const { return new StartMarkCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder overMark; SaveFOTBuilder underMark; }; struct StartFenceCall : public SaveFOTBuilder::Call { StartFenceCall(FOTBuilder *&open, FOTBuilder *&close); virtual SaveFOTBuilder::Call* clone() const { return new StartFenceCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder open; SaveFOTBuilder close; }; struct StartRadicalCall : public SaveFOTBuilder::Call { StartRadicalCall(FOTBuilder *°ree); virtual SaveFOTBuilder::Call* clone() const { return new StartRadicalCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder degree; }; struct StartMathOperatorCall : public SaveFOTBuilder::Call { StartMathOperatorCall(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit); virtual SaveFOTBuilder::Call* clone() const { return new StartMathOperatorCall(*this); } void emit(FOTBuilder &) const; SaveFOTBuilder oper; SaveFOTBuilder lowerLimit; SaveFOTBuilder upperLimit; }; struct StartTablePartCall : SaveFOTBuilder::Call { StartTablePartCall(const FOTBuilder::TablePartNIC &nic, FOTBuilder *&header, FOTBuilder *&footer); virtual SaveFOTBuilder::Call* clone() const { return new StartTablePartCall(*this); } void emit(FOTBuilder &) const; FOTBuilder::TablePartNIC arg; SaveFOTBuilder header; SaveFOTBuilder footer; }; struct StartMultiModeCall : SaveFOTBuilder::Call { StartMultiModeCall(const FOTBuilder::MultiMode *principalMode, const Vector &namedModes, Vector &ports); StartMultiModeCall(const StartMultiModeCall& other); virtual SaveFOTBuilder::Call* clone() const { return new StartMultiModeCall(*this); } void emit(FOTBuilder &) const; FOTBuilder::MultiMode principalMode; bool hasPrincipalMode; Vector namedModes; IList ports; }; struct StartExtensionCall : SaveFOTBuilder::Call { StartExtensionCall(const FOTBuilder::CompoundExtensionFlowObj &, const NodePtr &, Vector &); StartExtensionCall(const StartExtensionCall& other); virtual SaveFOTBuilder::Call* clone() const { return new StartExtensionCall(*this); } void emit(FOTBuilder &) const; IList ports; NodePtr node; Owner flowObj; }; // This uses SaveFOTBuilder to provide a serial view of multi-port objects. class STYLE_API SerialFOTBuilder : public FOTBuilder { public: SerialFOTBuilder(); // Instead of overriding these void startSimplePageSequence(FOTBuilder* headerFooter[nHF]); void endSimplePageSequenceHeaderFooter(); void endSimplePageSequence(); void startTablePart(const TablePartNIC &, FOTBuilder *&header, FOTBuilder *&footer); void endTablePart(); void startFraction(FOTBuilder *&numerator, FOTBuilder *&denominator); void endFraction(); void startScript(FOTBuilder *&preSup, FOTBuilder *&preSub, FOTBuilder *&postSup, FOTBuilder *&postSub, FOTBuilder *&midSup, FOTBuilder *&midSub); void endScript(); void startMark(FOTBuilder *&overMark, FOTBuilder *&underMark); void endMark(); void startFence(FOTBuilder *&open, FOTBuilder *&close); void endFence(); void startRadical(FOTBuilder *°ree); void endRadical(); void startMathOperator(FOTBuilder *&oper, FOTBuilder *&lowerLimit, FOTBuilder *&upperLimit); void endMathOperator(); void startMultiMode(const MultiMode *, const Vector &, Vector &); void endMultiMode(); void startExtension(const CompoundExtensionFlowObj &, const NodePtr &, Vector &ports); void endExtension(const CompoundExtensionFlowObj &); // Override these virtual void startSimplePageSequenceSerial(); virtual void endSimplePageSequenceSerial(); virtual void startSimplePageSequenceHeaderFooter(unsigned); virtual void endSimplePageSequenceHeaderFooter(unsigned); virtual void endAllSimplePageSequenceHeaderFooter(); virtual void startFractionSerial(); virtual void endFractionSerial(); virtual void startFractionNumerator(); virtual void endFractionNumerator(); virtual void startFractionDenominator(); virtual void endFractionDenominator(); virtual void startScriptSerial(); virtual void endScriptSerial(); virtual void startScriptPreSup(); virtual void endScriptPreSup(); virtual void startScriptPreSub(); virtual void endScriptPreSub(); virtual void startScriptPostSup(); virtual void endScriptPostSup(); virtual void startScriptPostSub(); virtual void endScriptPostSub(); virtual void startScriptMidSup(); virtual void endScriptMidSup(); virtual void startScriptMidSub(); virtual void endScriptMidSub(); virtual void startMarkSerial(); virtual void endMarkSerial(); virtual void startMarkOver(); virtual void endMarkOver(); virtual void startMarkUnder(); virtual void endMarkUnder(); virtual void startFenceSerial(); virtual void endFenceSerial(); virtual void startFenceOpen(); virtual void endFenceOpen(); virtual void startFenceClose(); virtual void endFenceClose(); virtual void startRadicalSerial(); virtual void endRadicalSerial(); virtual void startRadicalDegree(); virtual void endRadicalDegree(); virtual void startMathOperatorSerial(); virtual void endMathOperatorSerial(); virtual void startMathOperatorOperator(); virtual void endMathOperatorOperator(); virtual void startMathOperatorLowerLimit(); virtual void endMathOperatorLowerLimit(); virtual void startMathOperatorUpperLimit(); virtual void endMathOperatorUpperLimit(); virtual void startTablePartSerial(const TablePartNIC &); virtual void endTablePartSerial(); virtual void startTablePartHeader(); virtual void endTablePartHeader(); virtual void startTablePartFooter(); virtual void endTablePartFooter(); virtual void startMultiModeSerial(const MultiMode *); virtual void endMultiModeSerial(); virtual void startMultiModeMode(const MultiMode &); virtual void endMultiModeMode(); virtual void startExtensionSerial(const CompoundExtensionFlowObj &, const NodePtr &); virtual void endExtensionSerial(const CompoundExtensionFlowObj &); virtual void startExtensionStream(const StringC &); virtual void endExtensionStream(const StringC &); private: IList save_; Vector > multiModeStack_; }; inline bool operator==(const FOTBuilder::GlyphId &g1, const FOTBuilder::GlyphId &g2) { return g1.publicId == g2.publicId && g1.suffix == g2.suffix; } bool STYLE_API operator==(const StringC &, const char *); #ifdef DSSSL_NAMESPACE } #endif #endif /* not FOTBuilder_INCLUDED */ OpenJade-1.4devel/style/FlowObj.cxx0000644000021000000240000032124007037165457012771 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "ProcessContext.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "ELObjMessageArg.h" #include "SosofoObj.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class InlineValidator : public ProcessContext::Validator { public: bool isValid(const FlowObj &fo, ProcessContext &); bool charsValie(size_t, const Location &, ProcessContext &) { return true; } }; bool InlineValidator::isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if ((af & (FlowObj::afAlways | FlowObj::afInline)) != 0) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notInlineFlowObj); return false; } class DisplayValidator : public ProcessContext::Validator { public: bool isValid(const FlowObj &fo, ProcessContext &); bool charsValid(size_t, const Location &, ProcessContext &); }; bool DisplayValidator::isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if ((af & (FlowObj::afAlways | FlowObj::afDisplay)) != 0) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notDisplayFlowObj); return false; } bool DisplayValidator::charsValid(size_t, const Location &loc, ProcessContext &context) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::notDisplayFlowObj); return false; } class InlineOrDisplayValidator : public ProcessContext::Validator { public: bool isValid(const FlowObj &fo, ProcessContext &); bool charsValie(size_t, const Location &, ProcessContext &) { return true; } }; bool InlineOrDisplayValidator::isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if ((af & (FlowObj::afAlways | FlowObj::afInline | FlowObj::afDisplay)) != 0) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notInlineOrDisplayFlowObj); return false; } FlowObj::FlowObj() : style_(0) { hasSubObjects_ = 1; } void FlowObj::process(ProcessContext &context) { context.startFlowObj(); unsigned flags = 0; pushStyle(context, flags); context.validate(*this); processInner(context); context.endValidate(); popStyle(context, flags); context.endFlowObj(); } void FlowObj::pushStyle(ProcessContext &context, unsigned &) { if (style_) context.currentStyleStack().push(style_, context.vm(), context.currentFOTBuilder()); else context.currentStyleStack().pushEmpty(); } void FlowObj::popStyle(ProcessContext &context, unsigned) { if (style_) context.currentStyleStack().pop(); else context.currentStyleStack().popEmpty(); } void FlowObj::traceSubObjects(Collector &c) const { c.trace(style_); } CompoundFlowObj *FlowObj::asCompoundFlowObj() { return 0; } bool FlowObj::hasNonInheritedC(const Identifier *) const { return 0; } bool FlowObj::hasPseudoNonInheritedC(const Identifier *) const { return 0; } void FlowObj::setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &) { CANNOT_HAPPEN(); } bool FlowObj::isDisplayNIC(const Identifier *ident) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyPositionPreference: case Identifier::keyIsKeepWithPrevious: case Identifier::keyIsKeepWithNext: case Identifier::keyKeep: case Identifier::keyBreakBefore: case Identifier::keyBreakAfter: case Identifier::keyIsMayViolateKeepBefore: case Identifier::keyIsMayViolateKeepAfter: case Identifier::keySpaceBefore: case Identifier::keySpaceAfter: return 1; default: break; } } return 0; } bool FlowObj::setDisplayNIC(FOTBuilder::DisplayNIC &nic, const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { static FOTBuilder::Symbol breakVals[] = { FOTBuilder::symbolFalse, FOTBuilder::symbolPage, FOTBuilder::symbolColumnSet, FOTBuilder::symbolColumn }; Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyPositionPreference: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolFalse, FOTBuilder::symbolTop, FOTBuilder::symbolBottom, }; interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic.positionPreference); } return 1; case Identifier::keyIsKeepWithPrevious: interp.convertBooleanC(obj, ident, loc, nic.keepWithPrevious); return 1; case Identifier::keyIsKeepWithNext: interp.convertBooleanC(obj, ident, loc, nic.keepWithNext); return 1; case Identifier::keyKeep: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolFalse, FOTBuilder::symbolTrue, FOTBuilder::symbolPage, FOTBuilder::symbolColumnSet, FOTBuilder::symbolColumn }; interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic.keep); } return 1; case Identifier::keyBreakBefore: interp.convertEnumC(breakVals, SIZEOF(breakVals), obj, ident, loc, nic.breakBefore); return 1; case Identifier::keyBreakAfter: interp.convertEnumC(breakVals, SIZEOF(breakVals), obj, ident, loc, nic.breakAfter); return 1; case Identifier::keyIsMayViolateKeepBefore: interp.convertBooleanC(obj, ident, loc, nic.mayViolateKeepBefore); return 1; case Identifier::keyIsMayViolateKeepAfter: interp.convertBooleanC(obj, ident, loc, nic.mayViolateKeepAfter); return 1; case Identifier::keySpaceBefore: case Identifier::keySpaceAfter: { FOTBuilder::DisplaySpace &ds = (key == Identifier::keySpaceBefore ? nic.spaceBefore : nic.spaceAfter); DisplaySpaceObj *dso = obj->asDisplaySpace(); if (dso) ds = dso->displaySpace(); else if (interp.convertLengthSpecC(obj, ident, loc, ds.nominal)) { ds.max = ds.nominal; ds.min = ds.nominal; } } return 1; default: break; } } return 0; } void CompoundFlowObj::processInner(ProcessContext &context) { if (content_) content_->process(context); else context.processChildren(context.vm().interp->initialProcessingMode(), location()); } void CompoundFlowObj::traceSubObjects(Collector &c) const { c.trace(content_); FlowObj::traceSubObjects(c); } CompoundFlowObj *CompoundFlowObj::asCompoundFlowObj() { return this; } class DisplayGroupFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } DisplayGroupFlowObj(); DisplayGroupFlowObj(const DisplayGroupFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afDisplay; } protected: Owner nic_; }; DisplayGroupFlowObj::DisplayGroupFlowObj() : nic_(new FOTBuilder::DisplayGroupNIC) { } DisplayGroupFlowObj::DisplayGroupFlowObj(const DisplayGroupFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::DisplayGroupNIC(*fo.nic_)) { } void DisplayGroupFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startDisplayGroup(*nic_); context.pushPrincipalPort(new DisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endDisplayGroup(); } bool DisplayGroupFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key) && key == Identifier::keyCoalesceId) return 1; return isDisplayNIC(ident); } void DisplayGroupFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (!setDisplayNIC(*nic_, ident, obj, loc, interp)) { const Char *s; size_t n; if (!obj->stringData(s, n)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); } nic_->hasCoalesceId = 1; nic_->coalesceId.assign(s, n); } } FlowObj *DisplayGroupFlowObj::copy(Collector &c) const { return new (c) DisplayGroupFlowObj(*this); } class ParagraphFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ParagraphFlowObj(); ParagraphFlowObj(const ParagraphFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afDisplay; } private: Owner nic_; class Validator_ : public ProcessContext::Validator { public: bool isValid(const FlowObj &, ProcessContext &context); bool charsValid(size_t, const Location &, ProcessContext &) { return true; } }; }; ParagraphFlowObj::ParagraphFlowObj() : nic_(new FOTBuilder::ParagraphNIC) { } ParagraphFlowObj::ParagraphFlowObj(const ParagraphFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::ParagraphNIC(*fo.nic_)) { } void ParagraphFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); context.startParagraph(); fotb.startParagraph(*nic_); context.pushPrincipalPort(new Validator_); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endParagraph(); context.endParagraph(); } void ParagraphFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { setDisplayNIC(*nic_, ident, obj, loc, interp); } bool ParagraphFlowObj::hasNonInheritedC(const Identifier *ident) const { return isDisplayNIC(ident); } FlowObj *ParagraphFlowObj::copy(Collector &c) const { return new (c) ParagraphFlowObj(*this); } bool ParagraphFlowObj::Validator_::isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if ((af & (FlowObj::afAlways | FlowObj::afInline | FlowObj::afDisplay | FlowObj::afParagraphBreak)) != 0) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notValidInParagraph); return false; } class ParagraphBreakFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ParagraphBreakFlowObj(); ParagraphBreakFlowObj(const ParagraphBreakFlowObj &); FlowObj *copy(Collector &) const; void processInner(ProcessContext &); void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afParagraphBreak; } private: Owner nic_; }; ParagraphBreakFlowObj::ParagraphBreakFlowObj() : nic_(new FOTBuilder::ParagraphNIC) { } ParagraphBreakFlowObj::ParagraphBreakFlowObj(const ParagraphBreakFlowObj &fo) : FlowObj(fo), nic_(new FOTBuilder::ParagraphNIC(*fo.nic_)) { } FlowObj *ParagraphBreakFlowObj::copy(Collector &c) const { return new (c) ParagraphBreakFlowObj(*this); } void ParagraphBreakFlowObj::processInner(ProcessContext &context) { context.currentFOTBuilder().paragraphBreak(*nic_); } void ParagraphBreakFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { setDisplayNIC(*nic_, ident, obj, loc, interp); } bool ParagraphBreakFlowObj::hasNonInheritedC(const Identifier *ident) const { return isDisplayNIC(ident); } class ExternalGraphicFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ExternalGraphicFlowObj(); ExternalGraphicFlowObj(const ExternalGraphicFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return nic_->isDisplay ? afDisplay : afInline; } private: Owner nic_; }; ExternalGraphicFlowObj::ExternalGraphicFlowObj() : nic_(new FOTBuilder::ExternalGraphicNIC) { } ExternalGraphicFlowObj::ExternalGraphicFlowObj(const ExternalGraphicFlowObj &fo) : FlowObj(fo), nic_(new FOTBuilder::ExternalGraphicNIC(*fo.nic_)) { } void ExternalGraphicFlowObj::processInner(ProcessContext &context) { context.currentFOTBuilder().externalGraphic(*nic_); } void ExternalGraphicFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (!setDisplayNIC(*nic_, ident, obj, loc, interp)) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsDisplay: interp.convertBooleanC(obj, ident, loc, nic_->isDisplay); return; case Identifier::keyScale: { double d; if (obj->realValue(d)) { nic_->scaleType = FOTBuilder::symbolFalse; nic_->scale[0] = nic_->scale[1] = d; } else if (obj->asSymbol()) { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolMax, FOTBuilder::symbolMaxUniform }; interp.convertEnumC(vals, 2, obj, ident, loc, nic_->scaleType); } else { PairObj *pair = obj->asPair(); if (pair && pair->car()->realValue(nic_->scale[0]) && (pair = pair->cdr()->asPair()) != 0 && pair->car()->realValue(nic_->scale[1]) && pair->cdr()->isNil()) { nic_->scaleType = FOTBuilder::symbolFalse; } else interp.invalidCharacteristicValue(ident, loc); } } return; case Identifier::keyMaxWidth: if (interp.convertLengthSpecC(obj, ident, loc, nic_->maxWidth)) nic_->hasMaxWidth = 1; return; case Identifier::keyMaxHeight: if (interp.convertLengthSpecC(obj, ident, loc, nic_->maxHeight)) nic_->hasMaxHeight = 1; return; case Identifier::keyEntitySystemId: interp.convertStringC(obj, ident, loc, nic_->entitySystemId); return; case Identifier::keyNotationSystemId: interp.convertStringC(obj, ident, loc, nic_->notationSystemId); return; case Identifier::keyPositionPointX: interp.convertLengthSpecC(obj, ident, loc, nic_->positionPointX); return; case Identifier::keyPositionPointY: interp.convertLengthSpecC(obj, ident, loc, nic_->positionPointY); return; case Identifier::keyEscapementDirection: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolTopToBottom, FOTBuilder::symbolLeftToRight, FOTBuilder::symbolBottomToTop, FOTBuilder::symbolRightToLeft }; interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic_->escapementDirection); } return; case Identifier::keyBreakBeforePriority: interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority); return; case Identifier::keyBreakAfterPriority: interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority); return; default: break; } } CANNOT_HAPPEN(); } } bool ExternalGraphicFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsDisplay: case Identifier::keyScale: case Identifier::keyMaxWidth: case Identifier::keyMaxHeight: case Identifier::keyEntitySystemId: case Identifier::keyNotationSystemId: case Identifier::keyPositionPointX: case Identifier::keyPositionPointY: case Identifier::keyEscapementDirection: case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } return isDisplayNIC(ident); } FlowObj *ExternalGraphicFlowObj::copy(Collector &c) const { return new (c) ExternalGraphicFlowObj(*this); } class RuleFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } RuleFlowObj(); RuleFlowObj(const RuleFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; bool ruleStyle(ProcessContext &, StyleObj *&style) { style = style_; return 1; } bool isRule() { return 1; } AcceptFlags acceptFlags(ProcessContext &) const; private: Owner nic_; }; RuleFlowObj::RuleFlowObj() : nic_(new FOTBuilder::RuleNIC) { } RuleFlowObj::RuleFlowObj(const RuleFlowObj &fo) : FlowObj(fo), nic_(new FOTBuilder::RuleNIC(*fo.nic_)) { } void RuleFlowObj::processInner(ProcessContext &context) { context.currentFOTBuilder().rule(*nic_); } void RuleFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (setDisplayNIC(*nic_, ident, obj, loc, interp)) return; Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyOrientation: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolHorizontal, FOTBuilder::symbolVertical, FOTBuilder::symbolEscapement, FOTBuilder::symbolLineProgression }; interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic_->orientation); } return; case Identifier::keyLength: if (interp.convertLengthSpecC(obj, ident, loc, nic_->length)) nic_->hasLength = 1; return; case Identifier::keyBreakBeforePriority: interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority); return; case Identifier::keyBreakAfterPriority: interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority); return; default: break; } } CANNOT_HAPPEN(); } bool RuleFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyOrientation: case Identifier::keyLength: case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } return isDisplayNIC(ident); } FlowObj *RuleFlowObj::copy(Collector &c) const { return new (c) RuleFlowObj(*this); } FlowObj::AcceptFlags RuleFlowObj::acceptFlags(ProcessContext &) const { switch(nic_->orientation) { case FOTBuilder::symbolHorizontal: case FOTBuilder::symbolVertical: return afDisplay; case FOTBuilder::symbolEscapement: case FOTBuilder::symbolLineProgression: return afInline; } CANNOT_HAPPEN(); } class AlignmentPointFlowObj : public FlowObj { public: AlignmentPointFlowObj() { } FlowObj *copy(Collector &) const; void processInner(ProcessContext &); AcceptFlags acceptFlags(ProcessContext &) const { return afInline | afMathSequence; } }; FlowObj *AlignmentPointFlowObj::copy(Collector &c) const { return new (c) AlignmentPointFlowObj(*this); } void AlignmentPointFlowObj::processInner(ProcessContext &context) { context.currentFOTBuilder().alignmentPoint(); } class SidelineFlowObj : public CompoundFlowObj { public: SidelineFlowObj() { } FlowObj *copy(Collector &) const; void processInner(ProcessContext &); AcceptFlags acceptFlags(ProcessContext &) const // FIXME. Correct? Standard isn't clear about this. { return afDisplay | afInline; } }; FlowObj *SidelineFlowObj::copy(Collector &c) const { return new (c) SidelineFlowObj(*this); } void SidelineFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSideline(); context.pushPrincipalPort(new InlineOrDisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSideline(); } void SequenceFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSequence(); // We *don't* push the principal port, so that the validator of the parent's // port will be used. CompoundFlowObj::processInner(context); fotb.endSequence(); } FlowObj *SequenceFlowObj::copy(Collector &c) const { return new (c) SequenceFlowObj(*this); } class LineFieldFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LineFieldFlowObj() : nic_(new FOTBuilder::LineFieldNIC) { } LineFieldFlowObj(const LineFieldFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::LineFieldNIC(*fo.nic_)) { } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; bool hasNonInheritedC(const Identifier *ident) const; void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp); AcceptFlags acceptFlags(ProcessContext &) const { return afInline; } private: Owner nic_; }; FlowObj *LineFieldFlowObj::copy(Collector &c) const { return new (c) LineFieldFlowObj(*this); } void LineFieldFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startLineField(*nic_); context.pushPrincipalPort(new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endLineField(); } void LineFieldFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyBreakBeforePriority: interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority); return; case Identifier::keyBreakAfterPriority: interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority); return; default: break; } } CANNOT_HAPPEN(); } bool LineFieldFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } return 0; } class SimplePageSequenceFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } struct HeaderFooter { enum { nParts = 6 }; HeaderFooter(); SosofoObj *part[nParts]; }; SimplePageSequenceFlowObj(); SimplePageSequenceFlowObj(const SimplePageSequenceFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); void traceSubObjects(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const { return afPaging; } private: enum { nPageTypeBits = 2 }; Owner hf_; }; SimplePageSequenceFlowObj::SimplePageSequenceFlowObj() : hf_(new HeaderFooter) { hasSubObjects_ = 1; } SimplePageSequenceFlowObj::SimplePageSequenceFlowObj(const SimplePageSequenceFlowObj &fo) : CompoundFlowObj(fo), hf_(new HeaderFooter(*fo.hf_)) { } void SimplePageSequenceFlowObj::traceSubObjects(Collector &c) const { for (int i = 0; i < HeaderFooter::nParts; i++) c.trace(hf_->part[i]); CompoundFlowObj::traceSubObjects(c); } void SimplePageSequenceFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); FOTBuilder* hf_fotb[FOTBuilder::nHF]; fotb.startSimplePageSequence(hf_fotb); for (int i = 0; i < (1 << nPageTypeBits); i++) { context.setPageType(i); for (int j = 0; j < HeaderFooter::nParts; j++) { if (hf_->part[j]) { // FIXME. Invalid FOs result in FOUR error messages. context.pushPseudoPort(hf_fotb[i | (j << nPageTypeBits)], new InlineValidator); hf_->part[j]->process(context); context.popPseudoPort(); } } } fotb.endSimplePageSequenceHeaderFooter(); context.pushPrincipalPort(new DisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSimplePageSequence(); } void SimplePageSequenceFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { SosofoObj *sosofo = obj->asSosofo(); if (!sosofo) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyLeftHeader: hf_->part[(FOTBuilder::leftHF | FOTBuilder::headerHF) >> nPageTypeBits] = sosofo; return; case Identifier::keyCenterHeader: hf_->part[(FOTBuilder::centerHF | FOTBuilder::headerHF) >> nPageTypeBits] = sosofo; return; case Identifier::keyRightHeader: hf_->part[(FOTBuilder::rightHF | FOTBuilder::headerHF) >> nPageTypeBits] = sosofo; return; case Identifier::keyLeftFooter: hf_->part[(FOTBuilder::leftHF | FOTBuilder::footerHF) >> nPageTypeBits] = sosofo; return; case Identifier::keyCenterFooter: hf_->part[(FOTBuilder::centerHF | FOTBuilder::footerHF) >> nPageTypeBits] = sosofo; return; case Identifier::keyRightFooter: hf_->part[(FOTBuilder::rightHF | FOTBuilder::footerHF) >> nPageTypeBits] = sosofo; return; default: break; } } CANNOT_HAPPEN(); } bool SimplePageSequenceFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyLeftHeader: case Identifier::keyCenterHeader: case Identifier::keyRightHeader: case Identifier::keyLeftFooter: case Identifier::keyCenterFooter: case Identifier::keyRightFooter: return 1; default: break; } } return 0; } FlowObj *SimplePageSequenceFlowObj::copy(Collector &c) const { return new (c) SimplePageSequenceFlowObj(*this); } SimplePageSequenceFlowObj::HeaderFooter::HeaderFooter() { for (int i = 0; i < nParts; i++) part[i] = 0; } class LinkFlowObj : public CompoundFlowObj { public: LinkFlowObj(); FlowObj *copy(Collector &) const; void processInner(ProcessContext &); void traceSubObjects(Collector &) const; bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); AcceptFlags acceptFlags(ProcessContext &) const // FIXME. Should we treat this as a sequence? { return afAlways; } private: AddressObj *addressObj_; }; LinkFlowObj::LinkFlowObj() : addressObj_(0) { } void LinkFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); if (!addressObj_) { FOTBuilder::Address addr; addr.type = FOTBuilder::Address::none; fotb.startLink(addr); } else fotb.startLink(addressObj_->address()); // We treat a link as a sequence, i.d. flow parent validates its children CompoundFlowObj::processInner(context); fotb.endLink(); } FlowObj *LinkFlowObj::copy(Collector &c) const { return new (c) LinkFlowObj(*this); } void LinkFlowObj::traceSubObjects(Collector &c) const { CompoundFlowObj::traceSubObjects(c); c.trace(addressObj_); } bool LinkFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; return ident->syntacticKey(key) && key == Identifier::keyDestination; } void LinkFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { AddressObj *address = obj->asAddress(); if (!address) { if (obj != interp.makeFalse()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); } else address = interp.makeAddressNone(); } addressObj_ = address; } class ScrollFlowObj : public CompoundFlowObj { public: ScrollFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const { return afScroll; } }; void ScrollFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startScroll(); context.pushPrincipalPort(new DisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endScroll(); } FlowObj *ScrollFlowObj::copy(Collector &c) const { return new (c) ScrollFlowObj(*this); } class MarginaliaFlowObj : public CompoundFlowObj { public: MarginaliaFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const // Para ancestor checked in processInner. { return afAlways; } }; void MarginaliaFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); bool bad(!context.paragraphAncestor()); if (bad) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(location()); interp.message(InterpreterMessages::noParagraphAncestor); FOTBuilder ignore; context.pushPseudoPort(&fotb, new ProcessContext::Validator); } fotb.startMarginalia(); context.pushPrincipalPort(new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endMarginalia(); if (bad) context.popPseudoPort(); } FlowObj *MarginaliaFlowObj::copy(Collector &c) const { return new (c) MarginaliaFlowObj(*this); } class MultiModeFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } MultiModeFlowObj(); MultiModeFlowObj(const MultiModeFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); struct NIC { NIC() : hasPrincipalMode(0) { } bool hasPrincipalMode; FOTBuilder::MultiMode principalMode; Vector namedModes; }; AcceptFlags acceptFlags(ProcessContext &) const // FIXME. { return afAlways; } private: bool handleMultiModesMember(const Identifier *, ELObj *obj, const Location &, Interpreter &); Owner nic_; }; MultiModeFlowObj::MultiModeFlowObj() : nic_(new NIC) { } MultiModeFlowObj::MultiModeFlowObj(const MultiModeFlowObj &fo) : CompoundFlowObj(fo), nic_(new NIC(*fo.nic_)) { } void MultiModeFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(nic_->namedModes.size()); fotb.startMultiMode(nic_->hasPrincipalMode ? &nic_->principalMode : 0, nic_->namedModes, fotbs); Vector portSyms(nic_->namedModes.size()); Vector validators(nic_->namedModes.size()); for (size_t i = 0; i < portSyms.size(); i++) { portSyms[i] = context.vm().interp->makeSymbol(nic_->namedModes[i].name); validators[i] = new ProcessContext::Validator; } context.pushPorts(nic_->hasPrincipalMode, portSyms, fotbs, validators, nic_->hasPrincipalMode ? new ProcessContext::Validator : 0); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endMultiMode(); } FlowObj *MultiModeFlowObj::copy(Collector &c) const { return new (c) MultiModeFlowObj(*this); } bool MultiModeFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; return ident->syntacticKey(key) && key == Identifier::keyMultiModes; } void MultiModeFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair || !handleMultiModesMember(ident, pair->car(), loc, interp)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } obj = pair->cdr(); } } bool MultiModeFlowObj::handleMultiModesMember(const Identifier *, ELObj *obj, const Location &loc, Interpreter &interp) { if (obj == interp.makeFalse()) { nic_->hasPrincipalMode = 1; return 1; } SymbolObj *sym = obj->asSymbol(); if (sym) { nic_->namedModes.resize(nic_->namedModes.size() + 1); nic_->namedModes.back().name = *sym->name(); return 1; } PairObj *pair = obj->asPair(); if (!pair) return 0; ELObj *spec = pair->car(); pair = pair->cdr()->asPair(); if (!pair || !pair->cdr()->isNil()) return 0; const Char *s; size_t n; if (!pair->car()->stringData(s, n)) return 0; if (spec == interp.makeFalse()) { nic_->hasPrincipalMode = 1; nic_->principalMode.hasDesc = 1; nic_->principalMode.desc.assign(s, n); return 1; } sym = spec->asSymbol(); if (!sym) return 0; nic_->namedModes.resize(nic_->namedModes.size() + 1); nic_->namedModes.back().name = *sym->name(); nic_->namedModes.back().desc.assign(s, n); nic_->namedModes.back().hasDesc = 1; return 1; } class ScoreFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ScoreFlowObj(); FlowObj *copy(Collector &) const; void processInner(ProcessContext &); bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); AcceptFlags acceptFlags(ProcessContext &) const { return afInline; } class Type { public: virtual ~Type(); virtual void start(FOTBuilder &) = 0; virtual Type *copy() const = 0; }; private: class SymbolType : public Type { public: SymbolType(FOTBuilder::Symbol type) : type_(type) { } void start(FOTBuilder &); Type *copy() const; private: FOTBuilder::Symbol type_; }; class LengthSpecType : public Type { public: LengthSpecType(long n) : len_(n) { } void start(FOTBuilder &); Type *copy() const; private: FOTBuilder::LengthSpec len_; }; class CharType : public Type { public: CharType(Char c) : c_(c) { } void start(FOTBuilder &); Type *copy() const; private: Char c_; }; CopyOwner type_; }; ScoreFlowObj::ScoreFlowObj() { } FlowObj *ScoreFlowObj::copy(Collector &c) const { return new (c) ScoreFlowObj(*this); } void ScoreFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); if (type_) type_->start(fotb); else fotb.startSequence(); context.pushPrincipalPort(new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); if (type_) fotb.endScore(); else fotb.endSequence(); } bool ScoreFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; return ident->syntacticKey(key) && key == Identifier::keyType; } void ScoreFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Char c; if (obj->charValue(c)) { type_ = new CharType(c); return; } double d; long n; int dim; switch (obj->quantityValue(n, d, dim)) { case longQuantity: if (dim == 1) { type_ = new LengthSpecType(n); return; } break; case doubleQuantity: if (dim == 1) { type_ = new LengthSpecType(long(d)); return; } break; default: break; } static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolBefore, FOTBuilder::symbolThrough, FOTBuilder::symbolAfter }; FOTBuilder::Symbol sym; if (interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, sym)) type_ = new SymbolType(sym); } ScoreFlowObj::Type::~Type() { } void ScoreFlowObj::SymbolType::start(FOTBuilder &fotb) { fotb.startScore(type_); } void ScoreFlowObj::CharType::start(FOTBuilder &fotb) { fotb.startScore(c_); } void ScoreFlowObj::LengthSpecType::start(FOTBuilder &fotb) { fotb.startScore(len_); } ScoreFlowObj::Type *ScoreFlowObj::SymbolType::copy() const { return new SymbolType(*this); } ScoreFlowObj::Type *ScoreFlowObj::LengthSpecType::copy() const { return new LengthSpecType(*this); } ScoreFlowObj::Type *ScoreFlowObj::CharType::copy() const { return new CharType(*this); } class BoxFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } BoxFlowObj(); BoxFlowObj(const BoxFlowObj &); FlowObj *copy(Collector &) const; void processInner(ProcessContext &); bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); AcceptFlags acceptFlags(ProcessContext &) const { return nic_->isDisplay ? afDisplay : afInline; } private: Owner nic_; }; BoxFlowObj::BoxFlowObj() : nic_(new FOTBuilder::BoxNIC) { } BoxFlowObj::BoxFlowObj(const BoxFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::BoxNIC(*fo.nic_)) { } void BoxFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startBox(*nic_); context.pushPrincipalPort(nic_->isDisplay ? new DisplayValidator : new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endBox(); } void BoxFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (setDisplayNIC(*nic_, ident, obj, loc, interp)) return; Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsDisplay: interp.convertBooleanC(obj, ident, loc, nic_->isDisplay); return; case Identifier::keyBreakBeforePriority: interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority); return; case Identifier::keyBreakAfterPriority: interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority); return; default: break; } } CANNOT_HAPPEN(); } bool BoxFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsDisplay: case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } return isDisplayNIC(ident); } FlowObj *BoxFlowObj::copy(Collector &c) const { return new (c) BoxFlowObj(*this); } class SideBySideFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } SideBySideFlowObj(); SideBySideFlowObj(const SideBySideFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afDisplay; } protected: Owner nic_; private: class Validator_ : public ProcessContext::Validator { public: bool isValid(const FlowObj &, ProcessContext &); bool charsValid(size_t, const Location &, ProcessContext &); }; }; SideBySideFlowObj::SideBySideFlowObj() : nic_(new FOTBuilder::DisplayNIC) { } SideBySideFlowObj::SideBySideFlowObj(const SideBySideFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::DisplayNIC(*fo.nic_)) { } void SideBySideFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSideBySide(*nic_); context.pushPrincipalPort(new Validator_); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSideBySide(); } bool SideBySideFlowObj::hasNonInheritedC(const Identifier *ident) const { return isDisplayNIC(ident); } void SideBySideFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (!setDisplayNIC(*nic_, ident, obj, loc, interp)) CANNOT_HAPPEN(); } FlowObj *SideBySideFlowObj::copy(Collector &c) const { return new (c) SideBySideFlowObj(*this); } bool SideBySideFlowObj::Validator_::isValid(const FlowObj &fo, ProcessContext &context) { if (fo.acceptFlags(context) & afSideBySideItem) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notSideBySideItem); return false; } bool SideBySideFlowObj::Validator_::charsValid(size_t, const Location &loc, ProcessContext &context) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::notSideBySideItem); return false; } class SideBySideItemFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const { return afSideBySideItem; } }; void SideBySideItemFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSideBySideItem(); context.pushPrincipalPort(new DisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSideBySideItem(); } FlowObj *SideBySideItemFlowObj::copy(Collector &c) const { return new (c) SideBySideItemFlowObj(*this); } class LeaderFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LeaderFlowObj(); LeaderFlowObj(const LeaderFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afInline; } private: Owner nic_; }; LeaderFlowObj::LeaderFlowObj() : nic_(new FOTBuilder::LeaderNIC) { } LeaderFlowObj::LeaderFlowObj(const LeaderFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::LeaderNIC(*fo.nic_)) { } void LeaderFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startLeader(*nic_); context.pushPrincipalPort(new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endLeader(); } void LeaderFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyLength: if (interp.convertLengthSpecC(obj, ident, loc, nic_->length)) nic_->hasLength = 1; return; case Identifier::keyBreakBeforePriority: interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority); return; case Identifier::keyBreakAfterPriority: interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority); return; default: break; } } CANNOT_HAPPEN(); } bool LeaderFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyLength: case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } return 0; } FlowObj *LeaderFlowObj::copy(Collector &c) const { return new (c) LeaderFlowObj(*this); } class CharacterFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } CharacterFlowObj(); CharacterFlowObj(const CharacterFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); void setImplicitChar(Char); bool hasNonInheritedC(const Identifier *) const; bool characterStyle(ProcessContext &context, StyleObj *&style, FOTBuilder::CharacterNIC &nic) { fixNICs_(context); style = style_; nic = *nic_; return 1; } bool isCharacter() { return 1; } AcceptFlags acceptFlags(ProcessContext &) const { return afInline | afChar | afMathSequence; } private: Owner nic_; bool needFixNICs_; void fixNICs_(ProcessContext &context) { if (needFixNICs_) { // FIXME. Location. fixCharNICs(&nic_->ch, 1, nic_.pointer(), Location(), context); needFixNICs_ = false; } } }; CharacterFlowObj::CharacterFlowObj() : nic_(new FOTBuilder::CharacterNIC), needFixNICs_(false) { } CharacterFlowObj::CharacterFlowObj(const CharacterFlowObj &fo) : FlowObj(fo), nic_(new FOTBuilder::CharacterNIC(*fo.nic_)), needFixNICs_(fo.needFixNICs_) { } void CharacterFlowObj::processInner(ProcessContext &context) { fixNICs_(context); context.currentFOTBuilder().character(*nic_); } void FlowObj::setImplicitChar(Char) { CANNOT_HAPPEN(); } void CharacterFlowObj::setImplicitChar(Char ch) { if (!(nic_->specifiedC & (1 << FOTBuilder::CharacterNIC::cChar))) { nic_->ch = ch; nic_->specifiedC |= FOTBuilder::CharacterNIC::cChar; needFixNICs_ = true; } } void FlowObj::fixCharNICs(const Char *ch, size_t n, FOTBuilder::CharacterNIC *nic, const Location &loc, ProcessContext &context) { ASSERT(ch); ASSERT(nic); Interpreter &interp = *context.vm().interp; Vector dep; FunctionObj *func = context.currentStyleStack(). actual(interp.charMapC(), interp, dep)->asFunction(); if (func && (func->nRequiredArgs() > 1 || (func->nRequiredArgs() + func->nOptionalArgs() + func->restArg() ? 1 : 0) == 0)) func = 0; InsnPtr insn(func != 0 ? func->makeCallInsn(1, interp, loc, InsnPtr()) : InsnPtr()); VM vm(interp); ELObjDynamicRoot protect(interp); for (; n > 0; ++ch, ++nic, --n) { if (!insn.isNull()) { protect = interp.makeChar(*ch); ELObj *res = vm.eval(insn.pointer(), 0, protect); if (!res->charValue(nic->ch)) { if (!interp.isError(res)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::notACharInCharMap, ELObjMessageArg(protect, interp), ELObjMessageArg(res, interp)); } nic->ch = *ch; } } else nic->ch = *ch; if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsSpace))) nic->isSpace = interp.isSpace().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsRecordEnd))) nic->isRecordEnd = interp.isRecordEnd().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsInputTab))) nic->isInputTab = interp.isInputTab().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsInputWhitespace))) nic->isInputWhitespace = interp.isInputWhitespace().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsPunct))) nic->isPunct = interp.isPunct().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsDropAfterLineBreak))) nic->isDropAfterLineBreak = interp.isDropAfterLineBreak().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cIsDropUnlessBeforeLineBreak))) nic->isDropUnlessBeforeLineBreak = interp.isDropUnlessBeforeLineBreak().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cBreakBeforePriority))) nic->breakBeforePriority = interp.breakBeforePriority().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cBreakAfterPriority))) nic->breakAfterPriority = interp.breakAfterPriority().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cScript))) nic->script = interp.script().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cGlyphId))) nic->glyphId = interp.glyphId().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cMathFontPosture))) nic->mathFontPosture = interp.mathFontPosture().getValue(nic->ch); if (!(nic->specifiedC & (1 << FOTBuilder::CharacterNIC::cMathClass))) nic->mathClass = interp.mathClass().getValue(nic->ch); nic->specifiedC |= ((1 << FOTBuilder::CharacterNIC::cChar) | (1 << FOTBuilder::CharacterNIC::cIsSpace) | (1 << FOTBuilder::CharacterNIC::cIsRecordEnd) | (1 << FOTBuilder::CharacterNIC::cIsInputTab) | (1 << FOTBuilder::CharacterNIC::cIsInputWhitespace) | (1 << FOTBuilder::CharacterNIC::cIsPunct) | (1 << FOTBuilder::CharacterNIC::cIsDropAfterLineBreak) | (1 << FOTBuilder::CharacterNIC::cIsDropUnlessBeforeLineBreak) | (1 << FOTBuilder::CharacterNIC::cBreakBeforePriority) | (1 << FOTBuilder::CharacterNIC::cBreakAfterPriority) | (1 << FOTBuilder::CharacterNIC::cScript) | (1 << FOTBuilder::CharacterNIC::cGlyphId) | (1 << FOTBuilder::CharacterNIC::cMathFontPosture) | (1 << FOTBuilder::CharacterNIC::cMathClass)); } #if 0 if (!(nic_->specifiedC & (1 << FOTBuilder::CharacterNIC::cGlyphId))) { ELObj *prop = interp.charProperty(interp.makeStringC("glyph-id"), nic_->ch, loc, 0); if (prop == interp.makeFalse()) nic_->glyphId = FOTBuilder::GlyphId(); else { const FOTBuilder::GlyphId *p = prop->glyphId(); if (p) nic_->glyphId = *p; } } if (!(nic_->specifiedC & (1 << FOTBuilder::CharacterNIC::cMathFontPosture))) { ELObj *prop = interp.charProperty(interp.makeStringC("math-font-posture"), nic_->ch, loc, 0); static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolFalse, FOTBuilder::symbolNotApplicable, FOTBuilder::symbolUpright, FOTBuilder::symbolOblique, FOTBuilder::symbolBackSlantedOblique, FOTBuilder::symbolItalic, FOTBuilder::symbolBackSlantedItalic, }; interp.convertEnumC(vals, SIZEOF(vals), prop, ident, loc, nic_->mathFontPosture); } if (!(nic_->specifiedC & (1 << FOTBuilder::CharacterNIC::cMathClass))) { ELObj *prop = interp.charProperty(interp.makeStringC("math-class"), nic_->ch, loc, 0); static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolOrdinary, FOTBuilder::symbolOperator, FOTBuilder::symbolBinary, FOTBuilder::symbolRelation, FOTBuilder::symbolOpening, FOTBuilder::symbolClosing, FOTBuilder::symbolPunctuation, FOTBuilder::symbolInner, FOTBuilder::symbolSpace, }; interp.convertEnumC(vals, SIZEOF(vals), prop, ident, loc, nic_->mathClass); } #endif } void CharacterFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsSpace: if (interp.convertBooleanC(obj, ident, loc, nic_->isSpace)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsSpace); return; case Identifier::keyIsRecordEnd: if (interp.convertBooleanC(obj, ident, loc, nic_->isRecordEnd)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsRecordEnd); return; case Identifier::keyIsInputTab: if (interp.convertBooleanC(obj, ident, loc, nic_->isInputTab)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsInputTab); return; case Identifier::keyIsInputWhitespace: if (interp.convertBooleanC(obj, ident, loc, nic_->isInputWhitespace)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsInputWhitespace); return; case Identifier::keyIsPunct: if (interp.convertBooleanC(obj, ident, loc, nic_->isPunct)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsPunct); return; case Identifier::keyIsDropAfterLineBreak: if (interp.convertBooleanC(obj, ident, loc, nic_->isDropAfterLineBreak)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsDropAfterLineBreak); return; case Identifier::keyIsDropUnlessBeforeLineBreak: if (interp.convertBooleanC(obj, ident, loc, nic_->isDropUnlessBeforeLineBreak)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cIsDropUnlessBeforeLineBreak); return; case Identifier::keyBreakBeforePriority: if (interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cBreakBeforePriority); return; case Identifier::keyBreakAfterPriority: if (interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cBreakAfterPriority); return; case Identifier::keyScript: { if (obj == interp.makeFalse()) nic_->script = 0; else { StringC tem; if (!interp.convertStringC(obj, ident, loc, tem)) return; nic_->script = interp.storePublicId(tem.data(), tem.size(), loc); } nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cScript); } return; case Identifier::keyChar: if (interp.convertCharC(obj, ident, loc, nic_->ch)) { nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cChar); needFixNICs_ = true; } return; case Identifier::keyGlyphId: { if (obj == interp.makeFalse()) { nic_->glyphId = FOTBuilder::GlyphId(); nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cGlyphId); return; } const FOTBuilder::GlyphId *p = obj->glyphId(); if (!p) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } nic_->glyphId = *p; nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cGlyphId); } return; case Identifier::keyMathFontPosture: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolFalse, FOTBuilder::symbolNotApplicable, FOTBuilder::symbolUpright, FOTBuilder::symbolOblique, FOTBuilder::symbolBackSlantedOblique, FOTBuilder::symbolItalic, FOTBuilder::symbolBackSlantedItalic, }; if (interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic_->mathFontPosture)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cMathFontPosture); } return; case Identifier::keyMathClass: { static FOTBuilder::Symbol vals[] = { FOTBuilder::symbolOrdinary, FOTBuilder::symbolOperator, FOTBuilder::symbolBinary, FOTBuilder::symbolRelation, FOTBuilder::symbolOpening, FOTBuilder::symbolClosing, FOTBuilder::symbolPunctuation, FOTBuilder::symbolInner, FOTBuilder::symbolSpace, }; if (interp.convertEnumC(vals, SIZEOF(vals), obj, ident, loc, nic_->mathClass)) nic_->specifiedC |= (1 << FOTBuilder::CharacterNIC::cMathClass); } return; case Identifier::keyStretchFactor: interp.convertRealC(obj, ident, loc, nic_->stretchFactor); return; default: break; } } else { unsigned part; Location loc; if (ident->charNICDefined(part, loc)) return; } CANNOT_HAPPEN(); } bool CharacterFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyChar: case Identifier::keyGlyphId: case Identifier::keyIsSpace: case Identifier::keyIsRecordEnd: case Identifier::keyIsInputTab: case Identifier::keyIsInputWhitespace: case Identifier::keyIsPunct: case Identifier::keyIsDropAfterLineBreak: case Identifier::keyIsDropUnlessBeforeLineBreak: case Identifier::keyScript: case Identifier::keyMathClass: case Identifier::keyMathFontPosture: case Identifier::keyStretchFactor: case Identifier::keyBreakBeforePriority: case Identifier::keyBreakAfterPriority: return 1; default: break; } } unsigned part; Location loc; if (ident->charNICDefined(part, loc)) return 1; return 0; } FlowObj *CharacterFlowObj::copy(Collector &c) const { return new (c) CharacterFlowObj(*this); } class MathSequenceValidator : public ProcessContext::Validator { public: bool isValid(const FlowObj &, ProcessContext &); bool charsValid(size_t, const Location &loc, ProcessContext &context) { return true; } }; bool MathSequenceValidator::isValid(const FlowObj &fo, ProcessContext &context) { if (fo.acceptFlags(context) & FlowObj::afMathSequence) return true; Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notMathSequence); return false; } class MathSequenceFlowObj : public CompoundFlowObj { public: MathSequenceFlowObj() { } void processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startMathSequence(); context.pushPrincipalPort(new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endMathSequence(); } FlowObj *copy(Collector &c) const { return new (c) MathSequenceFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { // FIXME. Should the value depend on math-display-mode:? return afDisplay | afInline | afMathSequence; } }; class FractionFlowObj : public CompoundFlowObj { public: FractionFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; void FractionFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(2); fotb.startFraction(fotbs[0], fotbs[1]); Vector dep; StyleObj *fractionBarStyle = 0; SosofoObj *sosofo = context.currentStyleStack().actual(context.vm().interp->fractionBarC(), *context.vm().interp, dep)->asSosofo(); if (sosofo) sosofo->ruleStyle(context, fractionBarStyle); if (fractionBarStyle) context.currentStyleStack().push(fractionBarStyle, context.vm(), fotb); fotb.fractionBar(); if (fractionBarStyle) context.currentStyleStack().pop(); Vector labels(2); labels[0] = context.vm().interp->portName(Interpreter::portNumerator); labels[1] = context.vm().interp->portName(Interpreter::portDenominator); Vector validators(2); validators[0] = new MathSequenceValidator; validators[1] = new MathSequenceValidator; context.pushPorts(0, labels, fotbs, validators); // Fraction flow object doesn't have principal port, // so clear the current connection. CompoundFlowObj::processInner(context); context.popPorts(); fotb.endFraction(); } FlowObj *FractionFlowObj::copy(Collector &c) const { return new (c) FractionFlowObj(*this); } class UnmathFlowObj : public CompoundFlowObj { public: UnmathFlowObj() { } void processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startUnmath(); context.pushPrincipalPort(new InlineValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endUnmath(); } FlowObj *copy(Collector &c) const { return new (c) UnmathFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; class SuperscriptFlowObj : public CompoundFlowObj { public: SuperscriptFlowObj() { } void processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSuperscript(); context.pushPrincipalPort(new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSuperscript(); } FlowObj *copy(Collector &c) const { return new (c) SuperscriptFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; class SubscriptFlowObj : public CompoundFlowObj { public: SubscriptFlowObj() { } void processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSubscript(); context.pushPrincipalPort(new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endSubscript(); } FlowObj *copy(Collector &c) const { return new (c) SubscriptFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; class ScriptFlowObj : public CompoundFlowObj { public: ScriptFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) ScriptFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; void ScriptFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(6); fotb.startScript(fotbs[0], fotbs[1], fotbs[2], fotbs[3], fotbs[4], fotbs[5]); Vector labels(6); labels[0] = context.vm().interp->portName(Interpreter::portPreSup); labels[1] = context.vm().interp->portName(Interpreter::portPreSub); labels[2] = context.vm().interp->portName(Interpreter::portPostSup); labels[3] = context.vm().interp->portName(Interpreter::portPostSub); labels[4] = context.vm().interp->portName(Interpreter::portMidSup); labels[5] = context.vm().interp->portName(Interpreter::portMidSub); Vector validators(6); for (size_t i = 0; i < 6; ++i) validators[6] = new MathSequenceValidator; context.pushPorts(true, labels, fotbs, validators, new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endScript(); } class MarkFlowObj : public CompoundFlowObj { public: MarkFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) MarkFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; void MarkFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(2); fotb.startMark(fotbs[0], fotbs[1]); Vector labels(2); labels[0] = context.vm().interp->portName(Interpreter::portOverMark); labels[1] = context.vm().interp->portName(Interpreter::portUnderMark); Vector validators(2); validators[0] = new MathSequenceValidator; validators[1] = new MathSequenceValidator; context.pushPorts(true, labels, fotbs, validators, new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endMark(); } class FenceFlowObj : public CompoundFlowObj { public: FenceFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) FenceFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } private: class Validator_ : public ProcessContext::Validator { public: Validator_() : hadChar_(false), hadError_(false) { } bool isValid(const FlowObj &, ProcessContext &); bool charsValid(size_t, const Location &, ProcessContext &); private: bool hadChar_; bool hadError_; }; }; void FenceFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(2); fotb.startFence(fotbs[0], fotbs[1]); Vector labels(2); labels[0] = context.vm().interp->portName(Interpreter::portOpen); labels[1] = context.vm().interp->portName(Interpreter::portClose); Vector validators(2); validators[0] = new Validator_; validators[1] = new Validator_; context.pushPorts(true, labels, fotbs, validators, new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endFence(); } bool FenceFlowObj::Validator_::isValid(const FlowObj &fo, ProcessContext &context) { if (!hadChar_ && (fo.acceptFlags(context) & FlowObj::afChar) != 0) { hadChar_ = true; return true; } if (!hadError_) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::notSingleChar); hadError_ = true; } return false; } bool FenceFlowObj::Validator_::charsValid(size_t n, const Location &loc, ProcessContext &context) { if (n < 1) return true; if (n == 1) { hadChar_ = true; return true; } if (!hadError_) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::notSingleChar); hadError_ = true; } if (!hadChar_) { hadChar_ = true; n = 1; return true; } return false; } class RadicalFlowObj : public CompoundFlowObj { public: RadicalFlowObj() : radical_(0) { } void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) RadicalFlowObj(*this); } void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; void traceSubObjects(Collector &c) const { c.trace(radical_); CompoundFlowObj::traceSubObjects(c); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } private: SosofoObj *radical_; }; void RadicalFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(1); fotb.startRadical(fotbs[0]); StyleObj *style; FOTBuilder::CharacterNIC nic; if (radical_ && radical_->characterStyle(context, style, nic)) { if (style) context.currentStyleStack().push(style, context.vm(), fotb); fotb.radicalRadical(nic); if (style) context.currentStyleStack().pop(); } else fotb.radicalRadicalDefaulted(); Vector labels(1); labels[0] = context.vm().interp->portName(Interpreter::portDegree); Vector validators(1); validators[0] = new MathSequenceValidator; context.pushPorts(true, labels, fotbs, validators, new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endRadical(); } bool RadicalFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; return ident->syntacticKey(key) && key == Identifier::keyRadical; } void RadicalFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { radical_ = obj->asSosofo(); if (!radical_ || !radical_->isCharacter()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); } } class MathOperatorFlowObj : public CompoundFlowObj { public: MathOperatorFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) MathOperatorFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afMathSequence; } }; void MathOperatorFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(3); fotb.startMathOperator(fotbs[0], fotbs[1], fotbs[2]); Vector labels(3); labels[0] = context.vm().interp->portName(Interpreter::portOperator); labels[1] = context.vm().interp->portName(Interpreter::portLowerLimit); labels[2] = context.vm().interp->portName(Interpreter::portUpperLimit); Vector validators(3); for (size_t i = 0; i < 3; ++i) validators[i] = new MathSequenceValidator; context.pushPorts(true, labels, fotbs, validators, new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPorts(); fotb.endMathOperator(); } class GridFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } GridFlowObj(); GridFlowObj(const GridFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) GridFlowObj(*this); } void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const // FIXME. Accepted anywhere else? { return afMathSequence; } private: Owner nic_; class Validator_ : public ProcessContext::Validator { public: bool isValid(const FlowObj &fo, ProcessContext &context) { AcceptFlags af(fo.acceptFlags(context)); if (af & (afAlways | afGridCell)) return true; return charsValid(1, fo.location(), context); } bool charsValid(size_t, const Location &loc, ProcessContext &context) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::notGridCell); return false; } }; }; GridFlowObj::GridFlowObj() : nic_(new FOTBuilder::GridNIC) { } GridFlowObj::GridFlowObj(const GridFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::GridNIC(*fo.nic_)) { } void GridFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startGrid(*nic_); context.pushPrincipalPort(new Validator_); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endGrid(); } void GridFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { long tem; if (!interp.convertIntegerC(obj, ident, loc, tem)) return; if (tem <= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyGridNColumns: nic_->nColumns = tem; return; case Identifier::keyGridNRows: nic_->nRows = tem; return; default: break; } } CANNOT_HAPPEN(); } bool GridFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyGridNColumns: case Identifier::keyGridNRows: return 1; default: break; } } return 0; } class GridCellFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } GridCellFlowObj(); GridCellFlowObj(const GridCellFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &c) const { return new (c) GridCellFlowObj(*this); } void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); bool hasNonInheritedC(const Identifier *) const; AcceptFlags acceptFlags(ProcessContext &) const { return afGridCell; } private: Owner nic_; }; GridCellFlowObj::GridCellFlowObj() : nic_(new FOTBuilder::GridCellNIC) { } GridCellFlowObj::GridCellFlowObj(const GridCellFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::GridCellNIC(*fo.nic_)) { } void GridCellFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startGridCell(*nic_); context.pushPrincipalPort(new MathSequenceValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endGridCell(); } void GridCellFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { long tem; if (!interp.convertIntegerC(obj, ident, loc, tem)) return; if (tem <= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyColumnNumber: nic_->columnNumber = tem; return; case Identifier::keyRowNumber: nic_->rowNumber = tem; return; default: break; } } CANNOT_HAPPEN(); } bool GridCellFlowObj::hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyColumnNumber: case Identifier::keyRowNumber: return 1; default: break; } } return 0; } class TableValidator : public ProcessContext::Validator { public: TableValidator(): s_(sNone) { } virtual void badFO(const Location &loc, ProcessContext &context) const { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::badTableContent); } bool isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if (af & FlowObj::afAlways) return true; switch (s_) { case sNone: if (af & FlowObj::afTablePart) { s_ = sPart; return true; } if (af & FlowObj::afTableColumn) { s_ = sColumn; return true; } if (af & (FlowObj::afTableRow | FlowObj::afTableCell)) { s_ = sContent; return true; } break; case sBadPart: if (!(af & FlowObj::afTablePart)) return false; // Fall through. case sPart: if (af & FlowObj::afTablePart) return true; s_ = sBadPart; break; case sBadColumn: if (!(af & FlowObj::afTableColumn)) return false; // Fall through. case sColumn: if (af & FlowObj::afTableColumn) return true; s_ = sBadColumn; break; case sBadContent: if (!(af & (FlowObj::afTableCell | FlowObj::afTableRow))) return false; // Fall through. case sContent: if (af & (FlowObj::afTableRow | FlowObj::afTableCell)) return true; s_ =sBadContent; break; default: CANNOT_HAPPEN(); } badFO(fo.location(), context); return false; } bool charsValid(size_t, const Location &loc, ProcessContext &context) { badFO(loc, context); return false; } protected: enum State { sNone, sPart, sBadPart, sColumn, sBadColumn, sContent, sBadContent } s_; TableValidator(State s) : s_(s) { } }; class TableFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } struct NIC : public FOTBuilder::TableNIC { NIC() : beforeRowBorder(0), afterRowBorder(0), beforeColumnBorder(0), afterColumnBorder(0) { } StyleObj *beforeRowBorder; StyleObj *afterRowBorder; StyleObj *beforeColumnBorder; StyleObj *afterColumnBorder; }; TableFlowObj() : nic_(new NIC) { } TableFlowObj(const TableFlowObj &fo) : CompoundFlowObj(fo), nic_(new NIC(*fo.nic_)) { } void processInner(ProcessContext &context) { context.startTable(); FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startTable(*nic_); Interpreter &interp = *context.vm().interp; Vector dep; ELObj *obj = context.currentStyleStack().actual(interp.tableBorderC(), interp, dep); StyleObj *borderStyle; if (obj == interp.makeFalse()) borderStyle = interp.borderFalseStyle(); else if (obj == interp.makeTrue()) borderStyle = interp.borderTrueStyle(); else { SosofoObj *sosofo = obj->asSosofo(); if (!sosofo || !sosofo->tableBorderStyle(borderStyle)) borderStyle = 0; } border(nic_->beforeRowBorder, borderStyle, &FOTBuilder::tableBeforeRowBorder, context); border(nic_->afterRowBorder, borderStyle, &FOTBuilder::tableAfterRowBorder, context); border(nic_->beforeColumnBorder, borderStyle, &FOTBuilder::tableBeforeColumnBorder, context); border(nic_->afterColumnBorder, borderStyle, &FOTBuilder::tableAfterColumnBorder, context); context.pushPrincipalPort(new TableValidator); CompoundFlowObj::processInner(context); if (context.inTableRow()) context.endTableRow(); context.popPrincipalPort(); context.endTable(); fotb.endTable(); } FlowObj *copy(Collector &c) const { return new (c) TableFlowObj(*this); } bool hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyBeforeRowBorder: case Identifier::keyAfterRowBorder: case Identifier::keyBeforeColumnBorder: case Identifier::keyAfterColumnBorder: case Identifier::keyTableWidth: return 1; default: break; } } return isDisplayNIC(ident); } void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { if (setDisplayNIC(*nic_, ident, obj, loc, interp)) return; Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) CANNOT_HAPPEN(); if (key == Identifier::keyTableWidth) { if (obj == interp.makeFalse()) nic_->widthType = FOTBuilder::TableNIC::widthMinimum; else if (interp.convertLengthSpecC(obj, ident, loc, nic_->width)) nic_->widthType = FOTBuilder::TableNIC::widthExplicit; return; } StyleObj *style; SosofoObj *sosofo = obj->asSosofo(); if (!sosofo || !sosofo->tableBorderStyle(style)) { Boolean b; if (!interp.convertBooleanC(obj, ident, loc, b)) return; style = b ? interp.borderTrueStyle() : interp.borderFalseStyle(); } switch (key) { case Identifier::keyBeforeRowBorder: nic_->beforeRowBorder = style; break; case Identifier::keyAfterRowBorder: nic_->afterRowBorder = style; break; case Identifier::keyBeforeColumnBorder: nic_->beforeColumnBorder = style; break; case Identifier::keyAfterColumnBorder: nic_->afterColumnBorder = style; break; default: CANNOT_HAPPEN(); } } AcceptFlags acceptFlags(ProcessContext &) const { return afDisplay; } private: void border(StyleObj *style, StyleObj *style2, void (FOTBuilder::*setter)(), ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); if (!style) style = style2; if (style) context.currentStyleStack().push(style, context.vm(), fotb); (fotb.*setter)(); if (style) context.currentStyleStack().pop(); } Owner nic_; }; class TablePartFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } TablePartFlowObj() : nic_(new FOTBuilder::TablePartNIC) { } TablePartFlowObj(const TablePartFlowObj &fo) : CompoundFlowObj(fo), nic_(new FOTBuilder::TablePartNIC(*fo.nic_)) { } void processInner(ProcessContext &context) { context.startTablePart(); FOTBuilder &fotb = context.currentFOTBuilder(); Vector fotbs(2); fotb.startTablePart(*nic_, fotbs[0], fotbs[1]); Vector labels(2); labels[0] = context.vm().interp->portName(Interpreter::portHeader); labels[1] = context.vm().interp->portName(Interpreter::portFooter); Vector validators(2); validators[0] = new HFValidator_; validators[1] = new HFValidator_; context.pushPorts(true, labels, fotbs, validators, new BodyValidator_); CompoundFlowObj::processInner(context); context.popPorts(); if (context.inTableRow()) context.endTableRow(); context.endTablePart(); fotb.endTablePart(); } FlowObj *copy(Collector &c) const { return new (c) TablePartFlowObj(*this); } void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { setDisplayNIC(*nic_, ident, obj, loc, interp); } bool hasNonInheritedC(const Identifier *ident) const { if (!isDisplayNIC(ident)) return 0; Identifier::SyntacticKey key; ident->syntacticKey(key); if (key == Identifier::keyPositionPreference) return 0; return 1; } AcceptFlags acceptFlags(ProcessContext &) const { return afTablePart; } private: Owner nic_; class HFValidator_ : public TableValidator { public: HFValidator_() : TableValidator(sContent) { } void badFO(const Location &loc, ProcessContext &context) const { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::badTablePartHF); } }; class BodyValidator_ : public TableValidator { public: BodyValidator_() : TableValidator(sColumn) { } void badFO(const Location &loc, ProcessContext &context) const { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::badTablePartBody); } }; }; class TableColumnFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } struct NIC : public FOTBuilder::TableColumnNIC { NIC() : hasColumnNumber(0) { } bool hasColumnNumber; }; TableColumnFlowObj() : nic_(new NIC) { } TableColumnFlowObj(const TableColumnFlowObj &fo) : FlowObj(fo), nic_(new NIC(*fo.nic_)) { } void processInner(ProcessContext &context) { if (nic_->hasColumnNumber) { context.currentFOTBuilder().tableColumn(*nic_); context.addTableColumn(nic_->columnIndex, nic_->nColumnsSpanned, style_); } else { FOTBuilder::TableColumnNIC nic(*nic_); nic.columnIndex = context.currentTableColumn(); context.currentFOTBuilder().tableColumn(nic); context.addTableColumn(nic.columnIndex, nic_->nColumnsSpanned, style_); } } FlowObj *copy(Collector &c) const { return new (c) TableColumnFlowObj(*this); } bool hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyColumnNumber: case Identifier::keyNColumnsSpanned: case Identifier::keyWidth: return 1; default: break; } } return 0; } void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyColumnNumber: case Identifier::keyNColumnsSpanned: { long n; if (!interp.convertIntegerC(obj, ident, loc, n)) return; if (n <= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } if (key == Identifier::keyColumnNumber) { nic_->columnIndex = n - 1; nic_->hasColumnNumber = 1; } else nic_->nColumnsSpanned = n; } return; case Identifier::keyWidth: { const LengthSpec *ls = obj->lengthSpec(); if (ls) { // width is a TableLengthSpec not just a LengthSpec if (ls->convert(nic_->width)) nic_->hasWidth = 1; else interp.invalidCharacteristicValue(ident, loc); } else if (interp.convertLengthSpecC(obj, ident, loc, nic_->width)) nic_->hasWidth = 1; } return; default: break; } } CANNOT_HAPPEN(); } AcceptFlags acceptFlags(ProcessContext &) const { return afTableColumn; } private: Owner nic_; }; class TableRowFlowObj : public CompoundFlowObj { public: TableRowFlowObj() { } void pushStyle(ProcessContext &, unsigned &) { } void popStyle(ProcessContext &, unsigned) { } void processInner(ProcessContext &context) { if (!context.inTable()) { // FIXME location context.vm().interp->message(InterpreterMessages::tableRowOutsideTable); CompoundFlowObj::processInner(context); return; // FIXME: Remove when validation is working. } if (context.inTableRow()) context.endTableRow(); context.startTableRow(style_); context.pushPrincipalPort(new Validator_); CompoundFlowObj::processInner(context); context.popPrincipalPort(); if (context.inTableRow()) context.endTableRow(); // else FIXME give an error // must have used ends-row? in a table-row } FlowObj *copy(Collector &c) const { return new (c) TableRowFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afTableRow; } private: class Validator_ : public ProcessContext::Validator { public: bool isValid(const FlowObj &fo, ProcessContext &context) { AcceptFlags af(fo.acceptFlags(context)); if (af & afTableCell) return true; } bool charsValid(size_t, const Location &loc, ProcessContext &context) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::badTableRow); return false; } }; }; class TableCellFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } struct NIC : FOTBuilder::TableCellNIC { NIC() : startsRow(0), endsRow(0), hasColumnNumber(0) { } bool hasColumnNumber; bool startsRow; bool endsRow; }; TableCellFlowObj(bool missing = 0) : nic_(new NIC) { if (missing) nic_->missing = 1; } TableCellFlowObj(const TableCellFlowObj &fo) : CompoundFlowObj(fo), nic_(new NIC(*fo.nic_)) { } void pushStyle(ProcessContext &context, unsigned &nPush) { if (context.inTableRow()) { if (nic_->startsRow) { context.endTableRow(); context.startTableRow(0); } } else context.startTableRow(0); unsigned columnNumber = nic_->hasColumnNumber ? nic_->columnIndex : context.currentTableColumn(); StyleObj *columnStyle = context.tableColumnStyle(columnNumber, nic_->nColumnsSpanned); if (columnStyle) { context.currentStyleStack().push(columnStyle, context.vm(), context.currentFOTBuilder()); context.currentFOTBuilder().startSequence(); nPush++; } StyleObj *rowStyle = context.tableRowStyle(); if (rowStyle) { context.currentStyleStack().push(rowStyle, context.vm(), context.currentFOTBuilder()); context.currentFOTBuilder().startSequence(); nPush++; } CompoundFlowObj::pushStyle(context, nPush); } void popStyle(ProcessContext &context, unsigned nPush) { CompoundFlowObj::popStyle(context, nPush); for (unsigned i = 0; i < nPush; i++) { context.currentFOTBuilder().endSequence(); context.currentStyleStack().pop(); } if (nic_->endsRow) context.endTableRow(); } void processInner(ProcessContext &context) { if (!context.inTable()) { // FIXME location context.vm().interp->message(InterpreterMessages::tableCellOutsideTable); CompoundFlowObj::processInner(context); // FIXME. Remove this when validation is ok. return; } FOTBuilder &fotb = context.currentFOTBuilder(); if (!nic_->hasColumnNumber) { FOTBuilder::TableCellNIC nic(*nic_); nic.columnIndex = context.currentTableColumn(); fotb.startTableCell(nic); if (!nic_->missing) context.noteTableCell(nic.columnIndex, nic.nColumnsSpanned, nic.nRowsSpanned); } else { fotb.startTableCell(*nic_); if (!nic_->missing) context.noteTableCell(nic_->columnIndex, nic_->nColumnsSpanned, nic_->nRowsSpanned); } Interpreter &interp = *context.vm().interp; border(interp.cellBeforeRowBorderC(), &FOTBuilder::tableCellBeforeRowBorder, context); border(interp.cellAfterRowBorderC(), &FOTBuilder::tableCellAfterRowBorder, context); border(interp.cellBeforeColumnBorderC(), &FOTBuilder::tableCellBeforeColumnBorder, context); border(interp.cellAfterColumnBorderC(), &FOTBuilder::tableCellAfterColumnBorder, context); context.pushPrincipalPort(new DisplayValidator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); fotb.endTableCell(); } FlowObj *copy(Collector &c) const { return new (c) TableCellFlowObj(*this); } bool hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyNRowsSpanned: return 1; default: break; } } return 0; } bool hasPseudoNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyColumnNumber: case Identifier::keyNColumnsSpanned: case Identifier::keyIsStartsRow: case Identifier::keyIsEndsRow: return 1; default: break; } } return 0; } void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { Identifier::SyntacticKey key; if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyIsStartsRow: interp.convertBooleanC(obj, ident, loc, nic_->startsRow); return; case Identifier::keyIsEndsRow: interp.convertBooleanC(obj, ident, loc, nic_->endsRow); return; case Identifier::keyColumnNumber: case Identifier::keyNColumnsSpanned: case Identifier::keyNRowsSpanned: { long n; if (!interp.convertIntegerC(obj, ident, loc, n)) return; if (n <= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); return; } if (key == Identifier::keyColumnNumber) { nic_->columnIndex = n - 1; nic_->hasColumnNumber = 1; } else if (key == Identifier::keyNColumnsSpanned) nic_->nColumnsSpanned = n; else nic_->nRowsSpanned = n; } return; default: break; } } CANNOT_HAPPEN(); } AcceptFlags acceptFlags(ProcessContext &) const { return afTableCell; } private: void border(const ConstPtr &ic, void (FOTBuilder::*setter)(), ProcessContext &context) { Interpreter &interp = *context.vm().interp; Vector dep; ELObj *obj = context.currentStyleStack().actual(ic, interp, dep); StyleObj *style; if (obj == interp.makeFalse()) style = interp.borderFalseStyle(); else if (obj == interp.makeTrue()) style = interp.borderTrueStyle(); else { SosofoObj *sosofo = obj->asSosofo(); if (!sosofo || !sosofo->tableBorderStyle(style)) style = 0; } FOTBuilder &fotb = context.currentFOTBuilder(); if (style) context.currentStyleStack().push(style, context.vm(), fotb); (fotb.*setter)(); if (style) context.currentStyleStack().pop(); } Owner nic_; }; class TableBorderFlowObj : public FlowObj { public: TableBorderFlowObj() { } void process(ProcessContext &) { } void processInner(ProcessContext &) { } bool tableBorderStyle(StyleObj *&style) { style = style_; return 1; } FlowObj *copy(Collector &c) const { return new (c) TableBorderFlowObj(*this); } AcceptFlags acceptFlags(ProcessContext &) const { return afNever; } }; void ProcessContext::startTable() { tableStack_.insert(new Table); } void ProcessContext::endTable() { coverSpannedRows(); delete tableStack_.get(); } void ProcessContext::coverSpannedRows() { // Generate empty cells to cover any remaining vertical spans Table *table = tableStack_.head(); if (!table) return; unsigned n = 0; for (size_t i = 0; i < table->covered.size(); i++) if (table->covered[i] > n) n = table->covered[i]; for (; n > 0; n--) { SosofoObj *content = new (*vm().interp) EmptySosofoObj; ELObjDynamicRoot protect(*vm().interp, content); TableRowFlowObj *row = new (*vm().interp) TableRowFlowObj; row->setContent(content); protect = row; row->process(*this); } } void ProcessContext::startTablePart() { Table *table = tableStack_.head(); if (table) { table->currentColumn = 0; table->rowStyle = 0; table->columnStyles.clear(); table->covered.clear(); table->nColumns = 0; } } void ProcessContext::endTablePart() { coverSpannedRows(); } void ProcessContext::addTableColumn(unsigned columnIndex, unsigned span, StyleObj *style) { Table *table = tableStack_.head(); if (table) { table->currentColumn = columnIndex + span; if (columnIndex >= table->columnStyles.size()) table->columnStyles.resize(columnIndex + 1); Vector &tem = table->columnStyles[columnIndex]; if (span > 0) { while (tem.size() < span) tem.push_back((StyleObj *)0); tem[span - 1] = style; } } } unsigned ProcessContext::currentTableColumn() { Table *table = tableStack_.head(); if (table) return table->currentColumn; return 0; } void ProcessContext::noteTableCell(unsigned colIndex, unsigned colSpan, unsigned rowSpan) { Table *table = tableStack_.head(); if (!table) return; table->currentColumn = colIndex + colSpan; Vector &covered = table->covered; for (size_t i = covered.size(); i < colIndex + colSpan; i++) covered.push_back(0); for (size_t i = 0; i < colSpan; i++) covered[colIndex + i] = rowSpan; if (colIndex + colSpan > table->nColumns) table->nColumns = colIndex + colSpan; } StyleObj *ProcessContext::tableColumnStyle(unsigned columnIndex, unsigned span) { Table *table = tableStack_.head(); if (table) { if (columnIndex < table->columnStyles.size()) { Vector &tem = table->columnStyles[columnIndex]; if (span > 0 && span <= tem.size()) return tem[span - 1]; } } return 0; } StyleObj *ProcessContext::tableRowStyle() { Table *table = tableStack_.head(); if (table) return table->rowStyle; return 0; } void ProcessContext::startTableRow(StyleObj *style) { Table *table = tableStack_.head(); if (table) { table->rowStyle = style; table->currentColumn = 0; table->inTableRow = 1; table->rowConnectableLevel = connectionStack_.head()->connectableLevel; } currentFOTBuilder().startTableRow(); } void ProcessContext::endTableRow() { Table *table = tableStack_.head(); if (table) { // Fill in blank cells Vector &covered = table->covered; for (size_t i = 0; i < table->nColumns + 1; i++) { if (i >= covered.size() || !covered[i]) { table->currentColumn = i; SosofoObj *content = new (*vm().interp) EmptySosofoObj; ELObjDynamicRoot protect(*vm().interp, content); // The last cell is a dummy one TableCellFlowObj *cell = new (*vm().interp) TableCellFlowObj(i >= table->nColumns); cell->setContent(content); protect = cell; cell->process(*this); } // cell->process() will cover it if (i < table->nColumns) covered[i] -= 1; } table->inTableRow = 0; } currentFOTBuilder().endTableRow(); } bool ProcessContext::inTableRow() { Table *table = tableStack_.head(); if (table) return table->inTableRow; return 0; } ProcessContext::Table::Table() : rowStyle(0), currentColumn(0), inTableRow(0), nColumns(0) { } // Flow object classes declared with declare-flow-object-class // that we don't know about are assumed to have one principal port // and accept any non-inherited characteristic. class UnknownFlowObj : public CompoundFlowObj { public: UnknownFlowObj() { } FlowObj *copy(Collector &c) const { return new (c) UnknownFlowObj(*this); } void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &) { } bool hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey syn; if (ident->syntacticKey(syn) && (syn == Identifier::keyLabel || syn == Identifier::keyContentMap)) return 0; if (!ident->inheritedC().isNull()) return 0; return 1; } AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } }; class FormattingInstructionFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } FormattingInstructionFlowObj() : datap_(new StringC()) { } FormattingInstructionFlowObj(const FormattingInstructionFlowObj &fo) : FlowObj(fo), datap_(new StringC(*fo.datap_)) { } void processInner(ProcessContext &context) { context.currentFOTBuilder().formattingInstruction(*datap_); } FlowObj *copy(Collector &c) const { return new (c) FormattingInstructionFlowObj(*this); } void setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { interp.convertStringC(obj, ident, loc, *datap_); } bool hasNonInheritedC(const Identifier *ident) const { Identifier::SyntacticKey key; return ident->syntacticKey(key) && key == Identifier::keyData; } AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } private: Owner datap_; }; class ELObjExtensionFlowObjValue : public FOTBuilder::ExtensionFlowObj::Value { public: ELObjExtensionFlowObjValue(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) : ident_(ident), obj_(obj), loc_(&loc), interp_(&interp) { } bool convertString(StringC &result) const { return interp_->convertStringC(obj_, ident_, *loc_, result); } bool convertStringPairList(Vector &v) const { ELObj *obj = obj_; for (;;) { if (obj->isNil()) return 1; PairObj *pair = obj->asPair(); if (!pair) break; obj = pair->cdr(); PairObj *att = pair->car()->asPair(); if (!att) break; const Char *s; size_t n; if (!att->car()->stringData(s, n)) break; v.resize(v.size() + 1); v.back().assign(s, n); att = att->cdr()->asPair(); if (!att || !att->car()->stringData(s, n) || !att->cdr()->isNil()) { v.resize(v.size() - 1); break; } v.resize(v.size() + 1); v.back().assign(s, n); } interp_->setNextLocation(*loc_); interp_->message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident_->name())); return 0; } bool convertStringList(Vector &v) const { ELObj *obj = obj_; for (;;) { if (obj->isNil()) return 1; PairObj *pair = obj->asPair(); if (!pair) break; const Char *s; size_t n; if (!pair->car()->stringData(s, n)) break; v.resize(v.size() + 1); v.back().assign(s, n); obj = pair->cdr(); } interp_->setNextLocation(*loc_); interp_->message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident_->name())); return 0; } bool convertBoolean(bool &result) const { return interp_->convertBooleanC(obj_, ident_, *loc_, result); } private: ELObj *obj_; const Identifier *ident_; const Location *loc_; Interpreter *interp_; }; class ExtensionFlowObj : public FlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ExtensionFlowObj(const FOTBuilder::ExtensionFlowObj &); ExtensionFlowObj(const ExtensionFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } private: Owner fo_; }; ExtensionFlowObj::ExtensionFlowObj(const FOTBuilder::ExtensionFlowObj &fo) : fo_(fo.copy()) { } ExtensionFlowObj::ExtensionFlowObj(const ExtensionFlowObj &fo) : FlowObj(fo), fo_(fo.fo_->copy()) { } void ExtensionFlowObj::processInner(ProcessContext &context) { context.currentFOTBuilder().extension(*fo_, context.vm().currentNode); } void ExtensionFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { fo_->setNIC(ident->name(), ELObjExtensionFlowObjValue(ident, obj, loc, interp)); } bool ExtensionFlowObj::hasNonInheritedC(const Identifier *ident) const { return fo_->hasNIC(ident->name()); } FlowObj *ExtensionFlowObj::copy(Collector &c) const { return new (c) ExtensionFlowObj(*this); } class CompoundExtensionFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } CompoundExtensionFlowObj(const FOTBuilder::CompoundExtensionFlowObj &); CompoundExtensionFlowObj(const CompoundExtensionFlowObj &); void processInner(ProcessContext &); FlowObj *copy(Collector &) const; bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } private: Owner fo_; }; CompoundExtensionFlowObj::CompoundExtensionFlowObj(const FOTBuilder::CompoundExtensionFlowObj &fo) : fo_(fo.copy()->asCompoundExtensionFlowObj()) { } CompoundExtensionFlowObj::CompoundExtensionFlowObj(const CompoundExtensionFlowObj &fo) : CompoundFlowObj(fo), fo_(fo.fo_->copy()->asCompoundExtensionFlowObj()) { } void CompoundExtensionFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); Vector portNames; fo_->portNames(portNames); Vector fotbs(portNames.size()); fotb.startExtension(*fo_, context.vm().currentNode, fotbs); if (portNames.size()) { Vector portSyms(portNames.size()); Vector validators(portNames.size()); for (size_t i = 0; i < portSyms.size(); i++) { portSyms[i] = context.vm().interp->makeSymbol(portNames[i]); // FIXME. A way for extensions to specify accepted contents. validators[i] = new ProcessContext::Validator; } context.pushPorts(fo_->hasPrincipalPort(), portSyms, fotbs, validators, fo_->hasPrincipalPort() ? new ProcessContext::Validator : 0); CompoundFlowObj::processInner(context); context.popPorts(); } else { context.pushPrincipalPort(new ProcessContext::Validator); CompoundFlowObj::processInner(context); context.popPrincipalPort(); } fotb.endExtension(*fo_); } void CompoundExtensionFlowObj::setNonInheritedC(const Identifier *ident, ELObj *obj, const Location &loc, Interpreter &interp) { fo_->setNIC(ident->name(), ELObjExtensionFlowObjValue(ident, obj, loc, interp)); } bool CompoundExtensionFlowObj::hasNonInheritedC(const Identifier *ident) const { return fo_->hasNIC(ident->name()); } FlowObj *CompoundExtensionFlowObj::copy(Collector &c) const { return new (c) CompoundExtensionFlowObj(*this); } #define FLOW_OBJ(name, string, feature) \ { FlowObj *tem = new (*this) name; \ /* Temporary debugging check.*/ \ ASSERT(sizeof(name) <= 32); \ makePermanent(tem); \ Identifier *ident = lookup(makeStringC(string)); \ ident->setFlowObj(tem); \ ident->setFeature(feature); \ } void Interpreter::installFlowObjs() { FLOW_OBJ(SequenceFlowObj, "sequence", noFeature); FLOW_OBJ(DisplayGroupFlowObj, "display-group", noFeature); FLOW_OBJ(ParagraphFlowObj, "paragraph", noFeature); FLOW_OBJ(ParagraphBreakFlowObj, "paragraph-break", noFeature); FLOW_OBJ(LineFieldFlowObj, "line-field", noFeature); FLOW_OBJ(ScoreFlowObj, "score", noFeature); FLOW_OBJ(ExternalGraphicFlowObj, "external-graphic", noFeature); FLOW_OBJ(RuleFlowObj, "rule", noFeature); FLOW_OBJ(LeaderFlowObj, "leader", noFeature); FLOW_OBJ(CharacterFlowObj, "character", noFeature); FLOW_OBJ(BoxFlowObj, "box", noFeature); FLOW_OBJ(SideBySideFlowObj, "side-by-side", sideBySide); FLOW_OBJ(SideBySideItemFlowObj, "side-by-side-item", sideBySide); FLOW_OBJ(AlignmentPointFlowObj, "alignment-point", noFeature); FLOW_OBJ(SidelineFlowObj, "sideline", sideline); // simple-page FLOW_OBJ(SimplePageSequenceFlowObj, "simple-page-sequence", simplePage); // tables FLOW_OBJ(TableFlowObj, "table", table); FLOW_OBJ(TablePartFlowObj, "table-part", table); FLOW_OBJ(TableColumnFlowObj, "table-column", table); FLOW_OBJ(TableRowFlowObj, "table-row", table); FLOW_OBJ(TableCellFlowObj, "table-cell", table); FLOW_OBJ(TableBorderFlowObj, "table-border", table); // online FLOW_OBJ(LinkFlowObj, "link", online); FLOW_OBJ(ScrollFlowObj, "scroll", online); FLOW_OBJ(MarginaliaFlowObj, "marginalia", online); FLOW_OBJ(MultiModeFlowObj, "multi-mode", online); // math FLOW_OBJ(MathSequenceFlowObj, "math-sequence", math); FLOW_OBJ(FractionFlowObj, "fraction", math); FLOW_OBJ(UnmathFlowObj, "unmath", math); FLOW_OBJ(SuperscriptFlowObj, "superscript", math); FLOW_OBJ(SubscriptFlowObj, "subscript", math); FLOW_OBJ(ScriptFlowObj, "script", math); FLOW_OBJ(MarkFlowObj, "mark", math); FLOW_OBJ(FenceFlowObj, "fence", math); FLOW_OBJ(RadicalFlowObj, "radical", math); FLOW_OBJ(MathOperatorFlowObj, "math-operator", math); FLOW_OBJ(GridFlowObj, "grid", math); FLOW_OBJ(GridCellFlowObj, "grid-cell", math); } void Interpreter::installExtensionFlowObjectClass(Identifier *ident, const StringC &pubid, const Location &loc) { FlowObj *tem = 0; if (fotbDescr_.extensions) { for (const FOTBuilder::Extension *ep = fotbDescr_.extensions; ep->pubid; ep++) { if (pubid == ep->pubid) { if (ep->flowObj) { const FOTBuilder::CompoundExtensionFlowObj *cFlowObj = ep->flowObj->asCompoundExtensionFlowObj(); if (cFlowObj) tem = new (*this) CompoundExtensionFlowObj(*cFlowObj); else tem = new (*this) ExtensionFlowObj(*ep->flowObj); } break; } } } if (!tem) { if (pubid == "UNREGISTERED::James Clark//Flow Object Class::" "formatting-instruction") tem = new (*this) FormattingInstructionFlowObj; else tem = new (*this) UnknownFlowObj; } makePermanent(tem); ident->setFlowObj(tem, currentPartIndex(), loc); } #ifdef DSSSL_NAMESPACE } #endif #include "FlowObj_inst.cxx" OpenJade-1.4devel/style/GroveManager.cxx0000644000021000000240000000040707025631171013767 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "GroveManager.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif GroveManager::~GroveManager() { } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/GroveManager.h0000644000021000000240000000141007025631171013407 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #ifndef GroveManager_INCLUDED #define GroveManager_INCLUDED 1 #include #include "Node.h" #include #include #include "FOTBuilder.h" #include #include "dsssl_ns.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class STYLE_API GroveManager { public: virtual ~GroveManager(); virtual bool load(const StringC &, const Vector &active, const NodePtr &parent, NodePtr &, const Vector &architecture) = 0; virtual bool readEntity(const StringC &, StringC &) = 0; virtual void mapSysid(StringC &) = 0; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not GroveManager_INCLUDED */ OpenJade-1.4devel/style/InheritedC.cxx0000644000021000000240000016171607025631171013443 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "Style.h" #include "VM.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif InheritedC::InheritedC(const Identifier *ident, unsigned index) : ident_(ident), index_(index) { } InheritedC::~InheritedC() { } void InheritedC::invalidValue(const Location &loc, Interpreter &interp) const { interp.invalidCharacteristicValue(identifier(), loc); } class BoolInheritedC : public InheritedC { public: BoolInheritedC(const Identifier *, unsigned index, bool); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: bool value_; }; BoolInheritedC::BoolInheritedC(const Identifier *ident, unsigned index, bool value) : InheritedC(ident, index), value_(value) { } ELObj *BoolInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { if (value_) return vm.interp->makeTrue(); else return vm.interp->makeFalse(); } class IntegerInheritedC : public InheritedC { public: IntegerInheritedC(const Identifier *, unsigned index, long); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: long n_; }; IntegerInheritedC::IntegerInheritedC(const Identifier *ident, unsigned index, long n) : InheritedC(ident, index), n_(n) { } ELObj *IntegerInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return vm.interp->makeInteger(n_); } class LengthInheritedC : public InheritedC { public: LengthInheritedC(const Identifier *, unsigned index, FOTBuilder::Length); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: FOTBuilder::Length size_; }; LengthInheritedC::LengthInheritedC(const Identifier *ident, unsigned index, FOTBuilder::Length size) : InheritedC(ident, index), size_(size) { } ELObj *LengthInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return new (*vm.interp) LengthObj(size_); } class SymbolInheritedC : public InheritedC { public: SymbolInheritedC(const Identifier *, unsigned index, FOTBuilder::Symbol); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: FOTBuilder::Symbol sym_; }; SymbolInheritedC::SymbolInheritedC(const Identifier *ident, unsigned index, FOTBuilder::Symbol sym) : InheritedC(ident, index), sym_(sym) { } ELObj *SymbolInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return vm.interp->cValueSymbol(sym_); } class PublicIdInheritedC : public InheritedC { public: PublicIdInheritedC(const Identifier *, unsigned index, FOTBuilder::PublicId = 0); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: FOTBuilder::PublicId pubid_; }; PublicIdInheritedC::PublicIdInheritedC(const Identifier *ident, unsigned index, FOTBuilder::PublicId pubid) : InheritedC(ident, index), pubid_(pubid) { } ELObj *PublicIdInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { Interpreter &interp = *vm.interp; if (pubid_) return new (interp) StringObj(interp.makeStringC(pubid_)); else return interp.makeFalse(); } class Letter2InheritedC : public InheritedC { public: Letter2InheritedC(const Identifier *, unsigned index, FOTBuilder::Letter2 = 0); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: FOTBuilder::Letter2 code_; }; Letter2InheritedC::Letter2InheritedC(const Identifier *ident, unsigned index, FOTBuilder::Letter2 code) : InheritedC(ident, index), code_(code) { } ELObj *Letter2InheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { Interpreter &interp = *vm.interp; if (code_) { StringC buf; buf += (code_ >> 8) & 0xff; buf += code_ & 0xff; buf += 0; return interp.makeSymbol(buf); } else return interp.makeFalse(); } class LengthSpecInheritedC : public InheritedC { public: LengthSpecInheritedC(const Identifier *, unsigned index, FOTBuilder::Length); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: bool setValue(ELObj *, const Location &, Interpreter &); FOTBuilder::LengthSpec value_; }; LengthSpecInheritedC::LengthSpecInheritedC(const Identifier *ident, unsigned index, FOTBuilder::Length n) : InheritedC(ident, index), value_(n) { } ELObj *LengthSpecInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return vm.interp->makeLengthSpec(value_); } bool LengthSpecInheritedC::setValue(ELObj *obj, const Location &loc, Interpreter &interp) { return interp.convertLengthSpecC(obj, identifier(), loc, value_); } class OptLengthSpecInheritedC : public InheritedC { public: OptLengthSpecInheritedC(const Identifier *, unsigned index); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: bool setValue(ELObj *, const Location &, Interpreter &); FOTBuilder::OptLengthSpec value_; }; OptLengthSpecInheritedC::OptLengthSpecInheritedC(const Identifier *ident, unsigned index) : InheritedC(ident, index) { } ELObj *OptLengthSpecInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { if (!value_.hasLength) return vm.interp->makeFalse(); else return vm.interp->makeLengthSpec(value_.length); } bool OptLengthSpecInheritedC::setValue(ELObj *obj, const Location &loc, Interpreter &interp) { return interp.convertOptLengthSpecC(obj, identifier(), loc, value_); } class StringInheritedC : public InheritedC { public: StringInheritedC(const Identifier *, unsigned index, const Char *, size_t ); StringInheritedC(const Identifier *, unsigned index, const StringC &); ELObj *value(VM &, const VarStyleObj *, Vector &) const; protected: StringC str_; }; StringInheritedC::StringInheritedC(const Identifier *ident, unsigned index, const Char *s, size_t n) : InheritedC(ident, index), str_(s, n) { } StringInheritedC::StringInheritedC(const Identifier *ident, unsigned index, const StringC &s) : InheritedC(ident, index), str_(s) { } ELObj *StringInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return new(*vm.interp) StringObj(str_); } class GenericInlineSpaceInheritedC : public InheritedC { public: typedef void (FOTBuilder::*Setter)(const FOTBuilder::InlineSpace &); GenericInlineSpaceInheritedC(const Identifier *, unsigned index, Setter setter); ELObj *value(VM &, const VarStyleObj *, Vector &) const; void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: FOTBuilder::InlineSpace value_; Setter setter_; }; GenericInlineSpaceInheritedC::GenericInlineSpaceInheritedC(const Identifier *ident, unsigned index, Setter setter) : InheritedC(ident, index), setter_(setter) { } ELObj *GenericInlineSpaceInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { return new (*vm.interp) InlineSpaceObj(value_); } void GenericInlineSpaceInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(value_); } ConstPtr GenericInlineSpaceInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { GenericInlineSpaceInheritedC *copy = new GenericInlineSpaceInheritedC(identifier(), index(), setter_); InlineSpaceObj *iso = obj->asInlineSpace(); if (iso) { copy->value_ = iso->inlineSpace(); return copy; } else if (interp.convertLengthSpecC(obj, identifier(), loc, copy->value_.nominal)) { copy->value_.min = copy->value_.nominal; copy->value_.max = copy->value_.nominal; return copy; } delete copy; return 0; } class GenericBoolInheritedC : public BoolInheritedC { public: typedef void (FOTBuilder::*Setter)(bool); GenericBoolInheritedC(const Identifier *, unsigned index, Setter, bool = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericBoolInheritedC ::GenericBoolInheritedC(const Identifier *ident, unsigned index, Setter setter, bool b) : BoolInheritedC(ident, index, b), setter_(setter) { } void GenericBoolInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(value_); } ConstPtr GenericBoolInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { bool b; if (interp.convertBooleanC(obj, identifier(), loc, b)) return new GenericBoolInheritedC(identifier(), index(), setter_, b); return ConstPtr(); } class ExtensionBoolInheritedC : public BoolInheritedC { public: typedef void (FOTBuilder::*Setter)(bool); ExtensionBoolInheritedC(const Identifier *, unsigned index, Setter, bool = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; ExtensionBoolInheritedC ::ExtensionBoolInheritedC(const Identifier *ident, unsigned index, Setter setter, bool b) : BoolInheritedC(ident, index, b), setter_(setter) { } void ExtensionBoolInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.extensionSet(setter_, value_); } ConstPtr ExtensionBoolInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { bool b; if (interp.convertBooleanC(obj, identifier(), loc, b)) return new ExtensionBoolInheritedC(identifier(), index(), setter_, b); return ConstPtr(); } class ExtensionStringInheritedC : public StringInheritedC { public: typedef void (FOTBuilder::*Setter)(const StringC &); ExtensionStringInheritedC(const Identifier *, unsigned index, Setter); ExtensionStringInheritedC(const Identifier *, unsigned index, Setter, const Char *, size_t); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; ExtensionStringInheritedC ::ExtensionStringInheritedC(const Identifier *ident, unsigned index, Setter setter) : StringInheritedC(ident, index, StringC()), setter_(setter) { } ExtensionStringInheritedC ::ExtensionStringInheritedC(const Identifier *ident, unsigned index, Setter setter, const Char *s, size_t n) : StringInheritedC(ident, index, s, n), setter_(setter) { } void ExtensionStringInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.extensionSet(setter_, str_); } ConstPtr ExtensionStringInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { const Char *s; size_t n; if (obj->stringData(s, n)) return new ExtensionStringInheritedC(identifier(), index(), setter_, s, n); invalidValue(loc, interp); return ConstPtr(); } class ExtensionIntegerInheritedC : public IntegerInheritedC { public: typedef void (FOTBuilder::*Setter)(long); ExtensionIntegerInheritedC(const Identifier *, unsigned index, Setter, long = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; ExtensionIntegerInheritedC ::ExtensionIntegerInheritedC(const Identifier *ident, unsigned index, Setter setter, long n) : IntegerInheritedC(ident, index, n), setter_(setter) { } void ExtensionIntegerInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.extensionSet(setter_, n_); } ConstPtr ExtensionIntegerInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { long n; if (interp.convertIntegerC(obj, identifier(), loc, n)) return new ExtensionIntegerInheritedC(identifier(), index(), setter_, n); return ConstPtr(); } class ExtensionLengthInheritedC : public LengthInheritedC { public: typedef void (FOTBuilder::*Setter)(FOTBuilder::Length); ExtensionLengthInheritedC(const Identifier *, unsigned index, Setter, FOTBuilder::Length = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; ExtensionLengthInheritedC ::ExtensionLengthInheritedC(const Identifier *ident, unsigned index, Setter setter, FOTBuilder::Length n) : LengthInheritedC(ident, index, n), setter_(setter) { } void ExtensionLengthInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.extensionSet(setter_, size_); } ConstPtr ExtensionLengthInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { FOTBuilder::Length n; if (interp.convertLengthC(obj, identifier(), loc, n)) return new ExtensionLengthInheritedC(identifier(), index(), setter_, n); return ConstPtr(); } class GenericLengthInheritedC : public LengthInheritedC { public: typedef void (FOTBuilder::*Setter)(FOTBuilder::Length); GenericLengthInheritedC(const Identifier *, unsigned index, Setter, FOTBuilder::Length = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericLengthInheritedC ::GenericLengthInheritedC(const Identifier *ident, unsigned index, Setter setter, FOTBuilder::Length n) : LengthInheritedC(ident, index, n), setter_(setter) { } void GenericLengthInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(size_); } ConstPtr GenericLengthInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { FOTBuilder::Length n; if (interp.convertLengthC(obj, identifier(), loc, n)) return new GenericLengthInheritedC(identifier(), index(), setter_, n); return ConstPtr(); } class GenericIntegerInheritedC : public IntegerInheritedC { public: typedef void (FOTBuilder::*Setter)(long); GenericIntegerInheritedC(const Identifier *, unsigned index, Setter, long); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; protected: Setter setter_; }; GenericIntegerInheritedC ::GenericIntegerInheritedC(const Identifier *ident, unsigned index, Setter setter, long n) : IntegerInheritedC(ident, index, n), setter_(setter) { } void GenericIntegerInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(n_); } ConstPtr GenericIntegerInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { long n; if (interp.convertIntegerC(obj, identifier(), loc, n)) return new GenericIntegerInheritedC(identifier(), index(), setter_, n); return ConstPtr(); } class GenericMaybeIntegerInheritedC : public GenericIntegerInheritedC { public: GenericMaybeIntegerInheritedC(const Identifier *, unsigned index, Setter, long); ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; }; GenericMaybeIntegerInheritedC ::GenericMaybeIntegerInheritedC(const Identifier *ident, unsigned index, Setter setter, long n) : GenericIntegerInheritedC(ident, index, setter, n) { } ELObj *GenericMaybeIntegerInheritedC::value(VM &vm, const VarStyleObj *style, Vector &dep) const { if (!n_) return vm.interp->makeFalse(); else return IntegerInheritedC::value(vm, style, dep); } ConstPtr GenericMaybeIntegerInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { long n; if (interp.convertOptPositiveIntegerC(obj, identifier(), loc, n)) return new GenericMaybeIntegerInheritedC(identifier(), index(), setter_, n); return ConstPtr(); } class GenericSymbolInheritedC : public SymbolInheritedC { public: typedef void (FOTBuilder::*Setter)(FOTBuilder::Symbol); GenericSymbolInheritedC(const Identifier *, unsigned index, Setter, FOTBuilder::Symbol = FOTBuilder::symbolFalse); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericSymbolInheritedC ::GenericSymbolInheritedC(const Identifier *ident, unsigned index, Setter setter, FOTBuilder::Symbol sym) : SymbolInheritedC(ident, index, sym), setter_(setter) { } void GenericSymbolInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(sym_); } ConstPtr GenericSymbolInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { FOTBuilder::Symbol sym; if (interp.convertEnumC(obj, identifier(), loc, sym)) return new GenericSymbolInheritedC(identifier(), index(), setter_, sym); return ConstPtr(); } class GenericPublicIdInheritedC : public PublicIdInheritedC { public: typedef void (FOTBuilder::*Setter)(FOTBuilder::PublicId); GenericPublicIdInheritedC(const Identifier *, unsigned index, Setter, FOTBuilder::PublicId = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericPublicIdInheritedC ::GenericPublicIdInheritedC(const Identifier *ident, unsigned index, Setter setter, FOTBuilder::PublicId pubid) : PublicIdInheritedC(ident, index, pubid), setter_(setter) { } void GenericPublicIdInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(pubid_); } ConstPtr GenericPublicIdInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { FOTBuilder::PublicId pubid; if (interp.convertPublicIdC(obj, identifier(), loc, pubid)) return new GenericPublicIdInheritedC(identifier(), index(), setter_, pubid); return ConstPtr(); } class GenericLetter2InheritedC : public Letter2InheritedC { public: typedef void (FOTBuilder::*Setter)(FOTBuilder::Letter2); GenericLetter2InheritedC(const Identifier *, unsigned index, Setter, FOTBuilder::Letter2 = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericLetter2InheritedC ::GenericLetter2InheritedC(const Identifier *ident, unsigned index, Setter setter, FOTBuilder::Letter2 code) : Letter2InheritedC(ident, index, code), setter_(setter) { } void GenericLetter2InheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(code_); } ConstPtr GenericLetter2InheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { FOTBuilder::Letter2 code; if (interp.convertLetter2C(obj, identifier(), loc, code)) return new GenericLetter2InheritedC(identifier(), index(), setter_, code); return ConstPtr(); } class GenericLengthSpecInheritedC : public LengthSpecInheritedC { public: typedef void (FOTBuilder::*Setter)(const FOTBuilder::LengthSpec &); GenericLengthSpecInheritedC(const Identifier *, unsigned index, Setter, long = 0); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericLengthSpecInheritedC ::GenericLengthSpecInheritedC(const Identifier *ident, unsigned index, Setter setter, long n) : LengthSpecInheritedC(ident, index, n), setter_(setter) { } void GenericLengthSpecInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(value_); } ConstPtr GenericLengthSpecInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { GenericLengthSpecInheritedC *copy = new GenericLengthSpecInheritedC(identifier(), index(), setter_); if (!copy->setValue(obj, loc, interp)) { delete copy; copy = 0; } return copy; } class GenericOptInlineSpaceInheritedC : public InheritedC { public: typedef void (FOTBuilder::*Setter)(const FOTBuilder::OptInlineSpace &); GenericOptInlineSpaceInheritedC(const Identifier *, unsigned index, Setter); ELObj *value(VM &, const VarStyleObj *, Vector &) const; void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: FOTBuilder::OptInlineSpace value_; Setter setter_; }; GenericOptInlineSpaceInheritedC ::GenericOptInlineSpaceInheritedC(const Identifier *ident, unsigned index, Setter setter) : InheritedC(ident, index), setter_(setter) { } ELObj *GenericOptInlineSpaceInheritedC::value(VM &vm, const VarStyleObj *, Vector &) const { if (!value_.hasSpace) return vm.interp->makeFalse(); else return new (*vm.interp) InlineSpaceObj(value_.space); } void GenericOptInlineSpaceInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(value_); } ConstPtr GenericOptInlineSpaceInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { GenericOptInlineSpaceInheritedC *copy = new GenericOptInlineSpaceInheritedC(identifier(), index(), setter_); InlineSpaceObj *iso = obj->asInlineSpace(); if (iso) { copy->value_.space = iso->inlineSpace(); copy->value_.hasSpace = 1; } else { FOTBuilder::OptLengthSpec res; if (interp.convertOptLengthSpecC(obj, identifier(), loc, res)) { if (res.hasLength) { copy->value_.space.nominal = res.length; copy->value_.space.min = res.length; copy->value_.space.max = res.length; copy->value_.hasSpace = 1; } else copy->value_.hasSpace = 0; } else { delete copy; copy = 0; } } return copy; } class GenericOptLengthSpecInheritedC : public OptLengthSpecInheritedC { public: typedef void (FOTBuilder::*Setter)(const FOTBuilder::OptLengthSpec &); GenericOptLengthSpecInheritedC(const Identifier *, unsigned index, Setter); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: Setter setter_; }; GenericOptLengthSpecInheritedC ::GenericOptLengthSpecInheritedC(const Identifier *ident, unsigned index, Setter setter) : OptLengthSpecInheritedC(ident, index), setter_(setter) { } void GenericOptLengthSpecInheritedC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { (fotb.*setter_)(value_); } ConstPtr GenericOptLengthSpecInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { GenericOptLengthSpecInheritedC *copy = new GenericOptLengthSpecInheritedC(identifier(), index(), setter_); if (!copy->setValue(obj, loc, interp)) { delete copy; copy = 0; } return copy; } class FontSizeC : public LengthInheritedC { public: FontSizeC(const Identifier *, unsigned index, long); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; }; FontSizeC::FontSizeC(const Identifier *ident, unsigned index, long size) : LengthInheritedC(ident, index, size) { } void FontSizeC::set(VM &vm, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.setFontSize(size_); } ConstPtr FontSizeC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { long n; if (interp.convertLengthC(obj, identifier(), loc, n)) return new FontSizeC(identifier(), index(), n); return ConstPtr(); } class FontFamilyNameC : public StringInheritedC { public: FontFamilyNameC(const Identifier *, unsigned index, const Char *, size_t); FontFamilyNameC(const Identifier *, unsigned index, const StringC &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; }; FontFamilyNameC::FontFamilyNameC(const Identifier *ident, unsigned index, const Char *s, size_t n) : StringInheritedC(ident, index, s, n) { } FontFamilyNameC::FontFamilyNameC(const Identifier *ident, unsigned index, const StringC &s) : StringInheritedC(ident, index, s) { } void FontFamilyNameC::set(VM &vm, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.setFontFamilyName(str_); } ConstPtr FontFamilyNameC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { const Char *s; size_t n; if (obj->stringData(s, n)) return new FontFamilyNameC(identifier(), index(), s, n); invalidValue(loc, interp); return ConstPtr(); } class ColorC : public InheritedC, private Collector::DynamicRoot { public: ColorC(const Identifier *, unsigned index, ColorObj *, Interpreter &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; void trace(Collector &) const; private: ColorObj *color_; }; ColorC::ColorC(const Identifier *ident, unsigned index, ColorObj *color, Interpreter &interp) : InheritedC(ident, index), Collector::DynamicRoot(interp), color_(color) { } void ColorC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { color_->set(fotb); } ConstPtr ColorC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { ColorObj *color; if (interp.convertColorC(obj, identifier(), loc, color)) return new ColorC(identifier(), index(), color, interp); return ConstPtr(); } ELObj *ColorC::value(VM &vm, const VarStyleObj *, Vector &) const { if (!color_) return vm.interp->makeFalse(); else return color_; } void ColorC::trace(Collector &c) const { c.trace(color_); } class BackgroundColorC : public InheritedC, private Collector::DynamicRoot { public: BackgroundColorC(const Identifier *, unsigned index, ColorObj *, Interpreter &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; void trace(Collector &) const; private: ColorObj *color_; }; BackgroundColorC::BackgroundColorC(const Identifier *ident, unsigned index, ColorObj *color, Interpreter &interp) : InheritedC(ident, index), Collector::DynamicRoot(interp), color_(color) { } void BackgroundColorC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { if (color_) color_->setBackground(fotb); else fotb.setBackgroundColor(); } ConstPtr BackgroundColorC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { ColorObj *color; if (interp.convertOptColorC(obj, identifier(), loc, color)) return new BackgroundColorC(identifier(), index(), color, interp); return ConstPtr(); } ELObj * BackgroundColorC::value(VM &vm, const VarStyleObj *, Vector &) const { if (color_) return color_; else return vm.interp->makeFalse(); } void BackgroundColorC::trace(Collector &c) const { c.trace(color_); } class GlyphSubstTableC : public InheritedC { public: GlyphSubstTableC(const Identifier *, unsigned index, bool isList); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; void append(const ConstPtr &table) { tables_.push_back(table); } private: // Distinguish between #f and () for inherited-glyph-subst-table bool isList_; Vector > tables_; }; GlyphSubstTableC::GlyphSubstTableC(const Identifier *ident, unsigned index, bool isList) : InheritedC(ident, index), isList_(isList) { } void GlyphSubstTableC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.setGlyphSubstTable(tables_); } ConstPtr GlyphSubstTableC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { if (obj == interp.makeFalse()) return new GlyphSubstTableC(identifier(), index(), 0); GlyphSubstTableObj *table = obj->asGlyphSubstTable(); if (table) { Ptr tem = new GlyphSubstTableC(identifier(), index(), 0); ((GlyphSubstTableC *)tem.pointer())->append(table->glyphSubstTable()); return tem; } Ptr tem = new GlyphSubstTableC(identifier(), index(), 1); for (;;) { if (obj->isNil()) return tem; PairObj *pair = obj->asPair(); if (!pair) break; obj = pair->cdr(); table = pair->car()->asGlyphSubstTable(); if (!table) break; ((GlyphSubstTableC *)tem.pointer())->append(table->glyphSubstTable()); } invalidValue(loc, interp); return ConstPtr(); } ELObj *GlyphSubstTableC::value(VM &vm, const VarStyleObj *, Vector &) const { if (!isList_) { if (tables_.size()) return new (*vm.interp) GlyphSubstTableObj(tables_[0]); else return vm.interp->makeFalse(); } else { ELObj *list = vm.interp->makeNil(); ELObjDynamicRoot protect(*vm.interp, list); for (size_t i = tables_.size(); i > 0; i--) { ELObj *tableObj = new (*vm.interp) GlyphSubstTableObj(tables_[i - 1]); ELObjDynamicRoot protect2(*vm.interp, tableObj); list = vm.interp->makePair(tableObj, list); protect = list; } return list; } } class IgnoredC : public InheritedC, private Collector::DynamicRoot { public: IgnoredC(const Identifier *, unsigned index, ELObj *, Interpreter &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&, Vector &) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; void trace(Collector &) const; private: ELObj *value_; }; IgnoredC::IgnoredC(const Identifier *ident, unsigned index, ELObj *value, Interpreter &interp) : InheritedC(ident, index), Collector::DynamicRoot(interp), value_(value) { } void IgnoredC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { } ConstPtr IgnoredC::make(ELObj *obj, const Location &, Interpreter &interp) const { return new IgnoredC(identifier(), index(), obj, interp); } ELObj *IgnoredC::value(VM &, const VarStyleObj *, Vector &) const { return value_; } void IgnoredC::trace(Collector &c) const { c.trace(value_); } class CharMapC : public InheritedC, private Collector::DynamicRoot { public: CharMapC(const Identifier *, unsigned index, ELObj *, Interpreter &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&, Vector &) const; ConstPtr make(ELObj *, const Location &, Interpreter &) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; void trace(Collector &) const; private: ELObj *value_; FOTBuilder::Symbol sym_; }; CharMapC::CharMapC(const Identifier *ident, unsigned index, ELObj *value, Interpreter &interp) : InheritedC(ident, index), Collector::DynamicRoot(interp), value_(value), sym_(FOTBuilder::symbolFalse) { } void CharMapC::set(VM &, const VarStyleObj *, FOTBuilder &fotb, ELObj *&, Vector &) const { fotb.setCharMap(sym_); } ConstPtr CharMapC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { if (obj == interp.makeFalse()) return new CharMapC(identifier(), index(), obj, interp); FunctionObj *func = obj->asFunction(); if (func) { if (func->nRequiredArgs() > 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::missingArg); return ConstPtr(); } if ((func->nRequiredArgs() + func->nOptionalArgs() + func->restArg() ? 1 : 0) == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::tooManyArgs); return ConstPtr(); } return new CharMapC (identifier(), index(), obj, interp); } if (interp.dsssl2()) { static FOTBuilder::Symbol syms[] = { FOTBuilder::symbolUppercase, FOTBuilder::symbolLowercase, FOTBuilder::symbolCapitalize, }; FOTBuilder::Symbol sym; if (interp.convertEnumC(syms, SIZEOF(syms), obj, identifier(), loc, sym)) { CharMapC *cm(new CharMapC(identifier(), index(), obj, interp)); cm->sym_ = sym; return cm; } else return ConstPtr(); } // Not dsssl2. interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(identifier()->name())); return ConstPtr(); } ELObj *CharMapC::value(VM &, const VarStyleObj *, Vector &) const { return value_; } void CharMapC::trace(Collector &c) const { c.trace(value_); } class BorderC : public IgnoredC { public: BorderC(const Identifier *, unsigned index, ELObj *, Interpreter &); ConstPtr make(ELObj *, const Location &, Interpreter &) const; }; BorderC::BorderC(const Identifier *ident, unsigned index, ELObj *value, Interpreter &interp) : IgnoredC(ident, index, value, interp) { } ConstPtr BorderC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { StyleObj *tem; SosofoObj *sosofo = obj->asSosofo(); if (sosofo && sosofo->tableBorderStyle(tem)) return new BorderC(identifier(), index(), obj, interp); bool b; if (interp.convertBooleanC(obj, identifier(), loc, b)) { if (b) obj = interp.makeTrue(); else obj = interp.makeFalse(); return new BorderC(identifier(), index(), obj, interp); } return ConstPtr(); } class RuleC : public IgnoredC { public: RuleC(const Identifier *, unsigned index, ELObj *, Interpreter &); ConstPtr make(ELObj *, const Location &, Interpreter &) const; }; RuleC::RuleC(const Identifier *ident, unsigned index, ELObj *value, Interpreter &interp) : IgnoredC(ident, index, value, interp) { } ConstPtr RuleC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { SosofoObj *sosofo = obj->asSosofo(); if (sosofo && sosofo->isRule()) return new RuleC(identifier(), index(), obj, interp); invalidValue(loc, interp); return ConstPtr(); } class InheritedCPrimitiveObj : public PrimitiveObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } static const Signature signature_; InheritedCPrimitiveObj(const ConstPtr &ic) : PrimitiveObj(&signature_), inheritedC_(ic) { } ELObj *primitiveCall(int, ELObj **, EvalContext &, Interpreter &, const Location &); private: ConstPtr inheritedC_; }; const Signature InheritedCPrimitiveObj::signature_ = { 0, 0, 0 }; ELObj *InheritedCPrimitiveObj::primitiveCall(int, ELObj **, EvalContext &ec, Interpreter &interp, const Location &loc) { if (!interp.style()) return interp.makeError(); if (!ec.styleStack) { interp.setNextLocation(loc); interp.message(InterpreterMessages::notInCharacteristicValue); return interp.makeError(); } ELObj *obj = ec.styleStack->inherited(inheritedC_, ec.specLevel, interp, *ec.actualDependencies); interp.makeReadOnly(obj); return obj; } class ActualCPrimitiveObj : public PrimitiveObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } static const Signature signature_; ActualCPrimitiveObj(const ConstPtr &ic) : PrimitiveObj(&signature_), inheritedC_(ic) { } ELObj *primitiveCall(int, ELObj **, EvalContext &, Interpreter &, const Location &); private: ConstPtr inheritedC_; }; const Signature ActualCPrimitiveObj::signature_ = { 0, 0, 0 }; ELObj *ActualCPrimitiveObj::primitiveCall(int, ELObj **, EvalContext &ec, Interpreter &interp, const Location &loc) { interp.requireFeature(Interpreter::actualCharacteristic, loc); if (!interp.style()) return interp.makeError(); if (!ec.styleStack) { interp.setNextLocation(loc); interp.message(InterpreterMessages::notInCharacteristicValue); return interp.makeError(); } ELObj *obj = ec.styleStack->actual(inheritedC_, loc, interp, *ec.actualDependencies); const Char *s; size_t n; interp.makeReadOnly(obj); return obj; } #define INHERITED_C(name, C, init) \ installInheritedC(name, new C(0, nInheritedC_++, init)) #define INHERITED_C2(name, C, init1, init2) \ installInheritedC(name, new C(0, nInheritedC_++, init1, init2)) #define STORE_INHERITED_C2(var, name, C, init1, init2) \ { InheritedC *ic = new C(0, nInheritedC_++, init1, init2); \ installInheritedC(name, ic); \ var = ic; } #define IGNORED_C(name, init) INHERITED_C2(name, IgnoredC, init, *this) static StyleObj *makeBorderStyle(bool b, unsigned index, Interpreter &interp) { Vector > forceSpecs; Vector > specs; specs.push_back( new GenericBoolInheritedC(interp.lookup(interp.makeStringC("border-present?")), index, &FOTBuilder::setBorderPresent, b)); StyleObj *style = new (interp) VarStyleObj(new StyleSpec(forceSpecs, specs), 0, 0, NodePtr()); interp.makePermanent(style); return style; } void Interpreter::installInheritedCs() { INHERITED_C("font-size", FontSizeC, (unitsPerInch()*10)/72); INHERITED_C("font-family-name", FontFamilyNameC, makeStringC("iso-serif")); INHERITED_C2("font-weight", GenericSymbolInheritedC, &FOTBuilder::setFontWeight, FOTBuilder::symbolMedium); INHERITED_C2("font-posture", GenericSymbolInheritedC, &FOTBuilder::setFontPosture, FOTBuilder::symbolUpright); INHERITED_C2("quadding", GenericSymbolInheritedC, &FOTBuilder::setQuadding, FOTBuilder::symbolStart); INHERITED_C2("display-alignment", GenericSymbolInheritedC, &FOTBuilder::setDisplayAlignment, FOTBuilder::symbolStart); INHERITED_C2("field-align", GenericSymbolInheritedC, &FOTBuilder::setFieldAlign, FOTBuilder::symbolStart); INHERITED_C2("lines", GenericSymbolInheritedC, &FOTBuilder::setLines, FOTBuilder::symbolWrap); INHERITED_C("start-indent", GenericLengthSpecInheritedC, &FOTBuilder::setStartIndent); INHERITED_C("first-line-start-indent", GenericLengthSpecInheritedC, &FOTBuilder::setFirstLineStartIndent); INHERITED_C("end-indent", GenericLengthSpecInheritedC, &FOTBuilder::setEndIndent); INHERITED_C("last-line-end-indent", GenericLengthSpecInheritedC, &FOTBuilder::setLastLineEndIndent); INHERITED_C2("line-spacing", GenericLengthSpecInheritedC, &FOTBuilder::setLineSpacing, unitsPerInch()*12/72); INHERITED_C("field-width", GenericLengthSpecInheritedC, &FOTBuilder::setFieldWidth); INHERITED_C("left-margin", GenericLengthInheritedC, &FOTBuilder::setLeftMargin); INHERITED_C("right-margin", GenericLengthInheritedC, &FOTBuilder::setRightMargin); INHERITED_C("top-margin", GenericLengthInheritedC, &FOTBuilder::setTopMargin); INHERITED_C("bottom-margin", GenericLengthInheritedC, &FOTBuilder::setBottomMargin); INHERITED_C("header-margin", GenericLengthInheritedC, &FOTBuilder::setHeaderMargin); INHERITED_C("footer-margin", GenericLengthInheritedC, &FOTBuilder::setFooterMargin); INHERITED_C2("page-width", GenericLengthInheritedC, &FOTBuilder::setPageWidth, unitsPerInch()*8 + unitsPerInch()/2); INHERITED_C2("page-height", GenericLengthInheritedC, &FOTBuilder::setPageHeight, unitsPerInch()*11); INHERITED_C2("color", ColorC, new (*this) DeviceRGBColorObj(0, 0, 0), *this); INHERITED_C2("background-color", BackgroundColorC, 0, *this); INHERITED_C2("border-present?", GenericBoolInheritedC, &FOTBuilder::setBorderPresent, 1); borderTrueStyle_ = makeBorderStyle(1, nInheritedC_ - 1, *this); borderFalseStyle_ = makeBorderStyle(0, nInheritedC_ - 1, *this); STORE_INHERITED_C2(tableBorderC_, "table-border", BorderC, makeFalse(), *this); STORE_INHERITED_C2(cellBeforeRowBorderC_, "cell-before-row-border", BorderC, makeFalse(), *this); STORE_INHERITED_C2(cellAfterRowBorderC_, "cell-after-row-border", BorderC, makeFalse(), *this); STORE_INHERITED_C2(cellBeforeColumnBorderC_, "cell-before-column-border", BorderC, makeFalse(), *this); STORE_INHERITED_C2(cellAfterColumnBorderC_, "cell-after-column-border", BorderC, makeFalse(), *this); STORE_INHERITED_C2(fractionBarC_, "fraction-bar", RuleC, lookup(makeStringC("rule"))->flowObj(), *this); INHERITED_C2("line-thickness", GenericLengthInheritedC, &FOTBuilder::setLineThickness, unitsPerInch()/72); INHERITED_C2("cell-before-row-margin", GenericLengthInheritedC, &FOTBuilder::setCellBeforeRowMargin, 0); INHERITED_C2("cell-after-row-margin", GenericLengthInheritedC, &FOTBuilder::setCellAfterRowMargin, 0); INHERITED_C2("cell-before-column-margin", GenericLengthInheritedC, &FOTBuilder::setCellBeforeColumnMargin, 0); INHERITED_C2("cell-after-column-margin", GenericLengthInheritedC, &FOTBuilder::setCellAfterColumnMargin, 0); INHERITED_C2("line-sep", GenericLengthInheritedC, &FOTBuilder::setLineSep, unitsPerInch()/72); INHERITED_C2("box-size-before", GenericLengthInheritedC, &FOTBuilder::setBoxSizeBefore, 8*unitsPerInch()/72); INHERITED_C2("box-size-after", GenericLengthInheritedC, &FOTBuilder::setBoxSizeAfter, 4*unitsPerInch()/72); INHERITED_C2("position-point-shift", GenericLengthSpecInheritedC, &FOTBuilder::setPositionPointShift, 0); INHERITED_C2("start-margin", GenericLengthSpecInheritedC, &FOTBuilder::setStartMargin, 0); INHERITED_C2("end-margin", GenericLengthSpecInheritedC, &FOTBuilder::setEndMargin, 0); INHERITED_C2("sideline-sep", GenericLengthSpecInheritedC, &FOTBuilder::setSidelineSep, 4*unitsPerInch()/72); INHERITED_C2("asis-wrap-indent", GenericLengthSpecInheritedC, &FOTBuilder::setAsisWrapIndent, 0); INHERITED_C2("line-number-sep", GenericLengthSpecInheritedC, &FOTBuilder::setLineNumberSep, 0); INHERITED_C2("last-line-justify-limit", GenericLengthSpecInheritedC, &FOTBuilder::setLastLineJustifyLimit, 0); INHERITED_C2("justify-glyph-space-max-add", GenericLengthSpecInheritedC, &FOTBuilder::setJustifyGlyphSpaceMaxAdd, 0); INHERITED_C2("justify-glyph-space-max-remove", GenericLengthSpecInheritedC, &FOTBuilder::setJustifyGlyphSpaceMaxRemove, 0); INHERITED_C2("table-corner-radius", GenericLengthSpecInheritedC, &FOTBuilder::setTableCornerRadius, 3*unitsPerInch()/72); INHERITED_C2("box-corner-radius", GenericLengthSpecInheritedC, &FOTBuilder::setBoxCornerRadius, 3*unitsPerInch()/72); INHERITED_C2("marginalia-sep", GenericLengthSpecInheritedC, &FOTBuilder::setMarginaliaSep, 0); INHERITED_C2("inhibit-line-breaks?", GenericBoolInheritedC, &FOTBuilder::setInhibitLineBreaks, 0); INHERITED_C2("hyphenate?", GenericBoolInheritedC, &FOTBuilder::setHyphenate, 0); INHERITED_C2("kern?", GenericBoolInheritedC, &FOTBuilder::setKern, 0); INHERITED_C2("ligature?", GenericBoolInheritedC, &FOTBuilder::setLigature, 0); INHERITED_C2("score-spaces?", GenericBoolInheritedC, &FOTBuilder::setScoreSpaces, 0); INHERITED_C2("float-out-sidelines?", GenericBoolInheritedC, &FOTBuilder::setFloatOutSidelines, 0); INHERITED_C2("float-out-marginalia?", GenericBoolInheritedC, &FOTBuilder::setFloatOutMarginalia, 0); INHERITED_C2("float-out-line-numbers?", GenericBoolInheritedC, &FOTBuilder::setFloatOutLineNumbers, 0); INHERITED_C2("cell-background?", GenericBoolInheritedC, &FOTBuilder::setCellBackground, 0); INHERITED_C2("span-weak?", GenericBoolInheritedC, &FOTBuilder::setSpanWeak, 0); INHERITED_C2("ignore-record-end?", GenericBoolInheritedC, &FOTBuilder::setIgnoreRecordEnd, 0); INHERITED_C2("numbered-lines?", GenericBoolInheritedC, &FOTBuilder::setNumberedLines, 1); INHERITED_C2("hanging-punct?", GenericBoolInheritedC, &FOTBuilder::setHangingPunct, 0); INHERITED_C2("box-open-end?", GenericBoolInheritedC, &FOTBuilder::setBoxOpenEnd, 0); INHERITED_C2("side-by-side-overlap-control", GenericSymbolInheritedC, &FOTBuilder::setSideBySideOverlapControl, FOTBuilder::symbolIndent); INHERITED_C2("side-by-side-pre-align", GenericSymbolInheritedC, &FOTBuilder::setSideBySidePreAlign, FOTBuilder::symbolInitial); INHERITED_C2("side-by-side-post-align", GenericSymbolInheritedC, &FOTBuilder::setSideBySidePostAlign, FOTBuilder::symbolInitial); INHERITED_C2("truncate-leader?", GenericBoolInheritedC, &FOTBuilder::setTruncateLeader, 0); INHERITED_C2("align-leader?", GenericBoolInheritedC, &FOTBuilder::setAlignLeader, 1); INHERITED_C2("table-part-omit-middle-header?", GenericBoolInheritedC, &FOTBuilder::setTablePartOmitMiddleHeader, 0); INHERITED_C2("table-part-omit-middle-footer?", GenericBoolInheritedC, &FOTBuilder::setTablePartOmitMiddleFooter, 0); INHERITED_C2("border-omit-at-break?", GenericBoolInheritedC, &FOTBuilder::setBorderOmitAtBreak, 0); INHERITED_C2("principal-mode-simultaneous?", GenericBoolInheritedC, &FOTBuilder::setPrincipalModeSimultaneous, 0); INHERITED_C2("marginalia-keep-with-previous?", GenericBoolInheritedC, &FOTBuilder::setMarginaliaKeepWithPrevious, 0); INHERITED_C2("grid-equidistant-rows?", GenericBoolInheritedC, &FOTBuilder::setGridEquidistantRows, 0); INHERITED_C2("grid-equidistant-columns?", GenericBoolInheritedC, &FOTBuilder::setGridEquidistantColumns, 0); INHERITED_C2("line-join", GenericSymbolInheritedC, &FOTBuilder::setLineJoin, FOTBuilder::symbolMiter); INHERITED_C2("line-cap", GenericSymbolInheritedC, &FOTBuilder::setLineCap, FOTBuilder::symbolButt); INHERITED_C2("line-number-side", GenericSymbolInheritedC, &FOTBuilder::setLineNumberSide, FOTBuilder::symbolStart); INHERITED_C2("kern-mode", GenericSymbolInheritedC, &FOTBuilder::setKernMode, FOTBuilder::symbolNormal); INHERITED_C2("input-whitespace-treatment", GenericSymbolInheritedC, &FOTBuilder::setInputWhitespaceTreatment, FOTBuilder::symbolPreserve); INHERITED_C2("filling-direction", GenericSymbolInheritedC, &FOTBuilder::setFillingDirection, FOTBuilder::symbolTopToBottom ); INHERITED_C2("writing-mode", GenericSymbolInheritedC, &FOTBuilder::setWritingMode, FOTBuilder::symbolLeftToRight ); INHERITED_C2("last-line-quadding", GenericSymbolInheritedC, &FOTBuilder::setLastLineQuadding, FOTBuilder::symbolRelative); INHERITED_C2("math-display-mode", GenericSymbolInheritedC, &FOTBuilder::setMathDisplayMode, FOTBuilder::symbolDisplay); INHERITED_C2("script-pre-align", GenericSymbolInheritedC, &FOTBuilder::setScriptPreAlign, FOTBuilder::symbolIndependent); INHERITED_C2("script-post-align", GenericSymbolInheritedC, &FOTBuilder::setScriptPostAlign, FOTBuilder::symbolIndependent); INHERITED_C2("script-mid-sup-align", GenericSymbolInheritedC, &FOTBuilder::setScriptMidSupAlign, FOTBuilder::symbolCenter); INHERITED_C2("script-mid-sub-align", GenericSymbolInheritedC, &FOTBuilder::setScriptMidSubAlign, FOTBuilder::symbolCenter); INHERITED_C2("numerator-align", GenericSymbolInheritedC, &FOTBuilder::setNumeratorAlign, FOTBuilder::symbolCenter); INHERITED_C2("denominator-align", GenericSymbolInheritedC, &FOTBuilder::setDenominatorAlign, FOTBuilder::symbolCenter); INHERITED_C2("grid-position-cell-type", GenericSymbolInheritedC, &FOTBuilder::setGridPositionCellType, FOTBuilder::symbolRowMajor); INHERITED_C2("grid-column-alignment", GenericSymbolInheritedC, &FOTBuilder::setGridColumnAlignment, FOTBuilder::symbolCenter); INHERITED_C2("grid-row-alignment", GenericSymbolInheritedC, &FOTBuilder::setGridRowAlignment, FOTBuilder::symbolCenter); INHERITED_C2("box-type", GenericSymbolInheritedC, &FOTBuilder::setBoxType, FOTBuilder::symbolBorder); INHERITED_C2("glyph-alignment-mode", GenericSymbolInheritedC, &FOTBuilder::setGlyphAlignmentMode, FOTBuilder::symbolFont); INHERITED_C2("box-border-alignment", GenericSymbolInheritedC, &FOTBuilder::setBoxBorderAlignment, FOTBuilder::symbolOutside); INHERITED_C2("cell-row-alignment", GenericSymbolInheritedC, &FOTBuilder::setCellRowAlignment, FOTBuilder::symbolStart); INHERITED_C2("border-alignment", GenericSymbolInheritedC, &FOTBuilder::setBorderAlignment, FOTBuilder::symbolCenter); INHERITED_C2("sideline-side", GenericSymbolInheritedC, &FOTBuilder::setSidelineSide, FOTBuilder::symbolStart); INHERITED_C2("hyphenation-keep", GenericSymbolInheritedC, &FOTBuilder::setHyphenationKeep, FOTBuilder::symbolFalse); INHERITED_C2("font-structure", GenericSymbolInheritedC, &FOTBuilder::setFontStructure, FOTBuilder::symbolSolid); INHERITED_C2("font-proportionate-width", GenericSymbolInheritedC, &FOTBuilder::setFontProportionateWidth, FOTBuilder::symbolMedium); INHERITED_C2("cell-crossed", GenericSymbolInheritedC, &FOTBuilder::setCellCrossed, FOTBuilder::symbolFalse); INHERITED_C2("marginalia-side", GenericSymbolInheritedC, &FOTBuilder::setMarginaliaSide, FOTBuilder::symbolStart); INHERITED_C2("layer", GenericIntegerInheritedC, &FOTBuilder::setLayer, 0); INHERITED_C2("background-layer", GenericIntegerInheritedC, &FOTBuilder::setBackgroundLayer, -1); INHERITED_C2("border-priority", GenericIntegerInheritedC, &FOTBuilder::setBorderPriority, 0); INHERITED_C2("line-repeat", GenericIntegerInheritedC, &FOTBuilder::setLineRepeat, 1); INHERITED_C2("span", GenericIntegerInheritedC, &FOTBuilder::setSpan, 1); INHERITED_C2("min-leader-repeat", GenericIntegerInheritedC, &FOTBuilder::setMinLeaderRepeat, 1); INHERITED_C2("hyphenation-remain-char-count", GenericIntegerInheritedC, &FOTBuilder::setHyphenationRemainCharCount, 2); INHERITED_C2("hyphenation-push-char-count", GenericIntegerInheritedC, &FOTBuilder::setHyphenationPushCharCount, 2); INHERITED_C2("widow-count", GenericIntegerInheritedC, &FOTBuilder::setWidowCount, 2); INHERITED_C2("orphan-count", GenericIntegerInheritedC, &FOTBuilder::setOrphanCount, 2); // #f or strictly positive integer INHERITED_C2("expand-tabs?", GenericMaybeIntegerInheritedC, &FOTBuilder::setExpandTabs, 8); INHERITED_C2("hyphenation-ladder-count", GenericMaybeIntegerInheritedC, &FOTBuilder::setHyphenationLadderCount, 0); INHERITED_C("background-tile", GenericPublicIdInheritedC, &FOTBuilder::setBackgroundTile); INHERITED_C("line-breaking-method", GenericPublicIdInheritedC, &FOTBuilder::setLineBreakingMethod); INHERITED_C("line-composition-method", GenericPublicIdInheritedC, &FOTBuilder::setLineCompositionMethod); INHERITED_C("implicit-bidi-method", GenericPublicIdInheritedC, &FOTBuilder::setImplicitBidiMethod); INHERITED_C("glyph-subst-method", GenericPublicIdInheritedC, &FOTBuilder::setGlyphSubstMethod); INHERITED_C("glyph-reorder-method", GenericPublicIdInheritedC, &FOTBuilder::setGlyphReorderMethod); INHERITED_C("hyphenation-method", GenericPublicIdInheritedC, &FOTBuilder::setHyphenationMethod); INHERITED_C("table-auto-width-method", GenericPublicIdInheritedC, &FOTBuilder::setTableAutoWidthMethod); INHERITED_C("font-name", GenericPublicIdInheritedC, &FOTBuilder::setFontName); // 2 letter symbol or #f INHERITED_C("language", GenericLetter2InheritedC, &FOTBuilder::setLanguage); INHERITED_C("country", GenericLetter2InheritedC, &FOTBuilder::setCountry); // Ignored characteristics ELObjDynamicRoot length0(*this, new (*this) LengthObj(0)); // #f or length-spec INHERITED_C("min-pre-line-spacing", GenericOptLengthSpecInheritedC, &FOTBuilder::setMinPreLineSpacing); INHERITED_C("min-post-line-spacing", GenericOptLengthSpecInheritedC, &FOTBuilder::setMinPostLineSpacing); INHERITED_C("min-leading", GenericOptLengthSpecInheritedC, &FOTBuilder::setMinLeading); // inline spaces INHERITED_C("escapement-space-before", GenericInlineSpaceInheritedC, &FOTBuilder::setEscapementSpaceBefore); INHERITED_C("escapement-space-after", GenericInlineSpaceInheritedC, &FOTBuilder::setEscapementSpaceAfter); // #f or glyph-subst-table INHERITED_C("glyph-subst-table", GlyphSubstTableC, 0); // #f or inline-space INHERITED_C("inline-space-space", GenericOptInlineSpaceInheritedC, &FOTBuilder::setInlineSpaceSpace); // integers // float IGNORED_C("line-miter-limit", makeInteger(10)); // #f or percentage IGNORED_C("alignment-point-offset", makeInteger(50)); // char IGNORED_C("hyphenation-char", new (*this) CharObj('-')); // char or #f IGNORED_C("asis-truncate-char", makeFalse()); IGNORED_C("asis-wrap-char", makeFalse()); // #f, #t or char IGNORED_C("first-line-align", makeFalse()); // list of strings IGNORED_C("hyphenation-exceptions", makeNil()); // set of corners IGNORED_C("box-corner-rounded", makeFalse()); IGNORED_C("table-corner-rounded", makeFalse()); // list of lengths IGNORED_C("line-dash", new (*this) PairObj(length0, makeNil())); // list of glyphs/chars IGNORED_C("allowed-ligatures", makeNil()); // #f or sosofo IGNORED_C("line-number", makeFalse()); // integer or 'force IGNORED_C("line-spacing-priority", makeInteger(0)); // procedure or #f STORE_INHERITED_C2(charMapC_, "char-map", CharMapC, makeFalse(), *this); } void Interpreter::installInheritedC(const char *s, InheritedC *ic) { StringC name(makeStringC(s)); Identifier *ident = lookup(name); ic->setIdentifier(ident); ident->setInheritedC(ic); installInheritedCProc(ident); if (dsssl2() && name.size() && name[name.size() - 1] == '?') { name.resize(name.size() - 1); Identifier *ident2 = lookup(name); ASSERT(ident2->inheritedC().isNull()); ident2->setInheritedC(ic); installInheritedCProc(ident2); } } void Interpreter::installExtensionInheritedC(Identifier *ident, const StringC &pubid, const Location &loc) { ConstPtr ic; if (pubid.size() != 0 && fotbDescr_.extensions) { for (const FOTBuilder::Extension *ep = fotbDescr_.extensions; ep->pubid; ep++) { if (pubid == ep->pubid) { if (ep->boolSetter) ic = new ExtensionBoolInheritedC(ident, nInheritedC_++, ep->boolSetter); else if (ep->stringSetter) ic = new ExtensionStringInheritedC(ident, nInheritedC_++, ep->stringSetter); else if (ep->integerSetter) ic = new ExtensionIntegerInheritedC(ident, nInheritedC_++, ep->integerSetter); else if (ep->lengthSetter) ic = new ExtensionLengthInheritedC(ident, nInheritedC_++, ep->lengthSetter); break; } } } if (ic.isNull()) // FIXME should call FOTBuilder with PublicId argument ic = new IgnoredC(ident, nInheritedC_++, makeFalse(), *this); ident->setInheritedC(ic, currentPartIndex(), loc); installInheritedCProc(ident); } void Interpreter::installInheritedCProc(const Identifier *ident) { const ConstPtr &ic = ident->inheritedC(); StringC tem(makeStringC("inherited-")); tem += ident->name(); Identifier *inhIdent = lookup(tem); PrimitiveObj *prim = new (*this) InheritedCPrimitiveObj(ic); makePermanent(prim); prim->setIdentifier(inhIdent); inhIdent->setValue(prim); tem = makeStringC("actual-"); tem += ident->name(); Identifier *actIdent = lookup(tem); prim = new (*this) ActualCPrimitiveObj(ic); makePermanent(prim); prim->setIdentifier(actIdent); actIdent->setValue(prim); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Insn.cxx0000644000021000000240000010230107025631171012315 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "VM.h" #include "Insn.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "ELObjMessageArg.h" #include "Expression.h" #include #include "Insn2.h" #include "SosofoObj.h" #include "Node.h" #include "ELObjPropVal.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif VM::VM(Interpreter &interpreter) : Collector::DynamicRoot(interpreter), interp(&interpreter) { init(); } VM::VM(EvalContext &context, Interpreter &interpreter) : EvalContext(context), Collector::DynamicRoot(interpreter), interp(&interpreter) { init(); } void VM::init() { slim = 0; sbase = 0; sp = 0; closure = 0; frame = 0; protectClosure = 0; csp = 0; cslim = 0; csbase = 0; closureLoc.clear(); } VM::~VM() { delete [] sbase; delete [] csbase; } void VM::initStack() { sp = sbase; frame = sbase; csp = csbase; modeStack.resize(0); } void VM::growStack(int n) { size_t newSize = sp - sbase; if (n > newSize) newSize += (n + 15) & ~15; else newSize += newSize; ELObj **newStack = new ELObj *[newSize]; slim = newStack + newSize; memcpy(newStack, sbase, (sp - sbase)*sizeof(ELObj *)); sp = newStack + (sp - sbase); frame = newStack + (frame - sbase); if (sbase) delete [] sbase; sbase = newStack; } void VM::trace(Collector &c) const { if (sp) { for (ELObj **p = sbase; p != sp; p++) c.trace(*p); } for (ControlStackEntry *p = csbase; p != csp; p++) { c.trace(p->protectClosure); c.trace(p->continuation); } c.trace(protectClosure); } void VM::pushFrame(const Insn *next, int argsPushed) { if (csp >= cslim) { size_t newSize = csbase ? (cslim - csbase)*2 : 8; ControlStackEntry *newBase = new ControlStackEntry[newSize]; cslim = newBase + newSize; ControlStackEntry *newP = newBase; for (const ControlStackEntry *oldP = csbase; oldP < csp; oldP++) *newP++ = *oldP; csp = newP; if (csbase) delete [] csbase; csbase = newBase; } csp->closure = closure; csp->protectClosure = protectClosure; csp->next = next; csp->frameSize = sp - frame - argsPushed; csp->closureLoc = closureLoc; csp->continuation = 0; csp++; } const Insn *VM::popFrame() { ASSERT(csp > csbase); --csp; if (csp->continuation) csp->continuation->kill(); closure = csp->closure; protectClosure = csp->protectClosure; frame = sp - csp->frameSize; closureLoc = csp->closureLoc; return csp->next; } void VM::setClosureArgToCC() { ASSERT(nActualArgs == 1); ContinuationObj *cc = (ContinuationObj *)sp[-1]; csp[-1].continuation = cc; cc->set(sp - sbase, csp - csbase); } ELObj *VM::eval(const Insn *insn, ELObj **display, ELObj *arg) { initStack(); if (arg) { needStack(1); *sp++ = arg; } closure = display; protectClosure = 0; closureLoc.clear(); // The inner loop. while (insn) insn = insn->execute(*this); ELObj *result; if (sp) { sp--; ASSERT(sp == sbase); ASSERT(csp == csbase); result = *sp; ASSERT(result != 0); } else { if (interp->debugMode()) stackTrace(); result = interp->makeError(); } return result; } void VM::stackTrace() { unsigned long count = 0; if (protectClosure) { interp->setNextLocation(closureLoc); interp->message(InterpreterMessages::stackTrace); count++; } ControlStackEntry *lim = csbase; if (csp != csbase && !csbase->protectClosure) lim++; for (ControlStackEntry *p = csp; p != lim; p--) { interp->setNextLocation(p[-1].closureLoc); count++; if (count == 5 && p - lim > 7) { interp->message(InterpreterMessages::stackTraceEllipsis, NumberMessageArg(p - (lim + 6))); p = lim + 6; } else interp->message(InterpreterMessages::stackTrace); } } Insn::~Insn() { } bool Insn::isReturn(int &) const { return false; } bool Insn::isPopBindings(int &, InsnPtr &) const { return false; } const Insn *ErrorInsn::execute(VM &vm) const { vm.sp = 0; return 0; } CondFailInsn::CondFailInsn(const Location &loc) : loc_(loc) { } const Insn *CondFailInsn::execute(VM &vm) const { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::condFail); return ErrorInsn::execute(vm); } CaseFailInsn::CaseFailInsn(const Location &loc) : loc_(loc) { } const Insn *CaseFailInsn::execute(VM &vm) const { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::caseFail, ELObjMessageArg(vm.sp[-1], *vm.interp)); return ErrorInsn::execute(vm); } ConstantInsn::ConstantInsn(ELObj *obj, InsnPtr next) : value_(obj), next_(next) { } const Insn *ConstantInsn::execute(VM &vm) const { vm.needStack(1); *vm.sp++ = value_; return next_.pointer(); } ResolveQuantitiesInsn::ResolveQuantitiesInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *ResolveQuantitiesInsn::execute(VM &vm) const { ELObj *tem = vm.sp[-1]->resolveQuantities(1, *vm.interp, loc_); ASSERT(tem != 0); if (vm.interp->isError(tem)) { vm.sp = 0; return 0; } vm.sp[-1] = tem; return next_.pointer(); } TestInsn::TestInsn(InsnPtr consequent, InsnPtr alternative) : consequent_(consequent), alternative_(alternative) { } const Insn *TestInsn::execute(VM &vm) const { return (*--vm.sp)->isTrue() ? consequent_.pointer() : alternative_.pointer(); } OrInsn::OrInsn(InsnPtr nextTest, InsnPtr next) : nextTest_(nextTest), next_(next) { } const Insn *OrInsn::execute(VM &vm) const { if (vm.sp[-1]->isTrue()) return next_.pointer(); --vm.sp; return nextTest_.pointer(); } AndInsn::AndInsn(InsnPtr nextTest, InsnPtr next) : nextTest_(nextTest), next_(next) { } const Insn *AndInsn::execute(VM &vm) const { if (!vm.sp[-1]->isTrue()) return next_.pointer(); --vm.sp; return nextTest_.pointer(); } CaseInsn::CaseInsn(ELObj *obj, InsnPtr match, InsnPtr fail) : obj_(obj), match_(match), fail_(fail) { } const Insn *CaseInsn::execute(VM &vm) const { if (ELObj::eqv(*vm.sp[-1], *obj_)) { --vm.sp; return match_.pointer(); } return fail_.pointer(); } PopInsn::PopInsn(InsnPtr next) : next_(next) { } const Insn *PopInsn::execute(VM &vm) const { --vm.sp; return next_.pointer(); } ConsInsn::ConsInsn(InsnPtr next) : next_(next) { } const Insn *ConsInsn::execute(VM &vm) const { vm.sp[-2] = vm.interp->makePair(vm.sp[-1], vm.sp[-2]); --vm.sp; return next_.pointer(); } AppendInsn:: AppendInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *AppendInsn::execute(VM &vm) const { ELObj *&source = vm.sp[-1]; if (!source->isNil()) { PairObj *pair = source->asPair(); if (!pair) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::spliceNotList); vm.sp = 0; return 0; } source = pair->cdr(); PairObj *tail = vm.interp->makePair(pair->car(), 0); ELObjDynamicRoot head(*vm.interp, tail); while (!source->isNil()) { pair = source->asPair(); if (!pair) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::spliceNotList); vm.sp = 0; return 0; } PairObj *newTail = vm.interp->makePair(pair->car(), 0); tail->setCdr(newTail); tail = newTail; source = pair->cdr(); } tail->setCdr(vm.sp[-2]); vm.sp[-2] = head; } --vm.sp; return next_.pointer(); } ApplyBaseInsn::ApplyBaseInsn(int nArgs, const Location &loc) : nArgs_(nArgs), loc_(loc) { } ApplyInsn::ApplyInsn(int nArgs, const Location &loc, InsnPtr next) : ApplyBaseInsn(nArgs, loc), next_(next) { } TailApplyInsn::TailApplyInsn(int nCallerArgs, int nArgs, const Location &loc) : ApplyBaseInsn(nArgs, loc), nCallerArgs_(nCallerArgs) { } // top of stack is operand; next down is last operand and so on FunctionObj *ApplyBaseInsn::decodeArgs(VM &vm) const { FunctionObj *func = (*--vm.sp)->asFunction(); if (!func) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::callNonFunction, ELObjMessageArg(*vm.sp, *vm.interp)); vm.sp = 0; return 0; } int nReq = func->nRequiredArgs(); if (nArgs_ < nReq) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::missingArg); vm.sp = 0; return 0; } if (nArgs_ - nReq > func->nOptionalArgs()) { if (func->nKeyArgs()) { // Keyword args can be specified more than once // so we can only check there are an even number. if ((nArgs_ - nReq - func->nOptionalArgs()) & 1) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::oddKeyArgs); vm.sp -= (nArgs_ - nReq) - func->nOptionalArgs(); } } else if (!func->restArg()) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::tooManyArgs); vm.sp -= (nArgs_ - nReq) - func->nOptionalArgs(); } } return func; } const Insn *ApplyInsn::execute(VM &vm) const { FunctionObj *func = decodeArgs(vm); vm.nActualArgs = nArgs_; if (func) return func->call(vm, loc_, next_.pointer()); else return 0; } const Insn *TailApplyInsn::execute(VM &vm) const { FunctionObj *func = decodeArgs(vm); vm.nActualArgs = nArgs_; if (func) return func->tailCall(vm, loc_, nCallerArgs_); else return 0; } ApplyPrimitiveObj::ApplyPrimitiveObj() : FunctionObj(&signature_) { } const Signature ApplyPrimitiveObj::signature_ = { 2, 0, 1 }; const Insn *ApplyPrimitiveObj::call(VM &vm, const Location &loc, const Insn *next) { if (!shuffle(vm, loc)) return 0; ApplyInsn insn(vm.nActualArgs, loc, (Insn *)next); return insn.execute(vm); } bool ApplyPrimitiveObj::shuffle(VM &vm, const Location &loc) { int nArgs = vm.nActualArgs; ELObj *func = vm.sp[-nArgs]; for (int i = nArgs - 2; i > 0; i--) vm.sp[-i - 2] = vm.sp[-i - 1]; vm.nActualArgs = nArgs - 2; ELObj *list = *--vm.sp; --vm.sp; while (!list->isNil()) { PairObj *tem = list->asPair(); if (!tem) { vm.interp->setNextLocation(loc); vm.interp->message(InterpreterMessages::notAList, StringMessageArg(vm.interp->makeStringC("apply")), OrdinalMessageArg(nArgs), ELObjMessageArg(list, *vm.interp)); vm.sp = 0; return 0; } vm.needStack(1); vm.nActualArgs++; *vm.sp++ = tem->car(); list = tem->cdr(); } vm.needStack(1); *vm.sp++ = func; return 1; } const Insn *ApplyPrimitiveObj::tailCall(VM &vm, const Location &loc, int nCallerArgs) { if (!shuffle(vm, loc)) return 0; TailApplyInsn insn(nCallerArgs, vm.nActualArgs, loc); return insn.execute(vm); } PrimitiveCallInsn::PrimitiveCallInsn(int nArgs, PrimitiveObj *prim, const Location &loc, InsnPtr next) : nArgs_(nArgs), prim_(prim), loc_(loc), next_(next) { } const Insn *PrimitiveCallInsn::execute(VM &vm) const { if (nArgs_ == 0) vm.needStack(1); ELObj **argp = vm.sp - nArgs_; *argp = prim_->primitiveCall(nArgs_, argp, vm, *vm.interp, loc_); ASSERT(vm.interp->objectMaybeLive(*argp)); vm.sp = argp + 1; if (vm.interp->isError(*argp)) { vm.sp = 0; return 0; } else return next_.pointer(); } InsnPtr FunctionObj::makeCallInsn(int nArgs, Interpreter &, const Location &loc, InsnPtr next) { return new FunctionCallInsn(nArgs, this, loc, next); } InsnPtr FunctionObj::makeTailCallInsn(int nArgs, Interpreter &, const Location &loc, int nCallerArgs) { return new FunctionTailCallInsn(nArgs, this, loc, nCallerArgs); } FunctionObj *FunctionObj::asFunction() { return this; } void FunctionObj::setArgToCC(VM &) { } const Insn *PrimitiveObj::call(VM &vm, const Location &loc, const Insn *next) { if (vm.nActualArgs == 0) vm.needStack(1); ELObj **argp = vm.sp - vm.nActualArgs; *argp = primitiveCall(vm.nActualArgs, argp, vm, *vm.interp, loc); vm.sp = argp + 1; if (vm.interp->isError(*argp)) { vm.sp = 0; return 0; } else return next; } const Insn *PrimitiveObj::tailCall(VM &vm, const Location &loc, int nCallerArgs) { ELObj **argp = vm.sp - vm.nActualArgs; ELObj *result = primitiveCall(vm.nActualArgs, argp, vm, *vm.interp, loc); if (vm.interp->isError(result)) { vm.sp = 0; return 0; } else { vm.sp = argp - nCallerArgs; const Insn *next = vm.popFrame(); vm.needStack(1); *vm.sp++ = result; return next; } } InsnPtr PrimitiveObj::makeCallInsn(int nArgs, Interpreter &interp, const Location &loc, InsnPtr next) { return new PrimitiveCallInsn(nArgs, this, loc, next); } ELObj *PrimitiveObj::argError(Interpreter &interp, const Location &loc, const MessageType3 &msg, unsigned index, ELObj *obj) const { NodeListObj *nl = obj->asNodeList(); if (!nl || !nl->suppressError()) { interp.setNextLocation(loc); interp.message(msg, StringMessageArg(ident_->name()), OrdinalMessageArg(index + 1), ELObjMessageArg(obj, interp)); } return interp.makeError(); } ELObj *PrimitiveObj::noCurrentNodeError(Interpreter &interp, const Location &loc) const { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentNode); return interp.makeError(); } ClosureInsn::ClosureInsn(const Signature *sig, InsnPtr code, int displayLength, InsnPtr next) : sig_(sig), code_(code), displayLength_(displayLength), next_(next) { } const Insn *ClosureInsn::execute(VM &vm) const { ELObj **display = displayLength_ ? new ELObj *[displayLength_ + 1] : 0; ELObj **tem = vm.sp - displayLength_; for (int i = 0; i < displayLength_; i++) display[i] = tem[i]; if (displayLength_ == 0) { vm.needStack(1); tem = vm.sp; } else display[displayLength_] = 0; // Make sure objects in display are still visible on the stack // to the garbage collector. *tem++ = new (*vm.interp) ClosureObj(sig_, code_, display); vm.sp = tem; return next_.pointer(); } FunctionCallInsn:: FunctionCallInsn(int nArgs, FunctionObj *function, const Location &loc, InsnPtr next) : nArgs_(nArgs), function_(function), loc_(loc), next_(next) { } const Insn *FunctionCallInsn::execute(VM &vm) const { vm.nActualArgs = nArgs_; return function_->call(vm, loc_, next_.pointer()); } FunctionTailCallInsn:: FunctionTailCallInsn(int nArgs, FunctionObj *function, const Location &loc, int nCallerArgs) : nArgs_(nArgs), function_(function), loc_(loc), nCallerArgs_(nCallerArgs) { } const Insn *FunctionTailCallInsn::execute(VM &vm) const { vm.nActualArgs = nArgs_; return function_->tailCall(vm, loc_, nCallerArgs_); } TestNullInsn::TestNullInsn(int offset, InsnPtr ifNull, InsnPtr ifNotNull) : offset_(offset), ifNull_(ifNull), ifNotNull_(ifNotNull) { } const Insn *TestNullInsn::execute(VM &vm) const { if (vm.sp[offset_] == 0) return ifNull_.pointer(); else return ifNotNull_.pointer(); } VarargsInsn::VarargsInsn(const Signature &sig, Vector &entryPoints, const Location &loc) : sig_(&sig), loc_(loc) { entryPoints.swap(entryPoints_); } const Insn *VarargsInsn::execute(VM &vm) const { int n = vm.nActualArgs - sig_->nRequiredArgs; if ((sig_->restArg || sig_->nKeyArgs) && n > entryPoints_.size() - 2) { // cons up the rest args ELObjDynamicRoot protect(*vm.interp, vm.interp->makeNil()); for (int i = n - (entryPoints_.size() - 2); i > 0; i--) { protect = new (*vm.interp) PairObj(vm.sp[-1], protect); --vm.sp; } vm.needStack(sig_->nKeyArgs + sig_->restArg); if (sig_->restArg) *vm.sp++ = protect; if (sig_->nKeyArgs) { for (int i = 0; i < sig_->nKeyArgs; i++) vm.sp[i] = 0; ELObj *tem = protect; for (int i = n - (entryPoints_.size() - 2); i > 0; i -= 2) { KeywordObj *k = ((PairObj *)tem)->car()->asKeyword(); tem = ((PairObj *)tem)->cdr(); if (k) { for (int j = 0; j < sig_->nKeyArgs; j++) if (sig_->keys[j] == k->identifier()) { if (vm.sp[j] == 0) vm.sp[j] = ((PairObj *)tem)->car(); k = 0; break; } if (k && !sig_->restArg) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::invalidKeyArg, StringMessageArg(k->identifier()->name())); } } else { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::keyArgsNotKey); } tem = ((PairObj *)tem)->cdr(); } vm.sp += sig_->nKeyArgs; } return entryPoints_.back().pointer(); } return entryPoints_[n].pointer(); } SetKeyArgInsn::SetKeyArgInsn(int offset, InsnPtr next) : offset_(offset), next_(next) { } const Insn *SetKeyArgInsn::execute(VM &vm) const { ELObj *val = *--vm.sp; vm.sp[offset_] = val; return next_.pointer(); } ClosureObj::ClosureObj(const Signature *sig, InsnPtr code, ELObj **display) : FunctionObj(sig), code_(code), display_(display) { hasSubObjects_ = 1; } const Insn *ClosureObj::call(VM &vm, const Location &loc, const Insn *next) { vm.needStack(1); vm.pushFrame(next, vm.nActualArgs); vm.frame = vm.sp - vm.nActualArgs; vm.closure = display_; vm.protectClosure = this; vm.closureLoc = loc; return code_.pointer(); } const Insn *ClosureObj::tailCall(VM &vm, const Location &loc, int nCallerArgs) { vm.needStack(1); int nArgs = vm.nActualArgs; if (nCallerArgs) { ELObj **oldFrame = vm.sp - nArgs; ELObj **newFrame = oldFrame - nCallerArgs; for (int i = 0; i < nArgs; i++) newFrame[i] = oldFrame[i]; vm.frame = newFrame; vm.sp = newFrame + nArgs; } else vm.frame = vm.sp - nArgs; vm.closure = display_; vm.protectClosure = this; vm.closureLoc = loc; return code_.pointer(); } void ClosureObj::setArgToCC(VM &vm) { vm.setClosureArgToCC(); } void ClosureObj::traceSubObjects(Collector &c) const { if (display_) { for (ELObj **p = display_; *p; p++) c.trace(*p); } } const Signature ContinuationObj::signature_ = { 1, 0, 0 }; ContinuationObj::ContinuationObj() : FunctionObj(&signature_), controlStackSize_(0) { } const Insn *ContinuationObj::call(VM &vm, const Location &loc, const Insn *) { if (!live() || readOnly()) { vm.interp->setNextLocation(loc); vm.interp->message(InterpreterMessages::continuationDead); vm.sp = 0; return 0; } ELObj *result = vm.sp[-1]; ASSERT(vm.sp - vm.sbase >= stackSize_); ASSERT(vm.csp - vm.csbase >= controlStackSize_); ASSERT(vm.csbase[controlStackSize_ - 1].continuation == this); while (vm.csp - vm.csbase > controlStackSize_) { vm.csp--; if (vm.csp->continuation) vm.csp->continuation->kill(); } vm.sp = vm.sbase + stackSize_; --vm.sp; const Insn *next = vm.popFrame(); *vm.sp++ = result; return next; } const Insn *ContinuationObj::tailCall(VM &vm, const Location &loc, int nCallerArgs) { return call(vm, loc, 0); } ReturnInsn::ReturnInsn(int totalArgs) : totalArgs_(totalArgs) { } bool ReturnInsn::isReturn(int &nArgs) const { nArgs = totalArgs_; return true; } const Insn *ReturnInsn::execute(VM &vm) const { ELObj *result = *--vm.sp; vm.sp -= totalArgs_; const Insn *next = vm.popFrame(); *vm.sp++ = result; return next; } FrameRefInsn::FrameRefInsn(int index, InsnPtr next) : index_(index), next_(next) { } const Insn *FrameRefInsn::execute(VM &vm) const { vm.needStack(1); *vm.sp++ = vm.frame[index_]; return next_.pointer(); } StackRefInsn::StackRefInsn(int index, int frameIndex, InsnPtr next) : index_(index), frameIndex_(frameIndex), next_(next) { } const Insn *StackRefInsn::execute(VM &vm) const { vm.needStack(1); ASSERT(vm.sp - vm.frame == frameIndex_ - index_); *vm.sp = vm.sp[index_]; vm.sp += 1; return next_.pointer(); } ClosureRefInsn::ClosureRefInsn(int index, InsnPtr next) : index_(index), next_(next) { } const Insn *ClosureRefInsn::execute(VM &vm) const { vm.needStack(1); *vm.sp++ = vm.closure[index_]; return next_.pointer(); } TopRefInsn::TopRefInsn(const Identifier *var, InsnPtr next) : var_(var), next_(next) { } const Insn *TopRefInsn::execute(VM &vm) const { ELObj *tem = var_->computeValue(1, *vm.interp); if (vm.interp->isError(tem)) { vm.sp = 0; return 0; } else { vm.needStack(1); *vm.sp++ = tem; return next_.pointer(); } } ClosureSetBoxInsn::ClosureSetBoxInsn(int index, const Location &loc, InsnPtr next) : index_(index), loc_(loc), next_(next) { } const Insn *ClosureSetBoxInsn::execute(VM &vm) const { BoxObj *box = vm.closure[index_]->asBox(); ASSERT(box != 0); if (box->readOnly()) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::readOnly); vm.sp = 0; return 0; } ELObj *tem = box->value; box->value = vm.sp[-1]; vm.sp[-1] = tem; return next_.pointer(); } StackSetBoxInsn::StackSetBoxInsn(int index, int frameIndex, const Location &loc, InsnPtr next) : index_(index), frameIndex_(frameIndex), loc_(loc), next_(next) { } const Insn *StackSetBoxInsn::execute(VM &vm) const { ASSERT(vm.sp - vm.frame == frameIndex_ - index_); BoxObj *box = vm.sp[index_]->asBox(); ASSERT(box != 0); if (box->readOnly()) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::readOnly); vm.sp = 0; return 0; } ELObj *tem = box->value; box->value = vm.sp[-1]; vm.sp[-1] = tem; return next_.pointer(); } StackSetInsn::StackSetInsn(int index, int frameIndex, InsnPtr next) : index_(index), frameIndex_(frameIndex), next_(next) { } const Insn *StackSetInsn::execute(VM &vm) const { ASSERT(vm.sp - vm.frame == frameIndex_ - index_); ELObj *tem = vm.sp[index_]; vm.sp[index_] = vm.sp[-1]; vm.sp[-1] = tem; return next_.pointer(); } InsnPtr PopBindingsInsn::make(int n, InsnPtr next) { if (!next.isNull()) { int i; if (next->isReturn(i)) return new ReturnInsn(n + i); if (next->isPopBindings(i, next)) return new PopBindingsInsn(n + i, next); } return new PopBindingsInsn(n, next); } PopBindingsInsn::PopBindingsInsn(int n, InsnPtr next) : n_(n), next_(next) { } const Insn *PopBindingsInsn::execute(VM &vm) const { vm.sp -= n_; vm.sp[-1] = vm.sp[n_ - 1]; return next_.pointer(); } bool PopBindingsInsn::isPopBindings(int &n, InsnPtr &next) const { n = n_; next = next_; return true; } SetBoxInsn::SetBoxInsn(int n, InsnPtr next) : n_(n), next_(next) { } const Insn *SetBoxInsn::execute(VM &vm) const { --vm.sp; BoxObj *box = vm.sp[-n_]->asBox(); ASSERT(box != 0); box->value = *vm.sp; return next_.pointer(); } SetImmediateInsn::SetImmediateInsn(int n, InsnPtr next) : n_(n), next_(next) { } const Insn *SetImmediateInsn::execute(VM &vm) const { --vm.sp; vm.sp[-n_] = *vm.sp; return next_.pointer(); } CheckInitInsn::CheckInitInsn(const Identifier *ident, const Location &loc, InsnPtr next) : ident_(ident), loc_(loc), next_(next) { } const Insn *CheckInitInsn::execute(VM &vm) const { if (vm.sp[-1] == 0) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::uninitializedVariableReference, StringMessageArg(ident_->name())); vm.sp = 0; return 0; } return next_.pointer(); } UnboxInsn::UnboxInsn(InsnPtr next) : next_(next) { } const Insn *UnboxInsn::execute(VM &vm) const { BoxObj *box = vm.sp[-1]->asBox(); ASSERT(box != 0); vm.sp[-1] = box->value; return next_.pointer(); } BoxInsn::BoxInsn(InsnPtr next) : next_(next) { } const Insn *BoxInsn::execute(VM &vm) const { vm.sp[-1] = new (*vm.interp) BoxObj(vm.sp[-1]); return next_.pointer(); } BoxArgInsn::BoxArgInsn(int n, InsnPtr next) : n_(n), next_(next) { } const Insn *BoxArgInsn::execute(VM &vm) const { ELObj *&arg = vm.sp[n_ - vm.nActualArgs]; arg = new (*vm.interp) BoxObj(arg); return next_.pointer(); } BoxStackInsn::BoxStackInsn(int n, InsnPtr next) : n_(n), next_(next) { } const Insn *BoxStackInsn::execute(VM &vm) const { vm.sp[n_] = new (*vm.interp) BoxObj(vm.sp[n_]); return next_.pointer(); } VectorInsn::VectorInsn(size_t n, InsnPtr next) : n_(n), next_(next) { } const Insn *VectorInsn::execute(VM &vm) const { if (n_ == 0) { vm.needStack(1); *vm.sp++ = new (*vm.interp) VectorObj; } else { Vector v(n_); ELObj **p = vm.sp; for (size_t n = n_; n > 0; n--) v[n - 1] = *--p; *p = new (*vm.interp) VectorObj(v); vm.sp = p + 1; } return next_.pointer(); } ListToVectorInsn::ListToVectorInsn(InsnPtr next) : next_(next) { } const Insn *ListToVectorInsn::execute(VM &vm) const { Vector v; ELObj *obj = vm.sp[-1]; while (!obj->isNil()) { PairObj *pair = obj->asPair(); ASSERT(pair != 0); v.push_back(pair->car()); obj = pair->cdr(); } vm.sp[-1] = new (*vm.interp) VectorObj(v); return next_.pointer(); } const Insn *CheckSosofoInsn::execute(VM &vm) const { if (!vm.sp[-1]->asSosofo()) { vm.sp = 0; vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::sosofoContext); return 0; } return next_.pointer(); } const Insn *CheckStyleInsn::execute(VM &vm) const { if (!vm.sp[-1]->asStyle()) { vm.sp = 0; vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::styleContext); return 0; } return next_.pointer(); } const Insn *PushModeInsn::execute(VM &vm) const { vm.modeStack.push_back(vm.processingMode); vm.processingMode = mode_; return next_.pointer(); } const Insn *PopModeInsn::execute(VM &vm) const { vm.processingMode = vm.modeStack.back(); vm.modeStack.resize(vm.modeStack.size() - 1); return next_.pointer(); } MaybeOverrideStyleInsn::MaybeOverrideStyleInsn(InsnPtr next) : next_(next) { } const Insn *MaybeOverrideStyleInsn::execute(VM &vm) const { if (vm.overridingStyle) vm.sp[-1] = new (*vm.interp) OverriddenStyleObj((BasicStyleObj *)vm.sp[-1], vm.overridingStyle); return next_.pointer(); } VarStyleInsn::VarStyleInsn(const ConstPtr &styleSpec, unsigned displayLength, bool hasUse, InsnPtr next) : styleSpec_(styleSpec), displayLength_(displayLength), hasUse_(hasUse), next_(next) { } const Insn *VarStyleInsn::execute(VM &vm) const { ELObj **display = displayLength_ ? new ELObj *[displayLength_ + 1] : 0; ELObj **tem = vm.sp - displayLength_; for (int i = 0; i < displayLength_; i++) display[i] = tem[i]; if (displayLength_ == 0) { vm.needStack(1); tem = vm.sp; } else display[displayLength_] = 0; // Make sure objects in display are still visible on the stack // to the garbage collector. StyleObj *use; if (hasUse_) use = (StyleObj *)*--tem; else use = 0; *tem++ = new (*vm.interp) VarStyleObj(styleSpec_, use, display, vm.currentNode); vm.sp = tem; vm.interp->makeReadOnly(tem[-1]); return next_.pointer(); } SetStyleInsn::SetStyleInsn(InsnPtr next) : next_(next) { } const Insn *SetStyleInsn::execute(VM &vm) const { ((FlowObj *)vm.sp[-2])->setStyle((StyleObj *)vm.sp[-1]); vm.sp--; return next_.pointer(); } SosofoAppendInsn::SosofoAppendInsn(size_t n, InsnPtr next) : n_(n), next_(next) { } const Insn *SosofoAppendInsn::execute(VM &vm) const { AppendSosofoObj *obj = new (*vm.interp) AppendSosofoObj; ELObj **tem = vm.sp - n_; for (size_t i = 0; i < n_; i++) { ASSERT(tem[i]->asSosofo() != 0); obj->append((SosofoObj *)tem[i]); } vm.sp -= n_ - 1; vm.sp[-1] = obj; return next_.pointer(); } CopyFlowObjInsn::CopyFlowObjInsn(FlowObj *flowObj, const Location &loc, InsnPtr next) : flowObj_(flowObj), next_(next), loc_(loc) { } const Insn *CopyFlowObjInsn::execute(VM &vm) const { vm.needStack(1); *vm.sp++ = flowObj_->copy(*vm.interp); ((FlowObj *)vm.sp[-1])->setLocation(loc_); return next_.pointer(); } SetNonInheritedCsSosofoInsn ::SetNonInheritedCsSosofoInsn(InsnPtr code, int displayLength, InsnPtr next) : code_(code), displayLength_(displayLength), next_(next) { } const Insn *SetNonInheritedCsSosofoInsn::execute(VM &vm) const { ELObj **display = displayLength_ ? new ELObj *[displayLength_ + 1] : 0; ELObj **tem = vm.sp - displayLength_; for (int i = 0; i < displayLength_; i++) { display[i] = tem[i]; ASSERT(display[i] != 0); } if (displayLength_) display[displayLength_] = 0; // Make sure objects in display are still visible on the stack // to the garbage collector. FlowObj *flowObj = (FlowObj *)*--tem; ASSERT((*tem)->asSosofo() != 0); *tem++ = new (*vm.interp) SetNonInheritedCsSosofoObj(flowObj, code_, display, vm.currentNode); vm.sp = tem; return next_.pointer(); } SetPseudoNonInheritedCInsn::SetPseudoNonInheritedCInsn(const Identifier *nic, const Location &loc, InsnPtr next) : nic_(nic), loc_(loc), next_(next) { } const Insn *SetPseudoNonInheritedCInsn::execute(VM &vm) const { ASSERT(vm.sp[-2]->asSosofo() != 0); ((FlowObj *)vm.sp[-2])->setNonInheritedC(nic_, vm.sp[-1], loc_, *vm.interp); vm.sp--; return next_.pointer(); } SetNonInheritedCInsn::SetNonInheritedCInsn(const Identifier *nic, const Location &loc, InsnPtr next) : SetPseudoNonInheritedCInsn(nic, loc, next) { } const Insn *SetNonInheritedCInsn::execute(VM &vm) const { vm.actualDependencies->resize(0); return SetPseudoNonInheritedCInsn::execute(vm); } SetImplicitCharInsn::SetImplicitCharInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *SetImplicitCharInsn::execute(VM &vm) const { ASSERT(vm.sp[-1]->asSosofo() != 0); Char *cp(0); if (vm.currentNode) { Char ch; AccessResult ret = vm.currentNode->getChar(*vm.interp, ch); if (ret == accessOK) ((FlowObj *)vm.sp[-1])->setImplicitChar(ch); } return next_.pointer(); } SetContentInsn::SetContentInsn(const CompoundFlowObj *flowObj, const Location &loc, InsnPtr next) : flowObj_(flowObj), next_(next), loc_(loc) { } const Insn *SetContentInsn::execute(VM &vm) const { CompoundFlowObj *copy = (CompoundFlowObj *)flowObj_->copy(*vm.interp); copy->setContent((SosofoObj *)vm.sp[-1]); copy->setLocation(loc_); vm.sp[-1] = copy; return next_.pointer(); } SetDefaultContentInsn::SetDefaultContentInsn(const CompoundFlowObj *flowObj, const Location &loc, InsnPtr next) : flowObj_(flowObj), next_(next), loc_(loc) { } const Insn *SetDefaultContentInsn::execute(VM &vm) const { if (!vm.processingMode) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::noCurrentProcessingMode); vm.sp = 0; return 0; } vm.needStack(1); *vm.sp++ = flowObj_->copy(*vm.interp); ((CompoundFlowObj *)vm.sp[-1]) ->setContent(new (*vm.interp) ProcessChildrenSosofoObj(vm.processingMode, loc_)); ((FlowObj *)vm.sp[-1])->setLocation(loc_); return next_.pointer(); } MakeDefaultContentInsn::MakeDefaultContentInsn(const Location &loc, InsnPtr next) : next_(next), loc_(loc) { } const Insn *MakeDefaultContentInsn::execute(VM &vm) const { if (!vm.processingMode) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::noCurrentProcessingMode); vm.sp = 0; return 0; } vm.needStack(1); *vm.sp++ = new (*vm.interp) ProcessChildrenSosofoObj(vm.processingMode, loc_); return next_.pointer(); } LabelSosofoInsn::LabelSosofoInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *LabelSosofoInsn::execute(VM &vm) const { SymbolObj *sym = vm.sp[-1]->asSymbol(); if (!sym) { vm.interp->setNextLocation(loc_); vm.interp->message(InterpreterMessages::labelNotASymbol); vm.sp = 0; return 0; } ASSERT(vm.sp[-2]->asSosofo() != 0); vm.sp[-2] = new (*vm.interp) LabelSosofoObj(sym, loc_, (SosofoObj *)vm.sp[-2]); vm.sp--; return next_.pointer(); } ContentMapSosofoInsn::ContentMapSosofoInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *ContentMapSosofoInsn::execute(VM &vm) const { ASSERT(vm.sp[-2]->asSosofo() != 0); vm.sp[-2] = new (*vm.interp) ContentMapSosofoObj(vm.sp[-1], &loc_, (SosofoObj *)vm.sp[-2]); vm.sp--; return next_.pointer(); } BoxObj::BoxObj() : value(0) { hasSubObjects_ = 1; } BoxObj::BoxObj(ELObj *obj) : value(obj) { hasSubObjects_ = 1; } BoxObj *BoxObj::asBox() { return this; } void BoxObj::traceSubObjects(Collector &c) const { c.trace(value); } CallWithCurrentContinuationPrimitiveObj::CallWithCurrentContinuationPrimitiveObj() : FunctionObj(&signature_) { } const Insn *CallWithCurrentContinuationPrimitiveObj::call(VM &vm, const Location &loc, const Insn *next) { FunctionObj *f = vm.sp[-1]->asFunction(); if (!f) { vm.interp->setNextLocation(loc); vm.interp->message(InterpreterMessages::notAProcedure, StringMessageArg(Interpreter::makeStringC("call-with-current-continuation")), OrdinalMessageArg(1), ELObjMessageArg(vm.sp[-1], *vm.interp)); vm.sp = 0; return 0; } ELObjDynamicRoot protect(*vm.interp, f); vm.sp[-1] = new (*vm.interp) ContinuationObj; const Insn *insn = f->call(vm, loc, next); f->setArgToCC(vm); return insn; } const Insn *CallWithCurrentContinuationPrimitiveObj::tailCall(VM &vm, const Location &loc, int nCallerArgs) { FunctionObj *f = vm.sp[-1]->asFunction(); if (!f) { vm.interp->setNextLocation(loc); vm.interp->message(InterpreterMessages::notAProcedure, StringMessageArg(Interpreter::makeStringC("call-with-current-continuation")), OrdinalMessageArg(1), ELObjMessageArg(vm.sp[-1], *vm.interp)); vm.sp = 0; return 0; } ELObjDynamicRoot protect(*vm.interp, f); vm.sp[-1] = new (*vm.interp) ContinuationObj; const Insn *insn = f->tailCall(vm, loc, nCallerArgs); f->setArgToCC(vm); return insn; } const Signature CallWithCurrentContinuationPrimitiveObj::signature_ = { 1, 0, 0 }; #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Insn.h0000644000021000000240000002756207025631171011761 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Insn_INCLUDED #define Insn_INCLUDED 1 #include "ELObj.h" #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class VM; class EvalContext; class Interpreter; class Insn : public Resource { public: virtual ~Insn(); virtual const Insn *execute(VM &) const = 0; virtual bool isReturn(int &nArgs) const; virtual bool isPopBindings(int &n, ConstPtr &) const; }; typedef ConstPtr InsnPtr; class ErrorInsn : public Insn { public: const Insn *execute(VM &) const; }; class CondFailInsn : public ErrorInsn { public: CondFailInsn(const Location &loc); const Insn *execute(VM &) const; private: Location loc_; }; class CaseFailInsn : public ErrorInsn { public: CaseFailInsn(const Location &loc); const Insn *execute(VM &) const; private: Location loc_; }; class ConstantInsn : public Insn { public: ConstantInsn(ELObj *, InsnPtr); const Insn *execute(VM &) const; private: ELObj *value_; InsnPtr next_; }; class ResolveQuantitiesInsn : public Insn { public: ResolveQuantitiesInsn(const Location &, InsnPtr); const Insn *execute(VM &) const; private: Location loc_; InsnPtr next_; }; class TestInsn : public Insn { public: TestInsn(InsnPtr, InsnPtr); const Insn *execute(VM &) const; private: InsnPtr consequent_; InsnPtr alternative_; }; class OrInsn : public Insn { public: OrInsn(InsnPtr nextTest, InsnPtr next); const Insn *execute(VM &) const; private: InsnPtr nextTest_; InsnPtr next_; }; class AndInsn : public Insn { public: AndInsn(InsnPtr nextTest, InsnPtr next); const Insn *execute(VM &) const; private: InsnPtr nextTest_; InsnPtr next_; }; class CaseInsn : public Insn { public: CaseInsn(ELObj *, InsnPtr match, InsnPtr fail); const Insn *execute(VM &) const; private: ELObj *obj_; InsnPtr match_; InsnPtr fail_; }; class PopInsn : public Insn { public: PopInsn(InsnPtr next); const Insn *execute(VM &) const; private: InsnPtr next_; }; class ConsInsn : public Insn { public: ConsInsn(InsnPtr next); const Insn *execute(VM &) const; private: InsnPtr next_; }; class AppendInsn : public Insn { public: AppendInsn(const Location &, InsnPtr next); const Insn *execute(VM &) const; private: Location loc_; InsnPtr next_; }; class ApplyBaseInsn : public Insn { public: ApplyBaseInsn(int nArgs, const Location &); protected: FunctionObj *decodeArgs(VM &) const; Location loc_; int nArgs_; }; class ApplyInsn : public ApplyBaseInsn { public: ApplyInsn(int nArgs, const Location &, InsnPtr); const Insn *execute(VM &) const; private: InsnPtr next_; }; class TailApplyInsn : public ApplyBaseInsn { public: TailApplyInsn(int nCallerArgs, int nArgs, const Location &); const Insn *execute(VM &) const; private: int nCallerArgs_; }; class FrameRefInsn : public Insn { public: FrameRefInsn(int index, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; InsnPtr next_; }; class StackRefInsn : public Insn { public: StackRefInsn(int index, int frameIndex, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; // always negative int frameIndex_; InsnPtr next_; }; class ClosureRefInsn : public Insn { public: ClosureRefInsn(int index, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; InsnPtr next_; }; class StackSetBoxInsn : public Insn { public: StackSetBoxInsn(int index, int frameIndex, const Location &loc, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; // always negative int frameIndex_; Location loc_; InsnPtr next_; }; class StackSetInsn : public Insn { public: StackSetInsn(int index, int frameIndex, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; // always negative int frameIndex_; InsnPtr next_; }; class ClosureSetBoxInsn : public Insn { public: ClosureSetBoxInsn(int index, const Location &loc, InsnPtr next); const Insn *execute(VM &vm) const; private: int index_; Location loc_; InsnPtr next_; }; class TopRefInsn : public Insn { public: TopRefInsn(const Identifier *var, InsnPtr next); const Insn *execute(VM &vm) const; private: const Identifier *var_; InsnPtr next_; Location loc_; }; class PopBindingsInsn : public Insn { public: const Insn *execute(VM &vm) const; bool isPopBindings(int &n, InsnPtr &) const; static InsnPtr make(int n, InsnPtr next); private: PopBindingsInsn(int n, InsnPtr next); int n_; InsnPtr next_; }; class PrimitiveObj; class PrimitiveCallInsn : public Insn { public: PrimitiveCallInsn(int nArgs, PrimitiveObj *, const Location &, InsnPtr); const Insn *execute(VM &) const; private: int nArgs_; PrimitiveObj *prim_; Location loc_; InsnPtr next_; }; struct Signature { int nRequiredArgs; int nOptionalArgs; bool restArg; int nKeyArgs; const Identifier *const *keys; }; // This Insn constructs a ClosureObj. class ClosureInsn : public Insn { public: ClosureInsn(const Signature *, InsnPtr code, int displayLength, InsnPtr next); const Insn *execute(VM &) const; private: const Signature *sig_; InsnPtr code_; int displayLength_; InsnPtr next_; }; class ClosureObj; class FunctionCallInsn : public Insn { public: FunctionCallInsn(int nArgs, FunctionObj *, const Location &, InsnPtr); const Insn *execute(VM &) const; private: int nArgs_; FunctionObj *function_; // must be permanent Location loc_; InsnPtr next_; }; class FunctionTailCallInsn : public Insn { public: FunctionTailCallInsn(int nArgs, FunctionObj *, const Location &, int nCallerArgs); const Insn *execute(VM &) const; private: int nArgs_; FunctionObj *function_; // must be permanent Location loc_; int nCallerArgs_; }; class VarargsInsn : public Insn { public: VarargsInsn(const Signature &, Vector &entryPoints, const Location &); const Insn *execute(VM &) const; private: const Signature *sig_; Vector entryPoints_; Location loc_; }; class SetKeyArgInsn : public Insn { public: SetKeyArgInsn(int offset, InsnPtr); const Insn *execute(VM &) const; private: int offset_; InsnPtr next_; }; class TestNullInsn : public Insn { public: TestNullInsn(int offset, InsnPtr ifNull, InsnPtr ifNotNull); const Insn *execute(VM &) const; private: int offset_; InsnPtr ifNull_; InsnPtr ifNotNull_; InsnPtr next_; }; class ReturnInsn : public Insn { public: ReturnInsn(int totalArgs); const Insn *execute(VM &) const; bool isReturn(int &nArgs) const; private: int totalArgs_; }; class FunctionObj : public ELObj { public: FunctionObj(const Signature *sig) : sig_(sig) { } int totalArgs(); int nRequiredArgs(); int nOptionalArgs(); int nKeyArgs(); bool restArg(); virtual const Insn *call(VM &vm, const Location &, const Insn *next) = 0; virtual const Insn *tailCall(VM &vm, const Location &, int nCallerArgs) = 0; virtual InsnPtr makeCallInsn(int nArgs, Interpreter &, const Location &, InsnPtr next); virtual InsnPtr makeTailCallInsn(int nArgs, Interpreter &, const Location &, int nCallerArgs); const Signature &signature() const { return *sig_; } FunctionObj *asFunction(); virtual void setArgToCC(VM &); private: const Signature *sig_; }; class PrimitiveObj : public FunctionObj { public: PrimitiveObj(const Signature *sig) : FunctionObj(sig) { } const Insn *call(VM &vm, const Location &, const Insn *next); const Insn *tailCall(VM &vm, const Location &, int nCallerArgs); InsnPtr makeCallInsn(int nArgs, Interpreter &, const Location &, InsnPtr next); virtual ELObj *primitiveCall(int nArgs, ELObj **args, EvalContext &, Interpreter &, const Location &) = 0; void setIdentifier(const Identifier *ident); protected: ELObj *argError(Interpreter &, const Location &, const MessageType3 &, unsigned, ELObj *) const; ELObj *noCurrentNodeError(Interpreter &, const Location &) const; private: const Identifier *ident_; }; class ApplyPrimitiveObj : public FunctionObj { public: ApplyPrimitiveObj(); const Insn *call(VM &vm, const Location &, const Insn *next); const Insn *tailCall(VM &vm, const Location &, int nCallerArgs); private: bool shuffle(VM &vm, const Location &loc); static const Signature signature_; }; class CallWithCurrentContinuationPrimitiveObj : public FunctionObj { public: CallWithCurrentContinuationPrimitiveObj(); const Insn *call(VM &vm, const Location &, const Insn *next); const Insn *tailCall(VM &vm, const Location &, int nCallerArgs); private: static const Signature signature_; }; class ClosureObj : public FunctionObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ClosureObj(const Signature *, InsnPtr, ELObj **display); ~ClosureObj() { delete [] display_; } ELObj **display(); const Insn *call(VM &, const Location &, const Insn *); const Insn *tailCall(VM &, const Location &, int nCallerArgs); void traceSubObjects(Collector &) const; ELObj *display(int) const; void setArgToCC(VM &); private: InsnPtr code_; // terminated by null pointer. // null if empty. ELObj **display_; }; class ContinuationObj : public FunctionObj { public: ContinuationObj(); const Insn *call(VM &, const Location &, const Insn *); const Insn *tailCall(VM &, const Location &, int nCallerArgs); void set(size_t stackSize, size_t controlStackSize) { stackSize_ = stackSize; controlStackSize_ = controlStackSize; } void kill() { controlStackSize_ = 0; } bool live() const { return controlStackSize_ > 0; } private: size_t stackSize_; size_t controlStackSize_; static const Signature signature_; }; class BoxObj : public ELObj { public: BoxObj(); BoxObj(ELObj *); BoxObj *asBox(); void traceSubObjects(Collector &) const; ELObj *value; }; class SetBoxInsn : public Insn { public: SetBoxInsn(int n, InsnPtr next); const Insn *execute(VM &vm) const; private: int n_; InsnPtr next_; }; class SetImmediateInsn : public Insn { public: SetImmediateInsn(int n, InsnPtr next); const Insn *execute(VM &vm) const; private: int n_; InsnPtr next_; }; class UnboxInsn : public Insn { public: UnboxInsn(InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; }; class CheckInitInsn : public Insn { public: CheckInitInsn(const Identifier *ident, const Location &, InsnPtr next); const Insn *execute(VM &vm) const; private: const Identifier *ident_; Location loc_; InsnPtr next_; }; class BoxInsn : public Insn { public: BoxInsn(InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; }; class BoxArgInsn : public Insn { public: BoxArgInsn(int n, InsnPtr next); const Insn *execute(VM &vm) const; private: int n_; InsnPtr next_; }; class BoxStackInsn : public Insn { public: BoxStackInsn(int n, InsnPtr next); const Insn *execute(VM &vm) const; private: int n_; InsnPtr next_; }; class VectorInsn : public Insn { public: VectorInsn(size_t n, InsnPtr next); const Insn *execute(VM &vm) const; private: size_t n_; InsnPtr next_; }; class ListToVectorInsn : public Insn { public: ListToVectorInsn(InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; }; inline int FunctionObj::nRequiredArgs() { return signature().nRequiredArgs; } inline int FunctionObj::nOptionalArgs() { return signature().nOptionalArgs; } inline bool FunctionObj::restArg() { return signature().restArg; } inline int FunctionObj::nKeyArgs() { return signature().nKeyArgs; } inline int FunctionObj::totalArgs() { const Signature &sig = signature(); return sig.nRequiredArgs + sig.nOptionalArgs + sig.nKeyArgs + sig.restArg; } inline void PrimitiveObj::setIdentifier(const Identifier *ident) { ident_ = ident; } inline ELObj *ClosureObj::display(int i) const { return display_[i]; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not Insn_INCLUDED */ OpenJade-1.4devel/style/Insn2.h0000644000021000000240000001115207025631171012027 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Insn2_INCLUDED #define Insn2_INCLUDED 1 #include "Insn.h" #include "SosofoObj.h" #include "Style.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class CheckSosofoInsn : public Insn { public: CheckSosofoInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *execute(VM &vm) const; private: Location loc_; InsnPtr next_; }; class CheckStyleInsn : public Insn { public: CheckStyleInsn(const Location &loc, InsnPtr next) : loc_(loc), next_(next) { } const Insn *execute(VM &vm) const; private: Location loc_; InsnPtr next_; }; class ProcessingMode; class PushModeInsn : public Insn { public: PushModeInsn(const ProcessingMode *mode, InsnPtr next) : mode_(mode), next_(next) { } const Insn *execute(VM &) const; private: const ProcessingMode *mode_; InsnPtr next_; }; class PopModeInsn : public Insn { public: PopModeInsn(InsnPtr next) : next_(next) { } const Insn *execute(VM &) const; private: InsnPtr next_; }; // This creates a SetNonInheritedCsSosofo // displayLength_ vars are on the top of the stack. // flowObj is next. class SetNonInheritedCsSosofoInsn : public Insn { public: SetNonInheritedCsSosofoInsn(InsnPtr code, int displayLength, InsnPtr next); const Insn *execute(VM &) const; private: InsnPtr code_; int displayLength_; InsnPtr next_; }; class CopyFlowObjInsn : public Insn { public: CopyFlowObjInsn(FlowObj *, const Location &, InsnPtr); const Insn *execute(VM &) const; private: FlowObj *flowObj_; InsnPtr next_; Location loc_; }; // Value for characteristic is on top of the stack // Flow object is next down. class SetPseudoNonInheritedCInsn : public Insn { public: SetPseudoNonInheritedCInsn(const Identifier *, const Location &, InsnPtr); const Insn *execute(VM &) const; private: Location loc_; const Identifier *nic_; InsnPtr next_; }; class SetNonInheritedCInsn : public SetPseudoNonInheritedCInsn { public: SetNonInheritedCInsn(const Identifier *, const Location &, InsnPtr); const Insn *execute(VM &) const; }; class SetImplicitCharInsn : public Insn { public: SetImplicitCharInsn(const Location &, InsnPtr); const Insn *execute(VM &) const; private: Location loc_; InsnPtr next_; }; // sosofo with content is on top of the stack // flow object is next class SetContentInsn : public Insn { public: SetContentInsn(const CompoundFlowObj *, const Location &, InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; const CompoundFlowObj *flowObj_; Location loc_; }; class SetDefaultContentInsn : public Insn { public: SetDefaultContentInsn(const CompoundFlowObj *, const Location &loc, InsnPtr next); const Insn *execute(VM &vm) const; private: Location loc_; InsnPtr next_; const CompoundFlowObj *flowObj_; }; class MakeDefaultContentInsn : public Insn { public: MakeDefaultContentInsn(const Location &loc, InsnPtr next); const Insn *execute(VM &vm) const; private: Location loc_; InsnPtr next_; }; class SosofoAppendInsn : public Insn { public: SosofoAppendInsn(size_t, InsnPtr); const Insn *execute(VM &vm) const; private: size_t n_; InsnPtr next_; }; // This creates a VarStyleObj. // displayLength vars are on the top, then the use StyleObj is there is one. class VarStyleInsn : public Insn { public: VarStyleInsn(const ConstPtr &, unsigned, bool, InsnPtr); const Insn *execute(VM &vm) const; private: unsigned displayLength_; bool hasUse_; ConstPtr styleSpec_; InsnPtr next_; }; // BasicStyleObj is on top of stack. // If there is a current overriding style, // replace it by an OverridenStyleObj. class MaybeOverrideStyleInsn : public Insn { public: MaybeOverrideStyleInsn(InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; }; // StyleObj is on top // FlowObj is next down // calls set style on the flowobj class SetStyleInsn : public Insn { public: SetStyleInsn(InsnPtr next); const Insn *execute(VM &vm) const; private: InsnPtr next_; }; class Expression; // label is on the top // content is next down class LabelSosofoInsn : public Insn { public: LabelSosofoInsn(const Location &, InsnPtr next); const Insn *execute(VM &) const; private: Location loc_; InsnPtr next_; }; // Constructs a ContentMapSosofo // content-map is on top // content is next down class ContentMapSosofoInsn : public Insn { public: ContentMapSosofoInsn(const Location &loc, InsnPtr next); const Insn *execute(VM &) const; private: Location loc_; InsnPtr next_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not Insn2_INCLUDED */ OpenJade-1.4devel/style/Interpreter.cxx0000644000021000000240000023617007067706565013745 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "Interpreter.h" #include "Insn.h" #include "InterpreterMessages.h" #include "LocNode.h" #include "Pattern.h" #include "MacroFlowObj.h" #include "ELObjMessageArg.h" #include "VM.h" #include #include "SchemeParser.h" #include #include #include #include "LangObj.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ELObjCharPropValues : public CharPropValues { public: ELObjCharPropValues() : def_(0), map_(0) {} private: ELObjCharPropValues(const ELObjCharPropValues &); // Undefined. ELObjCharPropValues &operator=(const ELObjCharPropValues &); // Undefined. // 0 means no value. ELObj *def_; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; const Char defaultChar = 0xfffd; static size_t maxObjSize() { // FlowObj classes are declared in FlowObj.cxx. class Dummy : public CompoundFlowObj { private: Owner locp_; }; static size_t sz[] = { sizeof(UnresolvedQuantityObj), sizeof(VarStyleObj), sizeof(OverriddenStyleObj), sizeof(MergeStyleObj), sizeof(DeviceRGBColorObj), sizeof(ColorSpaceObj), sizeof(PairObj), sizeof(QuantityObj), sizeof(GlyphIdObj), sizeof(NamedNodeListPtrNodeListObj), sizeof(ProcessNodeSosofoObj), sizeof(AppendSosofoObj), sizeof(LiteralSosofoObj), sizeof(SetNonInheritedCsSosofoObj), sizeof(LabelSosofoObj), sizeof(MacroFlowObj), sizeof(Dummy), sizeof(LangObj), #ifdef SP_HAVE_LOCALE sizeof(RefLangObj), #endif sizeof(SubgroveSpecObj), sizeof(CreateSpecObj), }; size_t n = sz[0]; for (size_t i = 1; i < SIZEOF(sz); i++) if (sz[i] > n) n = sz[i]; return n; } Interpreter::Interpreter(GroveManager *groveManager, Messenger *messenger, int unitsPerInch, bool debugMode, bool dsssl2, bool style, bool strictMode, const FOTBuilder::Description &fotbDescr) : groveManager_(groveManager), messenger_(messenger), fotbDescr_(fotbDescr), Collector(maxObjSize()), partIndex_(0), // 0 is for command-line definitions dPartIndex_(1), lexCategory_(lexOther), unitsPerInch_(unitsPerInch), nInheritedC_(0), initialProcessingMode_(StringC()), currentPartFirstInitialValue_(0), initialStyle_(0), nextGlyphSubstTableUniqueId_(0), debugMode_(debugMode), dsssl2_(dsssl2), mathClassCPV_(FOTBuilder::symbolOrdinary), style_(style), strictMode_(strictMode), explicitFeatures_(0), explicitModules_(0) { makePermanent(theNilObj_ = new (*this) NilObj); makePermanent(theFalseObj_ = new (*this) FalseObj); makePermanent(theTrueObj_ = new (*this) TrueObj); makePermanent(theErrorObj_ = new (*this) ErrorObj); makePermanent(theUnspecifiedObj_ = new (*this) UnspecifiedObj); makePermanent(addressNoneObj_ = new (*this) AddressObj(FOTBuilder::Address::none)); makePermanent(emptyNodeListObj_ = new (*this) NodePtrNodeListObj); defaultLanguage_ = theFalseObj_; installSyntacticKeys(); installCValueSymbols(); installPortNames(); installPrimitives(); installUnits(); installFeatures(fotbDescr_.features); installModules(); installCharNames(); installSdata(); installFlowObjs(); installInheritedCs(); installNodeProperties(); static const char *lexCategories[] = { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "!$%&*/<=>?~_^:", "", "0123456789", "-+.", "", "();\"", " \t\r\n\f", "", }; lexCategory_.setEe(lexDelimiter); for (size_t i = 0; i < SIZEOF(lexCategories); i++) for (const char *s = lexCategories[i]; *s; s++) lexCategory_.setChar(*s, i); // #',@[\\]`{|} are ASCII chars not mentioned above, // but I guess we don't want to allow any of these // in names (as most of them have special meaning in // scheme/dsssl). if (!strictMode_) lexCategory_.setRange(127, charMax - 1, lexAddNameStart); initialProcessingMode_.setDefined(); // can't be done before initializing lexCategory_ installBuiltins(); installCharProperties(); } void Interpreter::compile(const NodePtr &root) { // FIXME compile all definitions compileInitialValues(); initialProcessingMode_.compile(*this, root); NamedTableIter iter(processingModeTable_); for (;;) { ProcessingMode *mode = iter.next(); if (!mode) break; mode->compile(*this, root); } transformationMode_.compile(*this, root); compileCharProperties(); compileDefaultLanguage(); checkGrovePlan(); } void Interpreter::compileInitialValues() { Vector > ics; for (size_t i = 0; i < initialValueNames_.size(); i++) { const Identifier *ident = initialValueNames_[i]; Owner &expr = initialValueValues_[i]; ConstPtr ic(ident->inheritedC()); expr->optimize(*this, Environment(), expr); ELObj *val = expr->constantValue(); if (val) { ConstPtr tem(ic->make(val, expr->location(), *this)); if (!tem.isNull()) ics.push_back(tem); } else ics.push_back(new VarInheritedC(ic, expr->compile(*this, Environment(), 0, InsnPtr()), expr->location())); } if (ics.size()) { Vector > forceIcs; initialStyle_ = new (*this) VarStyleObj(new StyleSpec(forceIcs, ics), 0, 0, NodePtr()); makePermanent(initialStyle_); } } void Interpreter::installInitialValue(Identifier *ident, Owner &expr) { for (size_t i = 0; i < initialValueNames_.size(); i++) { if (ident == initialValueNames_[i]) { if (i >= currentPartFirstInitialValue_) { setNextLocation(expr->location()); message(InterpreterMessages::duplicateInitialValue, StringMessageArg(ident->name()), initialValueValues_[i]->location()); } return; } } initialValueValues_.resize(initialValueValues_.size() + 1); expr.swap(initialValueValues_.back()); initialValueNames_.push_back(ident); } void Interpreter::installUnits() { static struct { const char *name; int numer; int denom; bool dsssl2; } units[] = { { "m", 5000, 127 }, { "cm", 50, 127 }, { "mm", 5, 127 }, { "in", 1, 1 }, { "pt", 1, 72 }, { "pica", 1, 6 }, { "pc", 1, 6 } // a DSSSL2 addition }; size_t nUnits = dsssl2() ? SIZEOF(units) : SIZEOF(units) - 1; for (size_t i = 0; i < nUnits; i++) { Unit *unit = lookupUnit(makeStringC(units[i].name)); long n = unitsPerInch_ * units[i].numer; if (n % units[i].denom == 0) unit->setValue(long(n / units[i].denom)); else unit->setValue(double(n)/units[i].denom); } } void Interpreter::installSyntacticKeys() { static struct { const char *name; Identifier::SyntacticKey key; } keys[] = { { "quote", Identifier::keyQuote }, { "lambda", Identifier::keyLambda }, { "if", Identifier::keyIf }, { "cond", Identifier::keyCond }, { "and", Identifier::keyAnd }, { "or", Identifier::keyOr }, { "case", Identifier::keyCase }, { "let", Identifier::keyLet }, { "let*", Identifier::keyLetStar }, { "letrec", Identifier::keyLetrec }, { "quasiquote", Identifier::keyQuasiquote }, { "unquote", Identifier::keyUnquote }, { "unquote-splicing", Identifier::keyUnquoteSplicing }, { "define", Identifier::keyDefine }, { "else", Identifier::keyElse }, { "=>", Identifier::keyArrow }, { "there-exists?", Identifier::keyThereExists }, { "for-all?", Identifier::keyForAll }, { "select-each", Identifier::keySelectEach }, { "union-for-each", Identifier::keyUnionForEach }, { "define-unit", Identifier::keyDefineUnit }, { "declare-default-language", Identifier::keyDeclareDefaultLanguage }, { "declare-char-property", Identifier::keyDeclareCharProperty }, { "define-language", Identifier::keyDefineLanguage }, { "collate", Identifier::keyCollate }, { "toupper", Identifier::keyToupper }, { "tolower", Identifier::keyTolower }, { "symbol", Identifier::keySymbol }, { "order", Identifier::keyOrder }, { "forward", Identifier::keyForward }, { "backward", Identifier::keyBackward }, { "add-char-properties", Identifier::keyAddCharProperties }, { "architecture", Identifier::keyArchitecture }, { "default", Identifier::keyDefault }, { "null", Identifier::keyNull }, { "rcs?", Identifier::keyIsRcs }, { "parent", Identifier::keyParent }, { "active", Identifier::keyActive }, { "label", Identifier::keyLabel }, { "children", Identifier::keyChildren }, { "class", Identifier::keyClass }, }, styleKeys[] = { { "make", Identifier::keyMake }, { "style", Identifier::keyStyle }, { "with-mode", Identifier::keyWithMode }, { "query", Identifier::keyQuery }, { "element", Identifier::keyElement }, { "root", Identifier::keyRoot }, { "id", Identifier::keyId }, { "mode", Identifier::keyMode }, { "declare-initial-value", Identifier::keyDeclareInitialValue }, { "declare-characteristic", Identifier::keyDeclareCharacteristic }, { "declare-flow-object-class", Identifier::keyDeclareFlowObjectClass }, { "declare-char-characteristic+property", Identifier::keyDeclareCharCharacteristicAndProperty }, { "declare-reference-value-type", Identifier::keyDeclareReferenceValueType }, { "define-page-model", Identifier::keyDefinePageModel }, { "define-column-set-model", Identifier::keyDefineColumnSetModel }, { "use", Identifier::keyUse }, { "content-map", Identifier::keyContentMap }, { "keep-with-previous?", Identifier::keyIsKeepWithPrevious }, { "keep-with-next?", Identifier::keyIsKeepWithNext }, { "space-before", Identifier::keySpaceBefore }, { "space-after", Identifier::keySpaceAfter }, { "left-header", Identifier::keyLeftHeader }, { "center-header", Identifier::keyCenterHeader }, { "right-header", Identifier::keyRightHeader }, { "left-footer", Identifier::keyLeftFooter }, { "center-footer", Identifier::keyCenterFooter }, { "right-footer", Identifier::keyRightFooter }, { "destination", Identifier::keyDestination }, { "type", Identifier::keyType }, { "coalesce-id", Identifier::keyCoalesceId }, { "display?", Identifier::keyIsDisplay }, { "scale", Identifier::keyScale }, { "max-width", Identifier::keyMaxWidth }, { "max-height", Identifier::keyMaxHeight }, { "entity-system-id", Identifier::keyEntitySystemId }, { "notation-system-id", Identifier::keyNotationSystemId }, { "position-point-x", Identifier::keyPositionPointX }, { "position-point-y", Identifier::keyPositionPointY }, { "escapement-direction", Identifier::keyEscapementDirection }, { "break-before-priority", Identifier::keyBreakBeforePriority }, { "break-after-priority", Identifier::keyBreakAfterPriority }, { "orientation", Identifier::keyOrientation }, { "length", Identifier::keyLength }, { "char", Identifier::keyChar }, { "glyph-id", Identifier::keyGlyphId }, { "space?", Identifier::keyIsSpace }, { "record-end?", Identifier::keyIsRecordEnd }, { "input-tab?", Identifier::keyIsInputTab }, { "input-whitespace?", Identifier::keyIsInputWhitespace }, { "punct?", Identifier::keyIsPunct }, { "drop-after-line-break?", Identifier::keyIsDropAfterLineBreak }, { "drop-unless-before-line-break?", Identifier::keyIsDropUnlessBeforeLineBreak }, { "math-class", Identifier::keyMathClass }, { "math-font-posture", Identifier::keyMathFontPosture }, { "script", Identifier::keyScript }, { "stretch-factor", Identifier::keyStretchFactor }, { "keep", Identifier::keyKeep }, { "break-before", Identifier::keyBreakBefore }, { "break-after", Identifier::keyBreakAfter }, { "may-violate-keep-before?", Identifier::keyIsMayViolateKeepBefore }, { "may-violate-keep-after?", Identifier::keyIsMayViolateKeepAfter }, { "before-row-border", Identifier::keyBeforeRowBorder }, { "after-row-border", Identifier::keyAfterRowBorder }, { "before-column-border", Identifier::keyBeforeColumnBorder }, { "after-column-border", Identifier::keyAfterColumnBorder }, { "column-number", Identifier::keyColumnNumber }, { "row-number", Identifier::keyRowNumber }, { "n-columns-spanned", Identifier::keyNColumnsSpanned }, { "n-rows-spanned", Identifier::keyNRowsSpanned }, { "width", Identifier::keyWidth }, { "starts-row?", Identifier::keyIsStartsRow }, { "ends-row?", Identifier::keyIsEndsRow }, { "table-width", Identifier::keyTableWidth }, { "multi-modes", Identifier::keyMultiModes }, { "data", Identifier::keyData }, { "min", Identifier::keyMin }, { "max", Identifier::keyMax }, { "conditional?", Identifier::keyIsConditional }, { "priority", Identifier::keyPriority }, { "grid-n-rows", Identifier::keyGridNRows }, { "grid-n-columns", Identifier::keyGridNColumns }, { "radical", Identifier::keyRadical }, { "attributes", Identifier::keyAttributes }, { "repeat", Identifier::keyRepeat }, { "position", Identifier::keyPosition }, { "only", Identifier::keyOnly }, { "importance", Identifier::keyImportance }, { "position-preference", Identifier::keyPositionPreference }, { "white-point", Identifier::keyWhitePoint }, { "black-point", Identifier::keyBlackPoint }, { "range", Identifier::keyRange }, { "range-abc", Identifier::keyRangeAbc }, { "range-lmn", Identifier::keyRangeLmn }, { "range-a", Identifier::keyRangeA }, { "decode-abc", Identifier::keyDecodeAbc }, { "decode-lmn", Identifier::keyDecodeLmn }, { "decode-a", Identifier::keyDecodeA }, { "matrix-abc", Identifier::keyMatrixAbc }, { "matrix-lmn", Identifier::keyMatrixLmn }, { "matrix-a", Identifier::keyMatrixA }, }, transformKeys[] = { { "define-transliteration-map", Identifier::keyDefineTransliterationMap }, { "node", Identifier::keyNode }, { "subgrove", Identifier::keySubgrove }, { "add", Identifier::keyAdd }, { "remove", Identifier::keyRemove }, { "sub", Identifier::keySub }, { "sort-children", Identifier::keySortChildren }, { "optional", Identifier::keyOptional }, { "unique", Identifier::keyUnique }, { "result-path", Identifier::keyResultPath }, { "property", Identifier::keyProperty }, }, keys2[] = { { "declare-class-attribute", Identifier::keyDeclareClassAttribute }, { "declare-id-attribute", Identifier::keyDeclareIdAttribute }, { "declare-flow-object-macro", Identifier::keyDeclareFlowObjectMacro }, { "or-element", Identifier::keyOrElement }, { "set!", Identifier::keySet }, { "begin", Identifier::keyBegin }, }; for (size_t i = 0; i < SIZEOF(keys); i++) { StringC tem(makeStringC(keys[i].name)); lookup(tem)->setSyntacticKey(keys[i].key); if (dsssl2() && tem[tem.size() - 1] == '?') { tem.resize(tem.size() - 1); lookup(tem)->setSyntacticKey(keys[i].key); } } if (style()) for (size_t i = 0; i < SIZEOF(styleKeys); i++) { StringC tem(makeStringC(styleKeys[i].name)); lookup(tem)->setSyntacticKey(styleKeys[i].key); if (dsssl2() && tem[tem.size() - 1] == '?') { tem.resize(tem.size() - 1); lookup(tem)->setSyntacticKey(styleKeys[i].key); } } else for (size_t i = 0; i < SIZEOF(transformKeys); i++) { StringC tem(makeStringC(transformKeys[i].name)); lookup(tem)->setSyntacticKey(transformKeys[i].key); } if (dsssl2()) { for (size_t i = 0; i < SIZEOF(keys2); i++) lookup(makeStringC(keys2[i].name))->setSyntacticKey(keys2[i].key); } } void Interpreter::installCValueSymbols() { cValueSymbols_[0] = makeFalse(); cValueSymbols_[1] = makeTrue(); for (size_t i = 2; i < FOTBuilder::nSymbols; i++) { SymbolObj *sym = makeSymbol(makeStringC(FOTBuilder::symbolName(FOTBuilder::Symbol(i)))); sym->setCValue(FOTBuilder::Symbol(i)); cValueSymbols_[i] = sym; } } void Interpreter::installPortNames() { // These must match the order in SymbolObj. static const char *names[] = { "numerator", "denominator", "pre-sup", "pre-sub", "post-sup", "post-sub", "mid-sup", "mid-sub", "over-mark", "under-mark", "open", "close", "degree", "operator", "lower-limit", "upper-limit", "header", "footer" }; ASSERT(SIZEOF(names) == nPortNames); for (size_t i = 0; i < SIZEOF(names); i++) portNames_[i] = makeSymbol(makeStringC(names[i])); } void Interpreter::installCharNames() { if (!strictMode()) { static struct { Char c; const char *name; } chars[] = { #include "charNames.h" }; for (size_t i = 0; i < SIZEOF(chars); i++) { CharPart ch; ch.c = chars[i].c; ch.defPart = unsigned(-1); namedCharTable_.insert(makeStringC(chars[i].name), ch, 1); } } } void Interpreter::installSdata() { if (!strictMode()) { // This comes from uni2sgml.txt on ftp://unicode.org. // It is marked there as obsolete, so it probably ought to be checked. // The definitions of apos and quot have been fixed for consistency with XML. static struct { Char c; const char *name; } entities[] = { #include "sdata.h" }; for (size_t i = 0; i < SIZEOF(entities); i++) { CharPart ch; ch.c = entities[i].c; ch.defPart = unsigned(-1); sdataEntityNameTable_.insert(makeStringC(entities[i].name), ch, 1); } } } void Interpreter::installNodeProperties() { for (int i = 0; i < ComponentName::nIds; i++) { ComponentName::Id id = ComponentName::Id(i); nodePropertyTable_.insert(makeStringC(ComponentName::rcsName(id)), i); nodePropertyTable_.insert(makeStringC(ComponentName::sdqlName(id)), i); } } void Interpreter::setCharRepertoire(const StringC &pubid) { if (pubid == "UNREGISTERED::OpenJade//Character Repertoire::OpenJade") { if (strictMode_) { installCharNames(); installSdata(); // This assumes that we process char-repertoire // declaration before any declarations which change // lexical categories. for (Char i = 127; i < charMax; i++) lexCategory_.setChar(i, lexAddNameStart); strictMode_ = 0; } } else message(InterpreterMessages::unsupportedCharRepertoire, StringMessageArg(pubid)); } void Interpreter::addStandardChar(const StringC &name, const StringC &num) { int n; size_t i = 0; if (!scanSignDigits(num, i, n)) { message(InterpreterMessages::invalidCharNumber, StringMessageArg(num)); return; } const CharPart *def = namedCharTable_.lookup(name); CharPart ch; ch.c = n; ch.defPart = dPartIndex_; if (def) { if (dPartIndex_ < def->defPart) namedCharTable_.insert(name, ch, 1); else if (def->defPart == dPartIndex_ && def->c != ch.c) message(InterpreterMessages::duplicateCharName, StringMessageArg(name)); } else namedCharTable_.insert(name, ch, 1); } void Interpreter::addNameChar(const StringC &name) { const CharPart *cp = namedCharTable_.lookup(name); if (!cp) message(InterpreterMessages::badCharName, StringMessageArg(name)); else if (lexCategory_[cp->c] != lexOther) // FIXME give a more specific error message(InterpreterMessages::badDeclaration); else lexCategory_.setChar(cp->c, lexAddNameStart); } void Interpreter::addSeparatorChar(const StringC &name) { const CharPart *cp = namedCharTable_.lookup(name); if (!cp) message(InterpreterMessages::badCharName, StringMessageArg(name)); else if (lexCategory_[cp->c] != lexOther) // FIXME give a more specific error message(InterpreterMessages::badDeclaration); else lexCategory_.setChar(cp->c, lexAddWhiteSpace); } void Interpreter::addSdataEntity(const StringC &ename, const StringC &etext, const StringC &name) { const CharPart *cp = namedCharTable_.lookup(name); if (!cp) { message(InterpreterMessages::badCharName, StringMessageArg(name)); return; } CharPart ch; ch.c = cp->c; ch.defPart = dPartIndex_; if (ename.size() > 0) { const CharPart *def = sdataEntityNameTable_.lookup(ename); if (def) { if (dPartIndex_ < def->defPart) sdataEntityNameTable_.insert(ename, ch); else if (def->defPart == dPartIndex_ && def->c != cp->c) message(InterpreterMessages::duplicateSdataEntityName, StringMessageArg(ename)); } else sdataEntityNameTable_.insert(ename, ch); } if (etext.size() > 0) { const CharPart *def = sdataEntityTextTable_.lookup(etext); if (def) { if (dPartIndex_ < def->defPart) sdataEntityTextTable_.insert(etext, ch); else if (def->defPart == dPartIndex_ && def->c != cp->c) message(InterpreterMessages::duplicateSdataEntityText, StringMessageArg(etext)); } else sdataEntityTextTable_.insert(etext, ch); } } bool Interpreter::sdataMap(GroveString name, GroveString text, GroveChar &c) const { StringC tem(name.data(), name.size()); StringC tem2(text.data(), text.size()); const CharPart *cp = sdataEntityNameTable_.lookup(tem); if (cp) { c = cp->c; return 1; } cp = sdataEntityTextTable_.lookup(tem2); if (cp) { c = cp->c; return 1; } if (convertUnicodeCharName(tem, c)) return 1; // I think this is the best thing to do. // At least it makes preserve-sdata work with unknown SDATA entities. c = defaultChar; return 1; } ELObj *Interpreter::convertGlyphId(const Char *str, size_t len, const Location &loc) { unsigned long n = 0; const char *publicId = 0; for (size_t i = len; i > 1; --i) { if (str[i - 1] == ':' && str[i - 2] == ':' && i < len && str[i] != '0') { for (size_t j = i; j < len; j++) n = n*10 + (str[j] - '0'); publicId = storePublicId(str, i - 2, loc); break; } if (str[i - 1] < '0' || str[i - 1] > '9') break; } if (!publicId) publicId = storePublicId(str, len, loc); return new (*this) GlyphIdObj(FOTBuilder::GlyphId(publicId, n)); } bool Interpreter::convertCharName(const StringC &str, Char &c) const { const CharPart *cp = namedCharTable_.lookup(str); if (cp) { c = cp->c; return 1; } return convertUnicodeCharName(str, c); } bool Interpreter::convertUnicodeCharName(const StringC &str, Char &c) { if (str.size() != 6 || str[0] != 'U' || str[1] != '-') return 0; Char value = 0; for (int i = 2; i < 6; i++) { value <<= 4; switch (str[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value |= str[i] - '0'; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': value |= 10 + (str[i] - 'A'); break; default: return 0; } } c = value; return 1; } SymbolObj *Interpreter::makeSymbol(const StringC &str) { SymbolObj *sym = symbolTable_.lookup(str); if (!sym) { StringObj *strObj = new (*this) StringObj(str); makePermanent(strObj); sym = new (*this) SymbolObj(strObj); makePermanent(sym); symbolTable_.insert(sym); } return sym; } Identifier *Interpreter::lookup(const StringC &str) { Identifier *ident = identTable_.lookup(str); if (!ident) { ident = new Identifier(str); identTable_.insert(ident); } return ident; } bool Interpreter::lookupNodeProperty(const StringC &str, ComponentName::Id &id) { const int *val = nodePropertyTable_.lookup(str); if (!val) { StringC tem(str); for (size_t i = 0; i < tem.size(); i++) { if (tem[i] >= 'A' && tem[i] <= 'Z') tem[i] = 'a' + (tem[i] - 'A'); } val = nodePropertyTable_.lookup(tem); if (!val) return 0; } id = ComponentName::Id(*val); return 1; } Unit *Interpreter::lookupUnit(const StringC &str) { Unit *unit = unitTable_.lookup(str); if (!unit) { unit = new Unit(str); unitTable_.insert(unit); } return unit; } CharProp *Interpreter::lookupCharProperty(const StringC &n) { CharProp *p = charPropTable_.lookup(n); if (!p) { p = new CharProp(n); charPropTable_.insert(p); } return p; } ProcessingMode *Interpreter::lookupProcessingMode(const StringC &str) { ProcessingMode *mode = processingModeTable_.lookup(str); if (!mode) { mode = new ProcessingMode(str, &initialProcessingMode_); processingModeTable_.insert(mode); } return mode; } StringC Interpreter::makeStringC(const char *s) { StringC tem; if (s) while (*s) tem += (unsigned char)*s++; return tem; } void Interpreter::endPart() { currentPartFirstInitialValue_ = initialValueNames_.size(); partIndex_++; } void Interpreter::dEndPart() { dPartIndex_++; } void Interpreter::normalizeGeneralName(const NodePtr &nd, StringC &str) { NamedNodeListPtr nnl; NodePtr root; if (nd->getGroveRoot(root) == accessOK && root->getElements(nnl) == accessOK) str.resize(nnl->normalize(str.begin(), str.size())); } ELObj *Interpreter::makeLengthSpec(const FOTBuilder::LengthSpec &ls) { if (ls.displaySizeFactor != 0.0) { LengthSpec result(LengthSpec::displaySize, ls.displaySizeFactor); result += double(ls.length); return new (*this) LengthSpecObj(result); } else return new (*this) LengthObj(ls.length); } bool Interpreter::convertBooleanC(ELObj *obj, const Identifier *ident, const Location &loc, bool &result) { obj = convertFromString(obj, convertAllowBoolean, loc); if (obj == makeFalse()) { result = 0; return 1; } if (obj == makeTrue()) { result = 1; return 1; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertPublicIdC(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::PublicId &pubid) { if (obj == makeFalse()) { pubid = 0; return 1; } const Char *s; size_t n; if (obj->stringData(s, n)) { if (n == 0) pubid = 0; else pubid = storePublicId(s, n, loc); return 1; } invalidCharacteristicValue(ident, loc); return 0; } const char *Interpreter::storePublicId(const Char *s, size_t n, const Location &loc) { String buf; for (; n > 0; s++, n--) { if (*s >= 128) { setNextLocation(loc); message(InterpreterMessages::invalidPublicIdChar, StringMessageArg(StringC(s, 1))); } else buf += char(*s); } buf += '\0'; return publicIds_.store(buf); } bool Interpreter::convertStringC(ELObj *obj, const Identifier *ident, const Location &loc, StringC &result) { const Char *s; size_t n; if (obj->stringData(s, n)) { result.assign(s, n); return 1; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertLengthSpec(ELObj *obj, FOTBuilder::LengthSpec &result) { int dim; double d; switch (obj->quantityValue(result.length, d, dim)) { case ELObj::longQuantity: if (dim == 1) return 1; break; case ELObj::doubleQuantity: if (dim == 1) { // FIXME catch overflow result.length = d < 0.0 ? long(d - .5) : long(d + .5); return 1; } break; default: { const LengthSpec *ls = obj->lengthSpec(); if (ls) return ls->convert(result); } break; } return 0; } bool Interpreter::convertLengthC(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::Length &n) { obj = convertFromString(obj, convertAllowNumber, loc); int dim; double d; switch (obj->quantityValue(n, d, dim)) { case ELObj::longQuantity: if (dim == 1) return 1; break; case ELObj::doubleQuantity: if (dim == 1) { // FIXME catch overflow n = long(d); return 1; } break; default: break; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertLengthSpecC(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::LengthSpec &result) { obj = convertFromString(obj, convertAllowNumber, loc); if (convertLengthSpec(obj, result)) return 1; invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertOptLengthSpecC(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::OptLengthSpec &result) { obj = convertFromString(obj, convertAllowBoolean|convertAllowNumber, loc); if (obj == makeFalse()) { result.hasLength = 0; return 1; } if (convertLengthSpecC(obj, ident, loc, result.length)) { result.hasLength = 1; return 1; } return 0; } bool Interpreter::convertOptPositiveIntegerC(ELObj *obj, const Identifier *ident, const Location &loc, long &result) { obj = convertFromString(obj, convertAllowNumber|convertAllowBoolean, loc); if (obj == makeFalse()) { result = 0; return 1; } if (obj->exactIntegerValue(result) && result > 0) return 1; // FIXME allow inexact value invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertIntegerC(ELObj *obj, const Identifier *ident, const Location &loc, long &result) { obj = convertFromString(obj, convertAllowNumber, loc); if (obj->exactIntegerValue(result)) return 1; // FIXME allow inexact value invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertLetter2C(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::Letter2 &code) { StringObj *strObj = obj->convertToString(); if (strObj) { const StringC &str = *strObj; if (str.size() == 2 && str[0] >= 'A' && str[0] <= 'Z' && str[1] >= 'A' && str[1] <= 'Z') { code = SP_LETTER2(str[0], str[1]); return 1; } if (str.size() == 0) { code = 0; return 1; } } else if (obj == makeFalse()) { code = 0; return 1; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertCharC(ELObj *obj, const Identifier *ident, const Location &loc, Char &result) { if (obj->charValue(result)) return 1; const Char *s; size_t n; if (obj->stringData(s, n) && n == 1) { result = s[0]; return 1; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertColorC(ELObj *obj, const Identifier *ident, const Location &loc, ColorObj *&color) { color = obj->asColor(); if (color) return 1; invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertOptColorC(ELObj *obj, const Identifier *ident, const Location &loc, ColorObj *&color) { color = obj->asColor(); if (color) return 1; if (obj == makeFalse()) return 1; invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertRealC(ELObj *obj, const Identifier *ident, const Location &loc, double &result) { obj = convertFromString(obj, convertAllowNumber, loc); if (obj->realValue(result)) return 1; invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertEnumC(ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::Symbol &sym) { obj = convertFromString(obj, convertAllowSymbol|convertAllowBoolean, loc); if (obj == makeFalse()) { sym = FOTBuilder::symbolFalse; return 1; } SymbolObj *symObj = obj->asSymbol(); if (symObj) { sym = symObj->cValue(); if (sym != FOTBuilder::symbolFalse) return 1; } if (obj == makeTrue()) { sym = FOTBuilder::symbolTrue; return 1; } invalidCharacteristicValue(ident, loc); return 0; } bool Interpreter::convertEnumC(const FOTBuilder::Symbol *syms, size_t nSyms, ELObj *obj, const Identifier *ident, const Location &loc, FOTBuilder::Symbol &result) { obj = convertFromString(obj, convertAllowSymbol|convertAllowBoolean, loc); SymbolObj *symObj = obj->asSymbol(); FOTBuilder::Symbol val; if (symObj) { val = symObj->cValue(); if (val == FOTBuilder::symbolFalse) { invalidCharacteristicValue(ident, loc); return 0; } } else if (obj == makeFalse()) val = FOTBuilder::symbolFalse; else if (obj == makeTrue()) val = FOTBuilder::symbolTrue; else { invalidCharacteristicValue(ident, loc); return 0; } for (size_t i = 0; i < nSyms; i++) if (val == syms[i]) { result = val; return 1; } invalidCharacteristicValue(ident, loc); return 0; } void Interpreter::invalidCharacteristicValue(const Identifier *ident, const Location &loc) { setNextLocation(loc); message(InterpreterMessages::invalidCharacteristicValue, StringMessageArg(ident->name())); } static bool equal(const Char *s1, const char *s2, size_t n) { while (n > 0) { if (*s1++ != (unsigned char)*s2++) return 0; --n; } return 1; } ELObj *Interpreter::convertFromString(ELObj *obj, unsigned hints, const Location &loc) { // FIXME fold to lower case const Char *s; size_t n; if (!dsssl2() || !obj->stringData(s, n)) return obj; if (hints & convertAllowNumber) { ELObj *tem = convertNumber(StringC(s, n)); if (tem) return tem->resolveQuantities(1, *this, loc); } if (hints & convertAllowSymbol) { StringC tem(s, n); SymbolObj *sym = symbolTable_.lookup(tem); if (sym && sym->cValue() != FOTBuilder::symbolFalse) return sym; } if (hints & convertAllowBoolean) { switch (n) { case 2: if (equal(s, "no", n)) return makeFalse(); break; case 3: if (equal(s, "yes", n)) return makeTrue(); break; case 4: if (equal(s, "true", n)) return makeTrue(); break; case 5: if (equal(s, "false", n)) return makeFalse(); break; } } return obj; } ELObj *Interpreter::convertNumber(const StringC &str, int radix) { { if (str.size() == 0) return 0; size_t i = 0; if (str[0] == '#') { if (str.size() < 2) return 0; switch (str[1]) { case 'd': radix = 10; break; case 'x': radix = 16; break; case 'o': radix = 8; break; case 'b': radix = 2; break; default: return 0; } i += 2; } if (i >= str.size()) return 0; bool negative; if (str[i] == '-') { negative = 1; i++; } else { negative = 0; if (str[i] == '+') i++; } bool hadDecimalPoint = 0; bool hadDigit = 0; long n = 0; int exp = 0; for (; i < str.size(); i++) { Char c = str[i]; int weight; switch (c) { case '0': weight = 0; break; case '1': weight = 1; break; case '2': weight = 2; break; case '3': weight = 3; break; case '4': weight = 4; break; case '5': weight = 5; break; case '6': weight = 6; break; case '7': weight = 7; break; case '8': weight = 8; break; case '9': weight = 9; break; case 'a': weight = 10; break; case 'b': weight = 11; break; case 'c': weight = 12; break; case 'd': weight = 13; break; case 'e': weight = 14; break; case 'f': weight = 15; break; default: weight = -1; break; } if (weight >= 0 && weight < radix) { hadDigit = 1; if (negative) { if (-(unsigned long)n > (-(unsigned long)LONG_MIN - weight)/radix) { if (radix != 10) return 0; return convertNumberFloat(str); } else n = n*radix - weight; } else { if (n > (LONG_MAX - weight)/radix) { if (radix != 10) return 0; return convertNumberFloat(str); } else n = n*radix + weight; } if (hadDecimalPoint) exp--; } else if (c == '.' && radix == 10) { if (hadDecimalPoint) return 0; hadDecimalPoint = 1; } else break; } if (!hadDigit || (radix != 10 && i < str.size())) return 0; if (i + 1 < str.size() && str[i] == 'e' && lexCategory(str[i + 1]) != lexLetter) { hadDecimalPoint = 1; i++; int e; if (!scanSignDigits(str, i, e)) return 0; exp += e; } if (i < str.size()) { int unitExp; Unit *unit = scanUnit(str, i, unitExp); if (!unit) return 0; if (unitExp == 1) return new (*this) UnresolvedLengthObj(n, exp, unit); else return convertNumberFloat(str); } if (hadDecimalPoint) return convertNumberFloat(str); return makeInteger(n); } } bool Interpreter::scanSignDigits(const StringC &str, size_t &i, int &n) { bool negative = 0; if (i < str.size()) { if (str[i] == '-') { i++; negative = 1; } else if (str[i] == '+') i++; } size_t j = i; n = 0; while (i < str.size() && ('0' <= str[i] && str[i] <= '9')) { if (negative) n = n*10 - (str[i] - '0'); else n = n*10 + (str[i] - '0'); i++; } if (i == j) return 0; return 1; } ELObj *Interpreter::convertNumberFloat(const StringC &str) { String buf; // omit an optional radix prefix size_t i0 = 0; if (str.size() > 1 && str[0] == '#' && str[1] == 'd') i0 = 2; for (size_t i = i0; i < str.size(); i++) { if (str[i] > CHAR_MAX || str[i] == '\0') return 0; // 'E' is a valid exponent marker for C but not us if (str[i] == 'E') break; buf += char(str[i]); } buf += '\0'; const char *endPtr; double val = strtod((char *)buf.data(), (char **)&endPtr); if (endPtr - buf.data() == str.size() - i0) return new (*this) RealObj(val); if (endPtr == buf.data()) return 0; int unitExp; Unit *unit = scanUnit(str, endPtr - buf.data() + i0, unitExp); if (!unit) return 0; return new (*this) UnresolvedQuantityObj(val, unit, unitExp); } // Return 0 for error. Unit *Interpreter::scanUnit(const StringC &str, size_t i, int &unitExp) { StringC unitName; while (i < str.size()) { if (str[i] == '-' || str[i] == '+' || ('0' <= str[i] && str[i] <= '9')) break; unitName += str[i++]; } if (i >= str.size()) unitExp = 1; else { unitExp = 0; bool neg = 0; if (str[i] == '-' || str[i] == '+') { if (str[i] == '-') neg = 1; i++; if (i >= str.size()) return 0; } while (i < str.size()) { if (str[i] < '0' || str[i] > '9') return 0; unitExp *= 10; if (neg) unitExp -= (str[i] - '0'); else unitExp += (str[i] - '0'); i++; } } return lookupUnit(unitName); } void Interpreter::setNodeLocation(const NodePtr &nd) { const LocNode *lnp; Location nodeLoc; if ((lnp = LocNode::convert(nd)) != 0 && lnp->getLocation(nodeLoc) == accessOK) setNextLocation(nodeLoc); } bool Interpreter::convertToPattern(ELObj *obj, const Location &loc, Pattern &pattern) { IList list; if (!convertToPattern(obj, loc, 0, list)) return 0; Pattern tem(list); tem.swap(pattern); return 1; } bool Interpreter::convertToPattern(ELObj *obj, const Location &loc, bool isChild, IList &list) { StringObj *str = obj->convertToString(); if (str) { const Char *s; size_t n; str->stringData(s, n); if (!n) { setNextLocation(loc); message(InterpreterMessages::patternEmptyGi); return 0; } list.insert(new Pattern::Element(StringC(s, n))); return 1; } if (obj == makeTrue()) { list.insert(new Pattern::Element(StringC())); return 1; } Pattern::Element *curElement = 0; while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair) { setNextLocation(loc); message(InterpreterMessages::patternNotList); return 0; } ELObj *head = pair->car(); obj = pair->cdr(); if (head == makeTrue() && dsssl2()) { list.insert(curElement = new Pattern::Element(StringC())); continue; } str = head->convertToString(); if (str) { const Char *s; size_t n; str->stringData(s, n); if (!n) { setNextLocation(loc); message(InterpreterMessages::patternEmptyGi); return 0; } list.insert(curElement = new Pattern::Element(StringC(s, n))); continue; } if (!curElement) { setNextLocation(loc); message(InterpreterMessages::patternBadGi, ELObjMessageArg(head, *this)); return 0; } if (head->isNil()) continue; // empty attribute list if (head->asPair()) { if (!patternAddAttributeQualifiers(head, loc, *curElement)) { setNextLocation(loc); message(InterpreterMessages::patternBadAttributeQualifier); return 0; } continue; } KeywordObj *key = dsssl2() ? head->asKeyword() : 0; if (!key) { setNextLocation(loc); message(InterpreterMessages::patternBadMember, ELObjMessageArg(head, *this)); return 0; } pair = obj->asPair(); if (!pair) { setNextLocation(loc); message(obj->isNil() ? InterpreterMessages::patternMissingQualifierValue : InterpreterMessages::patternNotList); return 0; } ELObj *value = pair->car(); obj = pair->cdr(); Identifier::SyntacticKey k; if (!key->identifier()->syntacticKey(k)) { setNextLocation(loc); message(InterpreterMessages::patternUnknownQualifier, StringMessageArg(key->identifier()->name())); return 0; } switch (k) { case Identifier::keyAttributes: if (!patternAddAttributeQualifiers(value, loc, *curElement)) { setNextLocation(loc); message(InterpreterMessages::patternBadAttributeQualifier); return 0; } break; case Identifier::keyChildren: { IList children; if (!convertToPattern(value, loc, 1, children)) return 0; if (!children.empty()) curElement->addQualifier(new Pattern::ChildrenQualifier(children)); } break; case Identifier::keyRepeat: { if (isChild) { setNextLocation(loc); message(InterpreterMessages::patternChildRepeat); return 0; } SymbolObj *sym = value->asSymbol(); if (sym) { const StringC &str = *sym->name(); if (str.size() == 1) { switch (str[0]) { case '*': curElement->setRepeat(0, Pattern::Repeat(-1)); value = 0; break; case '?': curElement->setRepeat(0, 1); value = 0; break; case '+': curElement->setRepeat(1, Pattern::Repeat(-1)); value = 0; break; default: break; } } } if (value) { setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } } break; case Identifier::keyPosition: { SymbolObj *sym = value->asSymbol(); if (sym) { Pattern::Qualifier *qual = 0; const StringC &str = *sym->name(); if (str == "first-of-type") qual = new Pattern::FirstOfTypeQualifier; else if (str == "last-of-type") qual = new Pattern::LastOfTypeQualifier; else if (str == "first-of-any") qual = new Pattern::FirstOfAnyQualifier; else if (str == "last-of-any") qual = new Pattern::LastOfAnyQualifier; if (qual) { curElement->addQualifier(qual); break; } } setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } case Identifier::keyOnly: { SymbolObj *sym = value->asSymbol(); if (sym) { Pattern::Qualifier *qual = 0; const StringC &str = *sym->name(); if (str == "of-type") qual = new Pattern::OnlyOfTypeQualifier; else if (str == "of-any") qual = new Pattern::OnlyOfAnyQualifier; if (qual) { curElement->addQualifier(qual); break; } } setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } break; case Identifier::keyId: { StringObj *str = value->convertToString(); if (!str) { setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } const Char *s; size_t n; str->stringData(s, n); curElement->addQualifier(new Pattern::IdQualifier(StringC(s, n))); } break; case Identifier::keyClass: { StringObj *str = value->convertToString(); if (!str) { setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } const Char *s; size_t n; str->stringData(s, n); curElement->addQualifier(new Pattern::ClassQualifier(StringC(s, n))); } break; case Identifier::keyImportance: { long n; if (!value->exactIntegerValue(n)) { setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } curElement->addQualifier(new Pattern::ImportanceQualifier(n)); } break; case Identifier::keyPriority: { long n; if (!value->exactIntegerValue(n)) { setNextLocation(loc); message(InterpreterMessages::patternBadQualifierValue, ELObjMessageArg(value, *this), StringMessageArg(key->identifier()->name())); return 0; } curElement->addQualifier(new Pattern::PriorityQualifier(n)); } break; default: setNextLocation(loc); message(InterpreterMessages::patternUnknownQualifier, StringMessageArg(key->identifier()->name())); return 0; } } return 1; } bool Interpreter::patternAddAttributeQualifiers(ELObj *obj, const Location &loc, Pattern::Element &elem) { while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair) return 0; StringObj *tem = pair->car()->convertToString(); if (!tem) return 0; const Char *s; size_t n; tem->stringData(s, n); if (n == 0) return 0; StringC name(s, n); obj = pair->cdr(); pair = obj->asPair(); if (!pair) return 0; obj = pair->cdr(); if (pair->car() == makeFalse() && dsssl2()) elem.addQualifier(new Pattern::AttributeMissingValueQualifier(name)); else if (pair->car() == makeTrue() && dsssl2()) elem.addQualifier(new Pattern::AttributeHasValueQualifier(name)); else { tem = pair->car()->convertToString(); if (!tem) return 0; tem->stringData(s, n); elem.addQualifier(new Pattern::AttributeQualifier(name, StringC(s, n))); } } return 1; } void Interpreter::dispatchMessage(Message &msg) { messenger_->dispatchMessage(msg); } void Interpreter::dispatchMessage(const Message &msg) { messenger_->dispatchMessage(msg); } Interpreter::StringSet::StringSet() { } const char *Interpreter::StringSet::store(String &str) { str += '\0'; const String *p = table_.lookup(str); if (!p) { String *tem = new String; str.swap(*tem); table_.insert(tem); p = tem; } return p->data(); } unsigned long Interpreter::StringSet::hash(const String &str) { const char *p = str.data(); unsigned long h = 0; for (size_t n = str.size(); n > 0; n--) h = (h << 5) + h + (unsigned char)*p++; // from Chris Torek return h; } bool Identifier::preferBuiltin_ = 0; Identifier::Identifier(const StringC &name) : Named(name), value_(0), syntacticKey_(notKey), beingComputed_(0), flowObj_(0), builtin_(0), defPart_(0), charNIC_(0), feature_(Interpreter::noFeature) { } void Identifier::maybeSaveBuiltin() { if (defPart_ == unsigned(-1) && !builtin_) { builtin_ = new Identifier(name()); if (value_) builtin_->setValue(value_, defPart_); else builtin_->setDefinition(def_, defPart_, defLoc_); } } void Identifier::setDefinition(Owner &expr, unsigned part, const Location &loc) { maybeSaveBuiltin(); def_.swap(expr); defPart_ = part; defLoc_ = loc; value_ = 0; } void Identifier::setBuiltinDefinition(Owner &expr, unsigned part, const Location &loc) { if (!builtin_) { builtin_ = new Identifier(name()); builtin_->setDefinition(expr, part, loc); } } void Identifier::setValue(ELObj *value, unsigned partIndex) { maybeSaveBuiltin(); value_ = value; // Built in functions have lowest priority. defPart_ = partIndex; } bool Identifier::defined(unsigned &part, Location &loc) const { if (builtin_ && preferBuiltin_) return builtin_->defined(part, loc); if (!def_ && !value_) return 0; part = defPart_; loc = defLoc_; return 1; } ELObj *Identifier::computeValue(bool force, Interpreter &interp) const { if (builtin_ && preferBuiltin_) return builtin_->computeValue(force, interp); if (value_) return value_; bool preferred = 0; if (defPart_ == unsigned(-1) && !preferBuiltin_) { preferBuiltin_ = 1; preferred = 1; } ASSERT(def_); if (beingComputed_) { if (force) { interp.setNextLocation(defLoc_); interp.message(InterpreterMessages::identifierLoop, StringMessageArg(name())); ((Identifier *)this)->value_ = interp.makeError(); } } else { ((Identifier *)this)->beingComputed_ = 1; if (insn_.isNull()) ((Identifier *)this)->insn_ = Expression::optimizeCompile(((Identifier *)this)->def_, interp, Environment(), 0, InsnPtr()); if (force || def_->canEval(0)) { VM vm(interp); ELObj *v = vm.eval(insn_.pointer()); interp.makePermanent(v); ((Identifier *)this)->value_ = v; } ((Identifier *)this)->beingComputed_ = 0; } if (preferred) preferBuiltin_ = 0; return value_; } ELObj *Identifier::computeBuiltinValue(bool force, Interpreter &interp) const { preferBuiltin_ = 1; ELObj *res = computeValue(force, interp); preferBuiltin_ = 0; return res; } Unit::Unit(const StringC &name) : Named(name), computed_(notComputed) { } bool Unit::defined(unsigned &part, Location &loc) const { if (!def_ && computed_ == notComputed) return 0; part = defPart_; loc = defLoc_; return 1; } void Unit::setDefinition(Owner &expr, unsigned part, const Location &loc) { def_.swap(expr); defPart_ = part; defLoc_ = loc; computed_ = notComputed; } void Unit::setValue(long n) { computed_ = computedExact; exact_ = n; dim_ = 1; defPart_ = unsigned(-1); } void Unit::setValue(double n) { computed_ = computedInexact; inexact_ = n; dim_ = 1; defPart_ = unsigned(-1); } void Unit::tryCompute(bool force, Interpreter &interp) { if (computed_ == notComputed) { computed_ = beingComputed; if (insn_.isNull()) insn_ = Expression::optimizeCompile(def_, interp, Environment(), 0, InsnPtr()); if (force || def_->canEval(0)) { VM vm(interp); ELObj *v = vm.eval(insn_.pointer()); switch (v->quantityValue(exact_, inexact_, dim_)) { case ELObj::noQuantity: if (!interp.isError(v)) { interp.setNextLocation(defLoc_); interp.message(InterpreterMessages::badUnitDefinition, StringMessageArg(name())); } computed_ = computedError; break; case ELObj::longQuantity: computed_ = computedExact; break; case ELObj::doubleQuantity: computed_ = computedInexact; break; default: CANNOT_HAPPEN(); } } if (computed_ == beingComputed) computed_ = notComputed; } else if (computed_ == beingComputed) { interp.setNextLocation(defLoc_); interp.message(InterpreterMessages::unitLoop, StringMessageArg(name())); computed_ = computedError; } } // multiply by 10^valExp // quantity has exponent of 1 ELObj *Unit::resolveQuantity(bool force, Interpreter &interp, long val, int valExp) { tryCompute(force, interp); long result; if (computed_ == computedExact && scale(val, valExp, exact_, result)) return new (interp) LengthObj(result); double x = val; while (valExp > 0) { x *= 10.0; valExp--; } while (valExp < 0) { x /= 10.0; valExp++; } return resolveQuantity(force, interp, x, 1); } // val * 10^valExp * factor // return 0 if it can't be done without overflow bool Unit::scale(long val, int valExp, long factor, long &result) { if (factor <= 0) return 0; // feeble while (valExp > 0) { if (factor > LONG_MAX/10) return 0; valExp--; factor *= 10; } if (val >= 0) { if (val > LONG_MAX/factor) return 0; } else { if (-(unsigned long)val > -(unsigned long)LONG_MIN/factor) return 0; } result = val*factor; while (valExp < 0) { result /= 10; valExp++; } return 1; } ELObj *Unit::resolveQuantity(bool force, Interpreter &interp, double val, int unitExp) { tryCompute(force, interp); double factor; switch (computed_) { case computedExact: factor = exact_; break; case computedInexact: factor = inexact_; break; case computedError: return interp.makeError(); default: return 0; } int resultDim = 0; double resultVal = val; while (unitExp > 0) { resultDim += dim_; resultVal *= factor; unitExp--; } while (unitExp < 0) { resultDim -= dim_; resultVal /= factor; unitExp++; } if (resultDim == 0) return new (interp) RealObj(resultVal); return new (interp) QuantityObj(resultVal, resultDim); } void ELObjDynamicRoot::trace(Collector &c) const { c.trace(obj_); } bool operator==(const StringC &s, const char *p) { for (size_t i = 0; i < s.size(); i++) if (p[i] == '\0' || (unsigned char)p[i] != s[i]) return 0; return p[s.size()] == '\0'; } void Interpreter::installBuiltins() { partIndex_ = unsigned(-1); StringC sysid(makeStringC(DEFAULT_SCHEME_BUILTINS)); StringC src; groveManager_->mapSysid(sysid); if (groveManager_->readEntity(sysid, src)) { Owner in(new InternalInputSource(src, InputSourceOrigin::make())); SchemeParser scm(*this, in); scm.parse(); } endPart(); partIndex_ = 0; } void Interpreter::setDefaultLanguage(Owner &expr, unsigned part, const Location &loc) { defaultLanguageDef_.swap(expr); defaultLanguageDefPart_ = part; defaultLanguageDefLoc_ = loc; } ELObj *Interpreter::defaultLanguage() const { return defaultLanguage_; } bool Interpreter::defaultLanguageSet(unsigned &part,Location &loc) const { if(defaultLanguageDef_) { part = defaultLanguageDefPart_; loc = defaultLanguageDefLoc_; return true; } return false; } void Interpreter::compileDefaultLanguage() { if(defaultLanguageDef_) { InsnPtr insn = Expression::optimizeCompile(defaultLanguageDef_, *this, Environment(), 0, InsnPtr()); VM vm(*this); ELObj *obj = vm.eval(insn.pointer()); if(!obj->asLanguage()) { if(!isError(obj)) { setNextLocation(defaultLanguageDefLoc_); message(InterpreterMessages::defLangDeclRequiresLanguage, ELObjMessageArg(obj, *this)); } return; } makePermanent(obj); defaultLanguage_ = obj; } } void Interpreter::installCharProperties() { //FIXME convert this to tables // NOte that default values are set in the constructors. lookupCharProperty(makeStringC("numeric-equiv"))-> declarePredefined(&numericEquivCPV_); if (!strictMode_) { for (int i = 0; i < 10; i++) numericEquivCPV_.setValue(i+'0', i); } if (style()) { lookupCharProperty(makeStringC("space?"))-> declarePredefined(&isSpaceCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define SPACE #include "charProps.h" #undef SPACE }; for (size_t i = 0; i < SIZEOF(chars); i++) isSpaceCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("record-end?"))-> declarePredefined(&isRecordEndCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define RECORD_END #include "charProps.h" #undef RECORD_END }; for (size_t i = 0; i < SIZEOF(chars); i++) isRecordEndCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("blank?"))-> declarePredefined(&isBlankCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define BLANK #include "charProps.h" #undef BLANK }; for (size_t i = 0; i < SIZEOF(chars); i++) isBlankCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("input-tab?"))-> declarePredefined(&isInputTabCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define INPUT_TAB #include "charProps.h" #undef INPUT_TAB }; for (size_t i = 0; i < SIZEOF(chars); i++) isInputTabCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("input-whitespace?"))-> declarePredefined(&isInputWhitespaceCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define INPUT_WHITESPACE #include "charProps.h" #undef INPUT_WHITESPACE }; for (size_t i = 0; i < SIZEOF(chars); i++) isInputWhitespaceCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("punct?"))-> declarePredefined(&isPunctCPV_); if (!strictMode_) { static struct { Char c; unsigned short num; } chars[] = { #define PUNCT #include "charProps.h" #undef PUNCT }; for (size_t i = 0; i < SIZEOF(chars); i++) isPunctCPV_.setRange(chars[i].c, chars[i].c+chars[i].num-1, true); } lookupCharProperty(makeStringC("script"))-> declarePredefined(&scriptCPV_); if (!strictMode_) { static struct { Char c1, c2; char *suffix; } chars[] = { #define SCRIPT #include "charProps.h" #undef SCRIPT }; StringC prefix = makeStringC("ISO/IEC 10179::1996//Script::"); for (size_t i = 0; i < SIZEOF(chars); i++) { StringC tem(prefix); tem += makeStringC(chars[i].suffix); scriptCPV_.setRange(chars[i].c1, chars[i].c2, storePublicId(tem.data(), tem.size(), Location())); } } lookupCharProperty(makeStringC("glyph-id"))-> declarePredefined(&glyphIdCPV_); // FIXME. Default values? lookupCharProperty(makeStringC("drop-after-line-break?"))-> declarePredefined(&isDropAfterLineBreakCPV_); // FIXME: Values. lookupCharProperty(makeStringC("drop-unless-before-line-break?"))-> declarePredefined(&isDropUnlessBeforeLineBreakCPV_); // FIXME: Values. lookupCharProperty(makeStringC("break-before-priority"))-> declarePredefined(&breakBeforePriorityCPV_); lookupCharProperty(makeStringC("break-after-priority"))-> declarePredefined(&breakAfterPriorityCPV_); if(!strictMode_) { static struct { Char c; unsigned short num; unsigned short bbp; unsigned short bap; } chars[] = { #define BREAK_PRIORITIES #include "charProps.h" #undef BREAK_PRIORITIES }; for (size_t i = 0; i < SIZEOF(chars); ++i) { breakBeforePriorityCPV_.setRange(chars[i].c, chars[i].c + chars[i].num-1, chars[i].bbp); breakAfterPriorityCPV_.setRange(chars[i].c, chars[i].c + chars[i].num-1, chars[i].bap); } } lookupCharProperty(makeStringC("math-class"))-> declarePredefined(&mathClassCPV_); // FIXME: Values. lookupCharProperty(makeStringC("math-font-posture"))-> declarePredefined(&mathFontPostureCPV_); // FIXME: Values. } } void Interpreter::compileCharProperties() { NamedTableIter iter(charPropTable_); CharProp *val; while ((val = iter.next())) val->compile(*this); } CharPropValues *Interpreter::installExtensionCharNIC(Identifier *ident, const StringC &pubid, const Location &loc) { ident->setCharNIC(currentPartIndex(), loc); // FIXME! Shouldn't even get into CVS! return new ELObjCharPropValues; } ELObj *CharProp::value(Char ch, ELObj *def, const Location &loc, Interpreter &interp) { addedProp_ *p=(addedProp_ *)added_(ch); if (p != 0 && p->computed_ != computedOK) { compileAdded_(*p,interp); if(p->computed_ == computedError) { if (!values_) { interp.setNextLocation (loc); interp.message (InterpreterMessages::unknownCharProperty, StringMessageArg (name())); } return interp.makeError(); } ASSERT(p->computed_ == computedOK); } ASSERT(values_); ELObj *tem = values_->value(ch, interp); if(tem) return tem; else if (def) return def; if (defComputed_ != computedOK) { compileDef_ (interp); if (defComputed_ == computedError) return interp.makeError(); ASSERT(defComputed_ == computedOK); } tem = values_->defaultValue(interp); ASSERT(tem); return tem; } void CharProp::setValue(StringC &chars, Owner &expr, unsigned part, const Location &loc) { ASSERT(chars.size()>0); addedPropsVec_.resize (addedPropsVec_.size() + 1); addedProp_ &p = addedPropsVec_.back(); p.chars_.swap(chars); p.part_ = part; p.loc_ = loc; p.expr_.swap(expr); p.computed_ = notComputed; if(!addedProps_) addedProps_ = new CharMap::size_type> (noAddedVal_); for(size_t i = 0; i < p.chars_.size(); ++i) { ASSERT((*addedProps_)[p.chars_[i]] == noAddedVal_); addedProps_->setChar(p.chars_[i],addedPropsVec_.size() - 1); } } void CharProp::declare(Owner &expr, unsigned part, const Location &loc, CharPropValues *values) { ASSERT(!defExpr_); ASSERT(expr); defExpr_.swap(expr); defPart_ = part; defLoc_ = loc; if (values) values_ = values; else if (!values_) { // FIXME! Shall not get into CVS! values_ = new ELObjCharPropValues (); } } void CharProp::declarePredefined(CharPropValues *values) { values_ = values; } bool CharProp::hasAddedValue(Char ch,unsigned &part,Location &loc) const { const addedProp_ *p = added_(ch); if(p) { part = p->part_; loc = p->loc_; return true; } return false; } bool CharProp::declared(unsigned &part, Location &loc) const { if(defExpr_) { part = defPart_; loc = defLoc_; return true; } return false; } void CharProp::compile(Interpreter &interp) { compileDef_(interp); for(NCVector::size_type i = 0; i < addedPropsVec_.size(); ++i) compileAdded_(addedPropsVec_[i],interp); if (!hadError_) { addedProps_.clear(); addedPropsVec_.clear(); } } void CharProp::compileDef_(Interpreter &interp) { switch(defComputed_) { case notComputed: if (defExpr_) { defComputed_ = beingComputed; InsnPtr insn = Expression::optimizeCompile (defExpr_, interp, Environment(), 0, InsnPtr()); VM vm (interp); ELObj *p = vm.eval (insn.pointer()); if (!interp.isError(p) && values_->setDefault(name(), defLoc_, p, interp)) defComputed_ = computedOK; else defComputed_ = computedError; } else if (values_) { defComputed_ = computedOK; } else defComputed_ = computedError; break; case beingComputed: interp.setNextLocation(defLoc_); interp.message(InterpreterMessages::charPropertyLoop, StringMessageArg(name())); defComputed_ = computedError; break; default: ; } } void CharProp::compileAdded_(addedProp_ &added, Interpreter &interp) { switch(added.computed_) { case notComputed: { // Own block since InsnPtr and VM have destructors. // Check that property is declared. if (!values_) { interp.setNextLocation (added.loc_); interp.message (InterpreterMessages::unknownCharProperty, StringMessageArg (name())); added.computed_ = computedError; hadError_ = true; return; } ASSERT(added.expr_); added.computed_ = beingComputed; InsnPtr insn = Expression::optimizeCompile (added.expr_, interp, Environment(), 0, InsnPtr()); VM vm (interp); ELObj *p = vm.eval (insn.pointer()); if (!interp.isError(p) && values_->setValue(name(), added.chars_, added.loc_, p, interp)) added.computed_ = computedOK; else { added.computed_ = computedError; hadError_ = true; } break; } case beingComputed: interp.setNextLocation(added.loc_); interp.message(InterpreterMessages::charPropertyLoop, StringMessageArg(name())); added.computed_ = computedError; break; default: ; } } const CharProp::addedProp_ *CharProp::added_(Char ch) const { if (!addedProps_) return 0; NCVector::size_type n((*addedProps_)[ch]); if (n == noAddedVal_) return 0; return &addedPropsVec_[n]; } bool IntegerCharPropValues::setDefault(const StringC &name, const Location &loc, ELObj *obj, Interpreter &interp) { if (!obj->exactIntegerValue(def_)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotInteger, StringMessageArg(name), ELObjMessageArg(obj, interp)); return false; } return true; } bool IntegerCharPropValues::setValue(const StringC &name, const StringC &chars, const Location &loc, ELObj *obj, Interpreter &interp) { ValT_ v; if (!obj->exactIntegerValue(v.l_)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotInteger, StringMessageArg(name), ELObjMessageArg(obj, interp)); return false; } v.hasValue_ = true; for(size_t i=0; iexactIntegerValue(def_) || (defFalse_ = (!obj->isTrue()))) return true; interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotIntegerOrFalse, StringMessageArg(name), ELObjMessageArg(obj, interp)); } bool MaybeIntegerCharPropValues::setValue(const StringC &name, const StringC &chars, const Location &loc, ELObj *obj, Interpreter &interp) { ValT_ v; if (obj->exactIntegerValue(v.l_) || (v.isFalse_ = (!obj->isTrue()))) { v.hasValue_ = true; for (size_t i = 0; i < chars.size(); ++i) map_.setChar(chars[i], v); return true; } interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotIntegerOrFalse, StringMessageArg(name), ELObjMessageArg(obj, interp)); return false; } ELObj *MaybeIntegerCharPropValues::value(Char ch, Interpreter &interp) const { ValT_ v(map_[ch]); if (v.hasValue_) { if (v.isFalse_) return interp.makeFalse(); else return interp.makeInteger(v.l_); } return 0; } ELObj *MaybeIntegerCharPropValues::defaultValue(Interpreter &interp) const { if (defFalse_) return interp.makeFalse(); return interp.makeInteger(def_); } bool BooleanCharPropValues::setDefault(const StringC &, const Location &, ELObj *obj, Interpreter &) { def_ = obj->isTrue(); return 1; } bool BooleanCharPropValues::setValue(const StringC &, const StringC &chars, const Location &, ELObj *obj, Interpreter &) { ValT_ v; v.hasValue_ = true; v.b_ = obj->isTrue(); for (size_t i = 0; i < chars.size(); ++i) map_.setChar (chars[i], v); return true; } ELObj *BooleanCharPropValues::value(Char ch, Interpreter &interp) const { ValT_ v(map_[ch]); if (v.hasValue_) return v.b_ ? interp.makeTrue() : interp.makeFalse(); return 0; } ELObj *BooleanCharPropValues::defaultValue(Interpreter &interp) const { return def_ ? interp.makeTrue() : interp.makeFalse(); } bool PublicIdCharPropValues::setDefault(const StringC &name, const Location &loc, ELObj *obj, Interpreter &interp) { const Char *c; size_t n; if (obj->stringData (c, n)) { def_ = interp.storePublicId(c, n, loc); return 1; } if (obj == interp.makeFalse()) { def_ = 0; return 1; } interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotPublicId, StringMessageArg(name), ELObjMessageArg(obj, interp)); return 0; } bool PublicIdCharPropValues::setValue(const StringC &name, const StringC &chars, const Location &loc, ELObj *obj, Interpreter &interp) { const Char *c; size_t n; FOTBuilder::PublicId pubid; if (obj->stringData(c, n)) pubid = interp.storePublicId(c, n, loc); else if (obj == interp.makeFalse()) pubid = 0; else { interp.setNextLocation(loc); interp.message(InterpreterMessages::charPropertyNotPublicId, StringMessageArg(name), ELObjMessageArg(obj, interp)); return 0; } for (size_t i = 0; i < chars.size(); ++i) map_[chars[i]] = pubid; return 1; } ELObj *PublicIdCharPropValues::value(Char, Interpreter &) const { } ELObj *PublicIdCharPropValues::defaultValue(Interpreter &) const { } bool SymbolCharPropValues::setDefault(const StringC &, const Location &, ELObj *, Interpreter &) { } bool SymbolCharPropValues::setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &) { } ELObj *SymbolCharPropValues::value(Char, Interpreter &) const { } ELObj *SymbolCharPropValues::defaultValue(Interpreter &) const { } bool ELObjCharPropValues::setDefault(const StringC &, const Location &, ELObj *obj, Interpreter &interp) { ASSERT(obj); interp.makePermanent (obj); def_ = obj; } bool ELObjCharPropValues::setValue(const StringC &, const StringC &chars, const Location &, ELObj *obj, Interpreter &interp) { ASSERT(obj); interp.makePermanent (obj); for(size_t i = 0; i < chars.size(); ++i) map_.setChar(chars[i], obj); } ELObj *ELObjCharPropValues::value(Char ch, Interpreter &) const { return map_[ch]; } ELObj *ELObjCharPropValues::defaultValue(Interpreter &interp) const { return def_; } void Interpreter::installFeatures(const FOTBuilder::Feature *backendFeatures) { feature_[combineChar].rcsname = makeStringC("combine-char"); feature_[keyword].rcsname = makeStringC("keyword"); feature_[multiSource].rcsname = makeStringC("multi-source"); feature_[multiResult].rcsname = makeStringC("multi-result"); feature_[regexp].rcsname = makeStringC("regexp"); feature_[word].rcsname = makeStringC("word"); feature_[hytime].rcsname = makeStringC("hytime"); feature_[charset].rcsname = makeStringC("charset"); feature_[expression].rcsname = makeStringC("expression"); feature_[multiProcess].rcsname = makeStringC("multi-process"); feature_[query].rcsname = makeStringC("query"); feature_[sideBySide].rcsname = makeStringC("side-by-side"); feature_[sideline].rcsname = makeStringC("sideline"); feature_[alignedColumn].rcsname = makeStringC("aligned-column"); feature_[bidi].rcsname = makeStringC("bidi"); feature_[vertical].rcsname = makeStringC("vertical"); feature_[math].rcsname = makeStringC("math"); feature_[table].rcsname = makeStringC("table"); feature_[tableAutoWidth].rcsname = makeStringC("table-auto-width"); feature_[simplePage].rcsname = makeStringC("simple-page"); feature_[page].rcsname = makeStringC("page"); feature_[multiColumn].rcsname = makeStringC("multi-column"); feature_[nestedColumnSet].rcsname = makeStringC("nested-column-set"); feature_[generalIndirect].rcsname = makeStringC("general-indirect"); feature_[inlineNote].rcsname = makeStringC("inline-note"); feature_[glyphAnnotation].rcsname = makeStringC("glyph-annotation"); feature_[emphasizingMark].rcsname = makeStringC("emphasizing-mark"); feature_[includedContainer].rcsname = makeStringC("included-container"); feature_[actualCharacteristic].rcsname = makeStringC("actual-characteristic"); feature_[online].rcsname = makeStringC("online"); feature_[fontInfo].rcsname = makeStringC("font-info"); feature_[crossReference].rcsname = makeStringC("cross-reference"); for (int i = 0; i < nFeatures; i++) feature_[i].supported = notSupported; feature_[charset].supported = partiallySupported; feature_[expression].supported = supported; feature_[multiProcess].supported = supported; feature_[query].supported = partiallySupported; feature_[actualCharacteristic].supported = supported; feature_[crossReference].supported = supported; if (backendFeatures) for (const FOTBuilder::Feature *b = backendFeatures; b->name; b++) { StringC name = makeStringC(b->name); for (int i = 0; i < nFeatures; i++) if (name == feature_[i].rcsname) { feature_[i].supported = b->partial ? partiallySupported : supported; break; } } feature_[noFeature].declared = 1; for (int i = 1; i < nFeatures; i++) feature_[i].declared = 0; if (!strictMode_) for (int i = 0; i < nFeatures; i++) if (feature_[i].supported != notSupported) feature_[i].declared = 1; if (!style()) { feature_[query].declared = 1; feature_[expression].declared = 1; } } bool Interpreter::requireFeature(const Interpreter::Feature &f, const Location &loc) { //FIXME: Hack to avoid warnings about features used in builtins.dsl if (!feature_[f].declared && !Identifier::preferBuiltin_ && (partIndex_ != unsigned(-1))) { setNextLocation(loc); message(InterpreterMessages::missingFeature, StringMessageArg(feature_[f].rcsname)); } return feature_[f].declared; } bool Interpreter::convertFeature(const StringC &name, Interpreter::Feature &f) { for (int i = 1; i < nFeatures; i++) if (feature_[i].rcsname == name) { f = Feature(i); return 1; } return 0; } void Interpreter::explicitFeatures() { if (!explicitFeatures_) { explicitFeatures_ = 1; for (int i = 1; i < nFeatures; i++) feature_[i].declared = 0; if (!style()) { feature_[query].declared = 1; feature_[expression].declared = 1; } } } void Interpreter::declareFeature(const StringC &name) { Feature feature; if (!convertFeature(name, feature)) { message(InterpreterMessages::unknownFeature, StringMessageArg(name)); return; } declareFeature(feature); } void Interpreter::declareFeature(const Feature &feature) { Status &f = feature_[feature]; f.declared = 1; if (f.supported == notSupported) message(InterpreterMessages::unsupportedFeature, StringMessageArg(f.rcsname)); else if (f.supported == partiallySupported) message(InterpreterMessages::partiallySupportedFeature, StringMessageArg(f.rcsname)); // Handle implied features switch (feature) { case query: declareFeature(multiProcess); break; case tableAutoWidth: declareFeature(table); break; case nestedColumnSet: declareFeature(multiColumn); break; case multiColumn: declareFeature(page); break; default:; // do nothing } } bool Identifier::requireFeature(Interpreter &interp, const Location &loc, bool fo) const { if ((fo ? flowObjPart_ : defPart_) == unsigned(-1)) return interp.requireFeature(Interpreter::Feature(feature_), loc); else return 1; } void Identifier::setFeature(int f) { feature_ = f; } void Interpreter::installModules() { module_[baseabs].rcsname = makeStringC("BASEABS"); module_[prlgabs0].rcsname = makeStringC("PRLGABS0"); module_[prlgabs1].rcsname = makeStringC("PRLGABS1"); module_[instabs].rcsname = makeStringC("INSTABS"); module_[basesds0].rcsname = makeStringC("BASESDS0"); module_[basesds1].rcsname = makeStringC("BASESDS1"); module_[instsds0].rcsname = makeStringC("INSTSDS0"); module_[subdcabs].rcsname = makeStringC("SUBDCABS"); module_[sdclabs].rcsname = makeStringC("SDCLABS"); module_[sdclsds].rcsname = makeStringC("SDCLSDS"); module_[prlgsds].rcsname = makeStringC("PRLGSDS"); module_[instsds1].rcsname = makeStringC("INSTSDS1"); module_[dtgabs].rcsname = makeStringC("DTGABS"); module_[rankabs].rcsname = makeStringC("RANKABS"); module_[srabs].rcsname = makeStringC("SRABS"); module_[srsds].rcsname = makeStringC("SRSDS"); module_[linkabs].rcsname = makeStringC("LINKABS"); module_[linksds].rcsname = makeStringC("LINKSDS"); module_[subdcsds].rcsname = makeStringC("SUBDCSDS"); module_[fpiabs].rcsname = makeStringC("FPIABS"); module_[baseabs].appname = makeStringC("base abstract"); module_[prlgabs0].appname = makeStringC("prolog abstract level 0"); module_[prlgabs1].appname = makeStringC("prolog abstract level 1"); module_[instabs].appname = makeStringC("instance abstract"); module_[basesds0].appname = makeStringC("base SGML document string level 0"); module_[basesds1].appname = makeStringC("base SGML document string level 1"); module_[instsds0].appname = makeStringC("instance SGML document string"); module_[subdcabs].appname = makeStringC("subdoc abstract"); module_[sdclabs].appname = makeStringC("SGML declaration abstract"); module_[sdclsds].appname = makeStringC("SGML declaration SGML document string"); module_[prlgsds].appname = makeStringC("prolog SGML document string"); module_[instsds1].appname = makeStringC("instance SGML document string level 1"); module_[dtgabs].appname = makeStringC("datatag abstract"); module_[rankabs].appname = makeStringC("rank abstract"); module_[srabs].appname = makeStringC("shortref abstract"); module_[srsds].appname = makeStringC("shortref SGML document string"); module_[linkabs].appname = makeStringC("link abstract"); module_[linksds].appname = makeStringC("link SGML document string"); module_[subdcsds].appname = makeStringC("subdoc SGML document string"); module_[fpiabs].appname = makeStringC("formal public identifier abstract"); for (int i = 0; i < nModules; i++) module_[i].supported = notSupported; module_[baseabs].supported = supported; module_[prlgabs0].supported = supported; module_[instabs].supported = supported; module_[prlgabs1].supported = supported; module_[basesds0].supported = supported; module_[instsds0].supported = supported; module_[subdcabs].supported = supported; for (int i = 0; i < nModules; i++) module_[i].declared = 0; module_[baseabs].declared = 1; module_[prlgabs0].declared = 1; module_[instabs].declared = 1; if (!style()) module_[prlgabs1].declared = 1; if (!strictMode()) { module_[basesds0].declared = 1; module_[instsds0].declared = 1; module_[subdcabs].declared = 1; module_[prlgabs1].declared = 1; } } void Interpreter::explicitModules() { if (!explicitModules_) { explicitModules_ = 1; for (int i = 0; i < nModules; i++) module_[i].declared = 0; module_[baseabs].declared = 1; module_[prlgabs0].declared = 1; module_[instabs].declared = 1; if (!style()) module_[prlgabs1].declared = 1; } } void Interpreter::addModule(const StringC &name) { for (int i = 0; i < nModules; i++) if (module_[i].rcsname == name) { module_[i].declared = 1; return; } message(InterpreterMessages::unknownModule, StringMessageArg(name)); } void Interpreter::checkGrovePlan() { for (int i = 0; i < nModules; i++) if (module_[i].supported != notSupported) { if (!module_[i].declared) message(InterpreterMessages::cantOmitModule, StringMessageArg(module_[i].appname)); } else { if (module_[i].declared) message(InterpreterMessages::cantAddModule, StringMessageArg(module_[i].appname)); } } TransformationMode *Interpreter::transformationMode() { return &transformationMode_; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Interpreter.h0000644000021000000240000010242407067706566013365 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Interpreter_INCLUDED #define Interpreter_INCLUDED 1 #include "ELObj.h" #include "Expression.h" #include #include #include #include "Collector.h" #include #include #include #include "Style.h" #include "SosofoObj.h" #include "ProcessingMode.h" #include "NumberCache.h" #include #include "FOTBuilder.h" #include #include #include "Node.h" #include "GroveManager.h" #include "Pattern.h" #include #include "TransformationMode.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Interpreter; class Identifier : public Named { public: enum SyntacticKey { notKey, keyQuote, keyLambda, keyIf, keyCond, keyAnd, keyOr, keyCase, keyLet, keyLetStar, keyLetrec, keyQuasiquote, keyUnquote, keyUnquoteSplicing, keyDefine, keyElse, keyArrow, keySet, keyBegin, keyThereExists, keyForAll, keySelectEach, keyUnionForEach, keyMake, keyStyle, keyWithMode, keyDefineUnit, keyQuery, keyElement, keyDefault, keyRoot, keyId, keyMode, keyDeclareInitialValue, keyDeclareCharacteristic, keyDeclareFlowObjectClass, keyDeclareCharCharacteristicAndProperty, keyDeclareReferenceValueType, keyDeclareDefaultLanguage, keyDeclareCharProperty, keyDefinePageModel, keyDefineColumnSetModel, keyDefineLanguage, keyAddCharProperties, keyUse, keyLabel, keyContentMap, keyIsKeepWithPrevious, keyIsKeepWithNext, keySpaceBefore, keySpaceAfter, keyLeftHeader, keyCenterHeader, keyRightHeader, keyLeftFooter, keyCenterFooter, keyRightFooter, keyDestination, keyType, keyCoalesceId, keyIsDisplay, keyScale, keyMaxWidth, keyMaxHeight, keyEntitySystemId, keyNotationSystemId, keyPositionPointX, keyPositionPointY, keyEscapementDirection, keyBreakBeforePriority, keyBreakAfterPriority, keyOrientation, keyLength, keyChar, keyGlyphId, keyIsSpace, keyIsRecordEnd, keyIsInputTab, keyIsInputWhitespace, keyIsPunct, keyIsDropAfterLineBreak, keyIsDropUnlessBeforeLineBreak, keyMathClass, keyMathFontPosture, keyScript, keyStretchFactor, keyKeep, keyBreakBefore, keyBreakAfter, keyIsMayViolateKeepBefore, keyIsMayViolateKeepAfter, keyBeforeRowBorder, keyAfterRowBorder, keyBeforeColumnBorder, keyAfterColumnBorder, keyColumnNumber, keyRowNumber, keyNColumnsSpanned, keyNRowsSpanned, keyWidth, keyIsStartsRow, keyIsEndsRow, keyTableWidth, keyMultiModes, keyData, keyMin, keyMax, keyIsConditional, keyPriority, keyGridNRows, keyGridNColumns, keyRadical, keyNull, keyIsRcs, keyParent, keyActive, keyAttributes, keyChildren, keyRepeat, keyPosition, keyOnly, keyClass, keyImportance, keyDeclareClassAttribute, keyDeclareIdAttribute, keyDeclareFlowObjectMacro, keyOrElement, keyPositionPreference, keyCollate, keyToupper, keyTolower, keySymbol, keyOrder, keyForward, keyBackward, keyWhitePoint, keyBlackPoint, keyRange, keyRangeAbc, keyRangeLmn, keyRangeA, keyDecodeAbc, keyDecodeLmn, keyDecodeA, keyMatrixAbc, keyMatrixLmn, keyMatrixA, keyArchitecture, keyDefineTransliterationMap, keyNode, keySubgrove, keyAdd, keyRemove, keySub, keySortChildren, keyOptional, keyUnique, keyProperty, keyResultPath, }; enum { lastSyntacticKey = keyWithMode }; Identifier(const StringC &name); // Return 0 is value can't yet be computed. ELObj *computeValue(bool force, Interpreter &) const; ELObj *computeBuiltinValue(bool force, Interpreter &) const; bool syntacticKey(SyntacticKey &) const; void setSyntacticKey(SyntacticKey); bool defined(unsigned &, Location &) const; void setDefinition(Owner &, unsigned part, const Location &); void setBuiltinDefinition(Owner &, unsigned part, const Location &); void setValue(ELObj *, unsigned defPart = unsigned(-1)); bool evaluated() const; const ConstPtr &inheritedC() const; bool inheritedCDefined(unsigned &, Location &) const; bool charNICDefined(unsigned &, Location &) const; void setCharNIC(unsigned, const Location &); void setInheritedC(const ConstPtr &); void setInheritedC(const ConstPtr &, unsigned, const Location &); FlowObj *flowObj() const; bool flowObjDefined(unsigned &, Location &) const; void setFlowObj(FlowObj *); void setFlowObj(FlowObj *, unsigned part, const Location &); void setFeature(int); bool requireFeature(Interpreter &, const Location &, bool fo = 0) const; private: unsigned defPart_; Owner def_; InsnPtr insn_; // Value in top-level environment. ELObj *value_; // must be permanent FlowObj *flowObj_; // prototype FlowObj with this name unsigned flowObjPart_; Location flowObjLoc_; Location defLoc_; SyntacticKey syntacticKey_; bool beingComputed_; bool charNIC_; ConstPtr inheritedC_; unsigned inheritedCPart_; Location inheritedCLoc_; void maybeSaveBuiltin(); Identifier *builtin_; static bool preferBuiltin_; friend class Interpreter; // FIXME This should be Interpreter::Feature int feature_; }; class Unit : public Named { public: Unit(const StringC &); void setValue(long); void setValue(double); bool defined(unsigned &, Location &) const; // return 0 if it can't be done ELObj *resolveQuantity(bool force, Interpreter &, double val, int unitExp); ELObj *resolveQuantity(bool force, Interpreter &, long val, int valExp); void setDefinition(Owner &, unsigned part, const Location &); private: void tryCompute(bool force, Interpreter &); static bool scale(long val, int valExp, long num, long &result); unsigned defPart_; Location defLoc_; Owner def_; InsnPtr insn_; enum { notComputed, beingComputed, computedExact, computedInexact, computedError } computed_; union { long exact_; double inexact_; }; int dim_; }; class ELObjDynamicRoot : public Collector::DynamicRoot { public: ELObjDynamicRoot(Collector &c, ELObj *obj = 0) : Collector::DynamicRoot(c), obj_(obj) { } void operator=(ELObj *obj) { obj_ = obj; } operator ELObj *() const { return obj_; } private: void trace(Collector &) const; ELObj *obj_; }; struct CharPart { Char c; unsigned defPart; }; struct ELObjPart { ELObjPart(); ELObjPart(ELObj *x, unsigned y); void operator=(const ELObjPart &); bool operator==(const ELObjPart &) const; bool operator!=(const ELObjPart &) const; ELObj *obj; unsigned defPart; }; class CharPropValues { public: virtual bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &)=0; virtual bool setValue(const StringC &,const StringC &,const Location &, ELObj *, Interpreter &)=0; virtual ELObj *value(Char, Interpreter &) const =0; virtual ELObj *defaultValue(Interpreter &) const =0; }; // These have to be in the header file, see Interpreter. class IntegerCharPropValues : public CharPropValues { public: IntegerCharPropValues(long def=0) : def_(def) {} long getValue(Char) const; void setRange(Char, Char, long); private: IntegerCharPropValues(const IntegerCharPropValues &); // Undefined. IntegerCharPropValues &operator=(const IntegerCharPropValues &); // Undefined long def_; struct ValT_ { long l_; bool hasValue_; ValT_() : hasValue_(false) {} ValT_(long l) : hasValue_(true), l_(l) {} bool operator==(const ValT_ &v) const { return (hasValue_==v.hasValue_) && (!hasValue_ || l_==v.l_); } bool operator!=(const ValT_& v) const { return !(*this == v); } }; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; class MaybeIntegerCharPropValues : public CharPropValues { public: MaybeIntegerCharPropValues(bool defFalse=true, long def=0) : defFalse_(defFalse), def_(def) {} // Returns true and sets 2nd arg if not #f, otherwise returns false. bool getValue(Char, long &) const; void setRange(Char, Char, long); void setValue(Char, long); private: MaybeIntegerCharPropValues(const MaybeIntegerCharPropValues &); // Undefined. MaybeIntegerCharPropValues &operator=(const MaybeIntegerCharPropValues &); // Above undefined. long def_; bool defFalse_; struct ValT_ { long l_; bool hasValue_; bool isFalse_; ValT_() : hasValue_(false) {} ValT_(long l) : l_(l), hasValue_(true), isFalse_(false) {} bool operator==(const ValT_ &v) const { return (hasValue_==v.hasValue_) && (!hasValue_ || (isFalse_ && v.isFalse_) || l_==v.l_); } bool operator!=(const ValT_& v) const { return !(*this == v); } }; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; class BooleanCharPropValues : public CharPropValues { public: BooleanCharPropValues(bool def=false) : def_(def) {} bool getValue(Char) const; void setRange(Char, Char, bool); private: BooleanCharPropValues(const BooleanCharPropValues &); // Undefined. BooleanCharPropValues &operator=(const BooleanCharPropValues &); // Undefined. bool def_; struct ValT_ { bool b_:1; bool hasValue_:1; ValT_() : hasValue_(false) {} ValT_(bool b) : b_(b), hasValue_(true) {} bool operator==(const ValT_ &v) const { return (hasValue_==v.hasValue_) && (!hasValue_ || b_==v.b_); } bool operator!=(const ValT_& v) const { return !(*this == v); } }; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; class PublicIdCharPropValues : public CharPropValues { public: PublicIdCharPropValues(FOTBuilder::PublicId def=0) : def_(def) {} FOTBuilder::PublicId getValue(Char) const; void setRange(Char, Char, const FOTBuilder::PublicId); private: PublicIdCharPropValues(const PublicIdCharPropValues &); // Undefined. PublicIdCharPropValues &operator=(const PublicIdCharPropValues &); // Undefined. FOTBuilder::PublicId def_; struct ValT_ { FOTBuilder::PublicId p_; bool hasValue_; ValT_() : hasValue_(false) {} ValT_(FOTBuilder::PublicId p) : hasValue_(true), p_(p) {} bool operator==(const ValT_ &v) const { return (hasValue_==v.hasValue_) && (!hasValue_ || p_==v.p_); } bool operator!=(const ValT_& v) const { return !(*this == v); } }; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; class SymbolCharPropValues : public CharPropValues { public: SymbolCharPropValues(FOTBuilder::Symbol def=FOTBuilder::symbolFalse) : def_(def) {} FOTBuilder::Symbol getValue(Char) const; void setRange(Char, Char, FOTBuilder::Symbol); private: SymbolCharPropValues(const SymbolCharPropValues &); // Undefined. SymbolCharPropValues &operator=(const SymbolCharPropValues &); // Undefined. FOTBuilder::Symbol def_; struct ValT_ { FOTBuilder::Symbol s_; bool hasValue_; ValT_() : hasValue_(false) {} ValT_(FOTBuilder::Symbol s) : hasValue_(true), s_(s) {} bool operator==(const ValT_ &v) const { return (hasValue_==v.hasValue_) && (!hasValue_ || s_==v.s_); } bool operator!=(const ValT_& v) const { return !(*this == v); } }; CharMap map_; bool setDefault(const StringC &, const Location &, ELObj *, Interpreter &); bool setValue(const StringC &, const StringC &, const Location &, ELObj *,Interpreter &); ELObj *value(Char, Interpreter &) const; ELObj *defaultValue(Interpreter &) const; }; class CharProp : public Named { public: CharProp(const StringC& name); // def is used if char doesn't have property. If def==0, property default // value is used. ELObj *value(Char ch,ELObj *def, const Location &, Interpreter &); // Use only before compile is called. // Set value for characters in string. void setValue(StringC &,Owner &,unsigned,const Location&); void declare(Owner &, unsigned, const Location&, CharPropValues * =0); void declarePredefined(CharPropValues *); bool hasAddedValue(Char,unsigned&,Location&) const; bool declared(unsigned&,Location&) const; void compile(Interpreter &); protected: enum computedType_ { notComputed, beingComputed, computedError, computedOK }; // Default value. unsigned defPart_; Location defLoc_; Owner defExpr_; computedType_ defComputed_; // Added properties. struct addedProp_ { StringC chars_; unsigned part_; Location loc_; Owner expr_; computedType_ computed_; }; // Have to store in NCVector because of Owner non-copyable. NCVector addedPropsVec_; // We have to store indices, since NCVector isn't really NC (ofcourse). Owner::size_type> > addedProps_; enum { noAddedVal_ = NCVector::size_type(-1) }; CharPropValues *values_; // True if errors when compiling any of the added values. bool hadError_; void compileDef_(Interpreter &); void compileAdded_(addedProp_ &,Interpreter &); const addedProp_ *added_(Char) const; private: CharProp(const CharProp &); // Undefined. CharProp &operator=(const CharProp &); // Undefined. }; class Interpreter : public Collector, public Pattern::MatchContext, public NumberCache, public Messenger { public: enum PortName { portNumerator, portDenominator, portPreSup, portPreSub, portPostSup, portPostSub, portMidSup, portMidSub, portOverMark, portUnderMark, portOpen, portClose, portDegree, portOperator, portLowerLimit, portUpperLimit, portHeader, portFooter }; enum { nPortNames = portFooter + 1 }; Interpreter(GroveManager *, Messenger *, int unitsPerInch, bool debugMode, bool dsssl2, bool style, bool strictMode, const FOTBuilder::Description &); void endPart(); void dEndPart(); FalseObj *makeFalse(); TrueObj *makeTrue(); NilObj *makeNil(); SymbolObj *makeSymbol(const StringC &); KeywordObj *makeKeyword(const StringC &); IntegerObj *makeInteger(long n); ErrorObj *makeError(); UnspecifiedObj *makeUnspecified(); PairObj *makePair(ELObj *, ELObj *); ELObj *convertGlyphId(const Char *, size_t, const Location &); bool isError(const ELObj *) const; bool isUnspecified(const ELObj *) const; CharObj *makeChar(Char); ELObj *makeLengthSpec(const FOTBuilder::LengthSpec &); AddressObj *makeAddressNone(); NodeListObj *makeEmptyNodeList(); void dispatchMessage(Message &); void dispatchMessage(const Message &); Identifier *lookup(const StringC &); Unit *lookupUnit(const StringC &); FunctionObj *lookupExternalProc(const StringC &); CharProp *lookupCharProperty(const StringC &); int unitsPerInch() const; unsigned currentPartIndex() const; const FOTBuilder::Description &fotbDescr() const; void compile(const NodePtr &); static StringC makeStringC(const char *); SymbolObj *portName(PortName); ELObj *cValueSymbol(FOTBuilder::Symbol); void compileCharProperties(); // Map of LexCategory XcharMap lexCategory_; static void normalizeGeneralName(const NodePtr &, StringC &); GroveManager *groveManager() const; StyleObj *initialStyle() const; StyleObj *borderTrueStyle() const; StyleObj *borderFalseStyle() const; bool convertBooleanC(ELObj *, const Identifier *, const Location &, bool &); bool convertPublicIdC(ELObj *, const Identifier *, const Location &, FOTBuilder::PublicId &); bool convertStringC(ELObj *, const Identifier *, const Location &, StringC &); bool convertLengthC(ELObj *, const Identifier *, const Location &, FOTBuilder::Length &); bool convertLengthSpecC(ELObj *, const Identifier *, const Location &, FOTBuilder::LengthSpec &); bool convertLetter2C(ELObj *, const Identifier *, const Location &, FOTBuilder::Letter2 &); bool convertOptLengthSpecC(ELObj *, const Identifier *, const Location &, FOTBuilder::OptLengthSpec &); bool convertCharC(ELObj *, const Identifier *, const Location &, Char &); bool convertColorC(ELObj *, const Identifier *, const Location &, ColorObj *&); bool convertOptColorC(ELObj *, const Identifier *, const Location &, ColorObj *&); // FIXME allow inexact value bool convertIntegerC(ELObj *, const Identifier *, const Location &, long &); bool convertOptPositiveIntegerC(ELObj *, const Identifier *, const Location &, long &); bool convertRealC(ELObj *, const Identifier *, const Location &, double &); bool convertEnumC(const FOTBuilder::Symbol *, size_t, ELObj *, const Identifier *, const Location &, FOTBuilder::Symbol &); bool convertEnumC(ELObj *, const Identifier *, const Location &, FOTBuilder::Symbol &); void invalidCharacteristicValue(const Identifier *ident, const Location &loc); bool convertLengthSpec(ELObj *, FOTBuilder::LengthSpec &); bool convertToPattern(ELObj *, const Location &, Pattern &); const ConstPtr &charMapC() const; const ConstPtr &tableBorderC() const; const ConstPtr &cellBeforeRowBorderC() const; const ConstPtr &cellAfterRowBorderC() const; const ConstPtr &cellBeforeColumnBorderC() const; const ConstPtr &cellAfterColumnBorderC() const; const ConstPtr &fractionBarC() const; const char *storePublicId(const Char *, size_t, const Location &); unsigned allocGlyphSubstTableUniqueId(); bool lookupNodeProperty(const StringC &, ComponentName::Id &); bool debugMode() const; bool dsssl2() const; bool style() const; bool strictMode() const; void setNodeLocation(const NodePtr &); void setDefaultLanguage(Owner &,unsigned part,const Location &); ELObj *defaultLanguage() const; bool defaultLanguageSet(unsigned &,Location &) const; void compileDefaultLanguage(); void makeReadOnly(ELObj *); ProcessingMode *lookupProcessingMode(const StringC &); ProcessingMode *initialProcessingMode(); TransformationMode *transformationMode(); void addClassAttributeName(const StringC &name); void addIdAttributeName(const StringC &name); void installInitialValue(Identifier *, Owner &); void installExtensionInheritedC(Identifier *, const StringC &, const Location &); CharPropValues *installExtensionCharNIC(Identifier *, const StringC &, const Location &); void installExtensionFlowObjectClass(Identifier *, const StringC &, const Location &); // Return 0 if an invalid number. ELObj *convertNumber(const StringC &, int radix = 10); bool convertCharName(const StringC &str, Char &c) const; enum LexCategory { lexLetter, // a - z A - Z lexOtherNameStart, // !$%&*/<=>?~_^: lexAddNameStart, lexDigit, // 0-9 lexOtherNumberStart, // -+. lexOther, lexDelimiter, // ;()" lexWhiteSpace, lexAddWhiteSpace }; LexCategory lexCategory(Xchar); void addStandardChar(const StringC &, const StringC &); void addSdataEntity(const StringC &, const StringC &, const StringC &); void addNameChar(const StringC &); void addSeparatorChar(const StringC &); void setCharRepertoire(const StringC &); enum Feature { noFeature, combineChar, keyword, multiSource, multiResult, regexp, word, hytime, charset, expression, multiProcess, query, sideBySide, sideline, alignedColumn, bidi, vertical, math, table, tableAutoWidth, simplePage, page, multiColumn, nestedColumnSet, generalIndirect, inlineNote, glyphAnnotation, emphasizingMark, includedContainer, actualCharacteristic, online, fontInfo, crossReference }; enum { nFeatures = crossReference + 1 }; enum Support { notSupported, partiallySupported, supported }; struct Status { bool declared; Support supported; StringC rcsname; StringC appname; }; bool convertFeature(const StringC &, Feature &); void explicitFeatures(); void declareFeature(const StringC &); void declareFeature(const Feature &); bool requireFeature(const Feature &, const Location &); enum Module { baseabs, prlgabs0, prlgabs1, instabs, basesds0, basesds1, instsds0, subdcabs, sdclabs, sdclsds, prlgsds, instsds1, dtgabs, rankabs, srabs, srsds, linkabs, linksds, subdcsds, fpiabs }; enum { nModules = fpiabs + 1 }; void explicitModules(); void addModule(const StringC &); private: Interpreter(const Interpreter &); // undefined void operator=(const Interpreter &); // undefined void installSyntacticKeys(); void installPortNames(); void installCValueSymbols(); void installPrimitives(); void installPrimitive(const char *, PrimitiveObj *, Feature f); void installXPrimitive(const char *, const char *, PrimitiveObj *); void installBuiltins(); void installUnits(); void installCharNames(); void installInheritedCs(); void installInheritedC(const char *, InheritedC *); void installInheritedCProc(const Identifier *); void installFlowObjs(); void installSdata(); void installNodeProperties(); void installCharProperties(); void installFeatures(const FOTBuilder::Feature *); void installModules(); void checkGrovePlan(); void compileInitialValues(); bool sdataMap(GroveString, GroveString, GroveChar &) const; static bool convertUnicodeCharName(const StringC &str, Char &c); bool convertToPattern(ELObj *obj, const Location &loc, bool isChild, IList &list); bool patternAddAttributeQualifiers(ELObj *obj, const Location &loc, Pattern::Element &elem); enum { convertAllowBoolean = 01, convertAllowSymbol = 02, convertAllowNumber = 04 }; ELObj *convertFromString(ELObj *, unsigned hints, const Location &); ELObj *convertNumberFloat(const StringC &); bool scanSignDigits(const StringC &str, size_t &i, int &n); Unit *scanUnit(const StringC &str, size_t i, int &unitExp); NilObj *theNilObj_; TrueObj *theTrueObj_; FalseObj *theFalseObj_; ErrorObj *theErrorObj_; UnspecifiedObj *theUnspecifiedObj_; typedef PointerTable SymbolTable; SymbolTable symbolTable_; NamedTable identTable_; NamedTable unitTable_; HashTable externalProcTable_; Messenger *messenger_; const FOTBuilder::Description &fotbDescr_; unsigned partIndex_; unsigned dPartIndex_; int unitsPerInch_; unsigned nInheritedC_; GroveManager *groveManager_; ProcessingMode initialProcessingMode_; NamedTable processingModeTable_; SymbolObj *portNames_[nPortNames]; ELObj *cValueSymbols_[FOTBuilder::nSymbols]; HashTable namedCharTable_; HashTable sdataEntityNameTable_; HashTable sdataEntityTextTable_; Vector initialValueNames_; NCVector > initialValueValues_; size_t currentPartFirstInitialValue_; StyleObj *initialStyle_; StyleObj *borderTrueStyle_; StyleObj *borderFalseStyle_; ConstPtr charMapC_; ConstPtr tableBorderC_; ConstPtr cellBeforeRowBorderC_; ConstPtr cellAfterRowBorderC_; ConstPtr cellBeforeColumnBorderC_; ConstPtr cellAfterColumnBorderC_; ConstPtr fractionBarC_; class StringSet { public: StringSet(); const char *store(String &); static unsigned long hash(const String &); static inline const String &key(const String &str) { return str; } private: OwnerTable, String, StringSet, StringSet> table_; }; StringSet publicIds_; unsigned nextGlyphSubstTableUniqueId_; AddressObj *addressNoneObj_; NodeListObj *emptyNodeListObj_; HashTable nodePropertyTable_; bool debugMode_; bool dsssl2_; bool style_; bool strictMode_; ELObj *defaultLanguage_; Owner defaultLanguageDef_; unsigned defaultLanguageDefPart_; Location defaultLanguageDefLoc_; friend class Identifier; NamedTable charPropTable_; // No access function, since this is not a character NIC. MaybeIntegerCharPropValues numericEquivCPV_; #define CP(t, n) \ private: t ## CharPropValues n ## CPV_; \ public: const t ## CharPropValues &n () const \ { return n ## CPV_; } CP(Boolean, isSpace); CP(Boolean, isRecordEnd); CP(Boolean, isBlank); CP(Boolean, isInputTab); CP(Boolean, isInputWhitespace); CP(Boolean, isPunct); CP(PublicId, script); // FIXME! Shall not be PUblicId, but GlyphId. CP(PublicId, glyphId); CP(Boolean, isDropAfterLineBreak); CP(Boolean, isDropUnlessBeforeLineBreak); CP(Integer, breakBeforePriority); CP(Integer, breakAfterPriority); CP(Symbol, mathClass); CP(Symbol, mathFontPosture); Status feature_[nFeatures]; bool explicitFeatures_; Status module_[nModules]; bool explicitModules_; TransformationMode transformationMode_; }; inline ErrorObj *Interpreter::makeError() { return theErrorObj_; } inline bool Interpreter::isError(const ELObj *obj) const { return obj == theErrorObj_; } inline bool Interpreter::isUnspecified(const ELObj *obj) const { return obj == theUnspecifiedObj_; } inline FalseObj *Interpreter::makeFalse() { return theFalseObj_; } inline TrueObj *Interpreter::makeTrue() { return theTrueObj_; } inline NilObj *Interpreter::makeNil() { return theNilObj_; } inline UnspecifiedObj *Interpreter::makeUnspecified() { return theUnspecifiedObj_; } inline IntegerObj *Interpreter::makeInteger(long n) { return new (*this) IntegerObj(n); } inline PairObj *Interpreter::makePair(ELObj *car, ELObj *cdr) { return new (*this) PairObj(car, cdr); } inline CharObj *Interpreter::makeChar(Char c) { return new (*this) CharObj(c); } inline AddressObj *Interpreter::makeAddressNone() { return addressNoneObj_; } inline NodeListObj *Interpreter::makeEmptyNodeList() { return emptyNodeListObj_; } inline ELObj *Interpreter::cValueSymbol(FOTBuilder::Symbol sym) { return cValueSymbols_[sym]; } inline SymbolObj *Interpreter::portName(PortName i) { return portNames_[i]; } inline ProcessingMode *Interpreter::initialProcessingMode() { return &initialProcessingMode_; } inline int Interpreter::unitsPerInch() const { return unitsPerInch_; } inline unsigned Interpreter::currentPartIndex() const { return partIndex_; } inline const FOTBuilder::Description &Interpreter::fotbDescr() const { return fotbDescr_; } inline KeywordObj *Interpreter::makeKeyword(const StringC &str) { return new (*this) KeywordObj(lookup(str)); } inline StyleObj *Interpreter::initialStyle() const { return initialStyle_; } inline StyleObj *Interpreter::borderTrueStyle() const { return borderTrueStyle_; } inline StyleObj *Interpreter::borderFalseStyle() const { return borderFalseStyle_; } inline GroveManager *Interpreter::groveManager() const { return groveManager_; } inline const ConstPtr &Interpreter::charMapC() const { return charMapC_; } inline const ConstPtr &Interpreter::tableBorderC() const { return tableBorderC_; } inline const ConstPtr &Interpreter::cellBeforeRowBorderC() const { return cellBeforeRowBorderC_; } inline const ConstPtr &Interpreter::cellAfterRowBorderC() const { return cellAfterRowBorderC_; } inline const ConstPtr &Interpreter::cellBeforeColumnBorderC() const { return cellBeforeColumnBorderC_; } inline const ConstPtr &Interpreter::cellAfterColumnBorderC() const { return cellAfterColumnBorderC_; } inline const ConstPtr &Interpreter::fractionBarC() const { return fractionBarC_; } inline FunctionObj *Interpreter::lookupExternalProc(const StringC &pubid) { FunctionObj *const *func = externalProcTable_.lookup(pubid); return func ? *func : 0; } inline unsigned Interpreter::allocGlyphSubstTableUniqueId() { return nextGlyphSubstTableUniqueId_++; } inline bool Interpreter::debugMode() const { return debugMode_; } inline bool Interpreter::dsssl2() const { return dsssl2_; } inline bool Interpreter::style() const { return style_; } inline bool Interpreter::strictMode() const { return strictMode_; } inline void Interpreter::makeReadOnly(ELObj *obj) { if (dsssl2()) Collector::makeReadOnly(obj); } inline void Interpreter::addClassAttributeName(const StringC &name) { classAttributeNames_.push_back(name); } inline void Interpreter::addIdAttributeName(const StringC &name) { idAttributeNames_.push_back(name); } inline Interpreter::LexCategory Interpreter::lexCategory(Xchar c) { return LexCategory(lexCategory_[c]); } inline bool Identifier::syntacticKey(SyntacticKey &key) const { if (syntacticKey_ == notKey) return 0; key = syntacticKey_; return 1; } inline void Identifier::setSyntacticKey(SyntacticKey key) { syntacticKey_ = key; } inline bool Identifier::evaluated() const { return value_ != 0; } inline const ConstPtr &Identifier::inheritedC() const { return inheritedC_; } inline bool Identifier::inheritedCDefined(unsigned &part, Location &loc) const { if (inheritedC_.isNull()) return 0; part = inheritedCPart_; loc = inheritedCLoc_; return 1; } inline bool Identifier::charNICDefined(unsigned &part, Location &loc) const { if (!charNIC_) return 0; part = inheritedCPart_; loc = inheritedCLoc_; return 1; } inline void Identifier::setCharNIC(unsigned part, const Location &loc) { charNIC_ = 1; inheritedC_ = ConstPtr(0); inheritedCPart_ = part; inheritedCLoc_ = loc; } inline void Identifier::setInheritedC(const ConstPtr &ic, unsigned part, const Location &loc) { inheritedC_ = ic; inheritedCPart_ = part; inheritedCLoc_ = loc; } inline void Identifier::setInheritedC(const ConstPtr &ic) { inheritedC_ = ic; inheritedCPart_ = unsigned(-1); inheritedCLoc_ = Location(); } inline FlowObj *Identifier::flowObj() const { return flowObj_; } inline bool Identifier::flowObjDefined(unsigned &part, Location &loc) const { if (!flowObj_) return 0; part = flowObjPart_; loc = flowObjLoc_; return 1; } inline void Identifier::setFlowObj(FlowObj *fo) { flowObj_ = fo; flowObjPart_ = unsigned(-1); } inline void Identifier::setFlowObj(FlowObj *fo, unsigned part, const Location &loc) { flowObj_ = fo; flowObjPart_ = part; flowObjLoc_ = loc; } inline ELObjPart::ELObjPart() : obj(0), defPart(0) { } inline ELObjPart::ELObjPart(ELObj *o, unsigned p) : obj(o), defPart(p) { } inline void ELObjPart::operator=(const ELObjPart &x) { obj = x.obj; defPart = x.defPart; } inline bool ELObjPart::operator==(const ELObjPart &x) const { return defPart == x.defPart && obj && x.obj && ELObj::eqv(*obj, *x.obj); } inline bool ELObjPart::operator!=(const ELObjPart &x) const { return !(*this == x); } inline long IntegerCharPropValues::getValue(Char ch) const { ValT_ v(map_[ch]); if (v.hasValue_) return v.l_; else return def_; } inline void IntegerCharPropValues::setRange(Char from, Char to, long l) { map_.setRange(from, to, l); } inline bool MaybeIntegerCharPropValues::getValue(Char ch, long &l) const { ValT_ v(map_[ch]); if (v.hasValue_) { if (!v.isFalse_) l = v.l_; return !v.isFalse_; } l = def_; return true; } inline void MaybeIntegerCharPropValues::setRange(Char from, Char to, long l) { map_.setRange(from, to, l); } inline void MaybeIntegerCharPropValues::setValue(Char ch, long l) { map_.setChar(ch, l); } inline bool BooleanCharPropValues::getValue(Char ch) const { ValT_ v(map_[ch]); if (v.hasValue_) return v.b_; return def_; } inline void BooleanCharPropValues::setRange(Char from, Char to, bool b) { map_.setRange(from, to, b); } inline FOTBuilder::PublicId PublicIdCharPropValues::getValue(Char ch) const { ValT_ v(map_[ch]); if (v.hasValue_) return v.p_; return def_; } inline void PublicIdCharPropValues::setRange(Char from, Char to, FOTBuilder::PublicId p) { map_.setRange(from, to, p); } inline FOTBuilder::Symbol SymbolCharPropValues::getValue(Char ch) const { ValT_ v(map_[ch]); if (v.hasValue_) return v.s_; return def_; } inline void SymbolCharPropValues::setRange(Char from, Char to, FOTBuilder::Symbol s) { map_.setRange(from, to, s); } inline CharProp::CharProp(const StringC &name) : Named(name), defComputed_(notComputed), values_(0), hadError_(false) { } #ifdef DSSSL_NAMESPACE } #endif #endif /* not Interpreter_INCLUDED */ OpenJade-1.4devel/style/InterpreterMessages.cxx0000444000021000000240000012000707067713002015402 // This file was automatically generated from InterpreterMessages.msg by msggen.pl. #ifdef __GNUG__ #pragma implementation #endif #include "stylelib.h" #include "InterpreterMessages.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif const MessageType0 InterpreterMessages::unexpectedEof( MessageType::error, MessageFragment::xModule, 0 #ifndef SP_NO_MESSAGE_TEXT ,"unexpected end of file" #endif ); const MessageType0 InterpreterMessages::invalidChar( MessageType::error, MessageFragment::xModule, 1 #ifndef SP_NO_MESSAGE_TEXT ,"invalid character" #endif ); const MessageType0 InterpreterMessages::unknownHash( MessageType::error, MessageFragment::xModule, 2 #ifndef SP_NO_MESSAGE_TEXT ,"invalid character after '#'" ,"ISO/IEC 10179:1996 8.5.1 8.5.6 8.5.7.4 8.5.8 12.5.5 [70] [76] [79] [80] [81] [82] [94] [187]" #endif ); const MessageType1 InterpreterMessages::unknownNamedConstant( MessageType::error, MessageFragment::xModule, 3 #ifndef SP_NO_MESSAGE_TEXT ,"unknown #! named constant %1" ,"ISO/IEC 10179:1996 8.5.6 [76]" #endif ); const MessageType1 InterpreterMessages::unexpectedToken( MessageType::error, MessageFragment::xModule, 4 #ifndef SP_NO_MESSAGE_TEXT ,"unexpected token %1" #endif ); const MessageType0 InterpreterMessages::unterminatedString( MessageType::error, MessageFragment::xModule, 5 #ifndef SP_NO_MESSAGE_TEXT ,"string with no closing quote" ,"ISO/IEC 10179:1996 8.5.9 [118]" #endif ); const MessageType0 InterpreterMessages::missingCloseParen( MessageType::error, MessageFragment::xModule, 6 #ifndef SP_NO_MESSAGE_TEXT ,"missing closing parenthesis" #endif ); const MessageType1 InterpreterMessages::invalidNumber( MessageType::error, MessageFragment::xModule, 7 #ifndef SP_NO_MESSAGE_TEXT ,"invalid number %1" ,"ISO/IEC 10179:1996 8.5.7.4" #endif ); const MessageType1 InterpreterMessages::invalidAfiiGlyphId( MessageType::error, MessageFragment::xModule, 8 #ifndef SP_NO_MESSAGE_TEXT ,"invalid AFII glyph identifier %1" ,"ISO/IEC 10179:1996 12.5.5" #endif ); const MessageType1 InterpreterMessages::callNonFunction( MessageType::error, MessageFragment::xModule, 9 #ifndef SP_NO_MESSAGE_TEXT ,"call of non-function object %1" ,"ISO/IEC 10179:1996 8.3.1.3" #endif ); const MessageType0 InterpreterMessages::tooManyArgs( MessageType::error, MessageFragment::xModule, 10 #ifndef SP_NO_MESSAGE_TEXT ,"too many arguments for function" ,"ISO/IEC 10179:1996 8.3.1.4" #endif ); const MessageType0 InterpreterMessages::oddKeyArgs( MessageType::error, MessageFragment::xModule, 11 #ifndef SP_NO_MESSAGE_TEXT ,"odd number of keyword/value arguments" ,"ISO/IEC 10179:1996 8.3.1.4" #endif ); const MessageType0 InterpreterMessages::missingArg( MessageType::error, MessageFragment::xModule, 12 #ifndef SP_NO_MESSAGE_TEXT ,"missing argument for function call" ,"ISO/IEC 10179:1996 8.3.1.4" #endif ); const MessageType1 InterpreterMessages::syntacticKeywordAsVariable( MessageType::error, MessageFragment::xModule, 13 #ifndef SP_NO_MESSAGE_TEXT ,"syntactic keyword %1 used as variable" ,"ISO/IEC 10179:1996 8.2.1p1" #endif ); const MessageType1 InterpreterMessages::undefinedVariableReference( MessageType::error, MessageFragment::xModule, 14 #ifndef SP_NO_MESSAGE_TEXT ,"reference to undefined variable %1" ,"ISO/IEC 10179:1996 8.3.1.1" #endif ); const MessageType1 InterpreterMessages::badCharName( MessageType::error, MessageFragment::xModule, 15 #ifndef SP_NO_MESSAGE_TEXT ,"no character with name %1" ,"ISO/IEC 10179:1996 8.5.8" #endif ); const MessageType1 InterpreterMessages::unknownTopLevelForm( MessageType::error, MessageFragment::xModule, 18 #ifndef SP_NO_MESSAGE_TEXT ,"unknown top level form %1" ,"ISO/IEC 10179:1996 12 [159]" #endif ); const MessageType1 InterpreterMessages::badModeForm( MessageType::error, MessageFragment::xModule, 19 #ifndef SP_NO_MESSAGE_TEXT ,"bad form %1 in mode group" ,"ISO/IEC 10179:1996 12.4.1 [162]" #endif ); const MessageType1L InterpreterMessages::duplicateDefinition( MessageType::error, MessageFragment::xModule, 20 #ifndef SP_NO_MESSAGE_TEXT ,"identifier %1 already defined in same part" ,"ISO/IEC 10179:1996 8.4" ,"first definition was here" #endif ); const MessageType1 InterpreterMessages::identifierLoop( MessageType::error, MessageFragment::xModule, 22 #ifndef SP_NO_MESSAGE_TEXT ,"loop in specification of value of %1" ,"ISO/IEC 10179:1996 8.4" #endif ); const MessageType0 InterpreterMessages::outOfRange( MessageType::error, MessageFragment::xModule, 23 #ifndef SP_NO_MESSAGE_TEXT ,"argument out of range" ,"ISO/IEC 10179:1996 8.5.3.12 8.5.3.13 8.5.7.17 8.5.7.19 8.5.7.20 8.5.9.4 8.5.9.7" #endif ); const MessageType1 InterpreterMessages::unitLoop( MessageType::error, MessageFragment::xModule, 24 #ifndef SP_NO_MESSAGE_TEXT ,"loop in specification of value of unit %1" ,"ISO/IEC 10179:1996 8.4" #endif ); const MessageType1 InterpreterMessages::badUnitDefinition( MessageType::error, MessageFragment::xModule, 25 #ifndef SP_NO_MESSAGE_TEXT ,"bad value specified for unit %1" ,"ISO/IEC 10179:1996 8.5.7.1" #endif ); const MessageType1L InterpreterMessages::duplicateUnitDefinition( MessageType::error, MessageFragment::xModule, 26 #ifndef SP_NO_MESSAGE_TEXT ,"unit %1 already defined in same part" ,"ISO/IEC 10179:1996 8.4" ,"first definition was here" #endif ); const MessageType1 InterpreterMessages::undefinedQuantity( MessageType::error, MessageFragment::xModule, 28 #ifndef SP_NO_MESSAGE_TEXT ,"quantity %1 undefined" #endif ); const MessageType0 InterpreterMessages::incompatibleDimensions( MessageType::error, MessageFragment::xModule, 29 #ifndef SP_NO_MESSAGE_TEXT ,"incompatible dimensions" ,"ISO/IEC 10179:1996 8.5.7.7 8.5.7.9 8.5.7.10 8.5.7.12 8.5.7.19" #endif ); const MessageType3 InterpreterMessages::notABoolean( MessageType::error, MessageFragment::xModule, 30 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a boolean" #endif ); const MessageType3 InterpreterMessages::notAPair( MessageType::error, MessageFragment::xModule, 31 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a pair" #endif ); const MessageType3 InterpreterMessages::notAList( MessageType::error, MessageFragment::xModule, 32 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a list" #endif ); const MessageType3 InterpreterMessages::notASymbol( MessageType::error, MessageFragment::xModule, 33 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a symbol" #endif ); const MessageType3 InterpreterMessages::notAString( MessageType::error, MessageFragment::xModule, 34 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a string" #endif ); const MessageType3 InterpreterMessages::notAStringOrSymbol( MessageType::error, MessageFragment::xModule, 35 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a string or symbol" #endif ); const MessageType3 InterpreterMessages::notAChar( MessageType::error, MessageFragment::xModule, 36 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a char" #endif ); const MessageType3 InterpreterMessages::notAStyle( MessageType::error, MessageFragment::xModule, 37 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a style" #endif ); const MessageType3 InterpreterMessages::notAnExactInteger( MessageType::error, MessageFragment::xModule, 38 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an exact integer" #endif ); const MessageType3 InterpreterMessages::notAQuantity( MessageType::error, MessageFragment::xModule, 39 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a quantity" #endif ); const MessageType3 InterpreterMessages::notAColorSpace( MessageType::error, MessageFragment::xModule, 40 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a color-space" #endif ); const MessageType3 InterpreterMessages::notANumber( MessageType::error, MessageFragment::xModule, 41 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a number" #endif ); const MessageType3 InterpreterMessages::notASosofo( MessageType::error, MessageFragment::xModule, 42 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a sosofo" #endif ); const MessageType3 InterpreterMessages::notAnOptSingletonNode( MessageType::error, MessageFragment::xModule, 43 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an optional singleton node list" #endif ); const MessageType3 InterpreterMessages::notASingletonNode( MessageType::error, MessageFragment::xModule, 44 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a singleton node list" #endif ); const MessageType3 InterpreterMessages::notANodeList( MessageType::error, MessageFragment::xModule, 45 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a node list" #endif ); const MessageType3 InterpreterMessages::notANamedNodeList( MessageType::error, MessageFragment::xModule, 46 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a named node list" #endif ); const MessageType3 InterpreterMessages::notALengthSpec( MessageType::error, MessageFragment::xModule, 47 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a length or length-spec" #endif ); const MessageType3 InterpreterMessages::notAQuantityOrLengthSpec( MessageType::error, MessageFragment::xModule, 48 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec" #endif ); const MessageType3 InterpreterMessages::notAPriority( MessageType::error, MessageFragment::xModule, 49 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol \"force\"" ,"ISO/IEC 10179:1996 12.5.4.1" #endif ); const MessageType3 InterpreterMessages::notAnAddress( MessageType::error, MessageFragment::xModule, 51 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an address" ,"ISO/IEC 10179:1996 12.5.8" #endif ); const MessageType3 InterpreterMessages::notAGlyphId( MessageType::error, MessageFragment::xModule, 52 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a glyph-id" ,"ISO/IEC 10179:1996 12.5.5" #endif ); const MessageType3 InterpreterMessages::notAGlyphSubstTable( MessageType::error, MessageFragment::xModule, 53 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table" ,"ISO/IEC 10179:1996 12.5.6" #endif ); const MessageType3 InterpreterMessages::notAGlyphIdPairList( MessageType::error, MessageFragment::xModule, 54 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids" ,"ISO/IEC 10179:1996 12.5.6" #endif ); const MessageType3 InterpreterMessages::notAProcedure( MessageType::error, MessageFragment::xModule, 55 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a procedure" #endif ); const MessageType3 InterpreterMessages::notAVector( MessageType::error, MessageFragment::xModule, 56 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a vector" #endif ); const MessageType0L InterpreterMessages::duplicateRootRule( MessageType::error, MessageFragment::xModule, 57 #ifndef SP_NO_MESSAGE_TEXT ,"root rule already defined in same part with same importance" ,"ISO/IEC 10179:1996 12.4.1" ,"first definition was here" #endif ); const MessageType1L InterpreterMessages::duplicateInitialValue( MessageType::error, MessageFragment::xModule, 59 #ifndef SP_NO_MESSAGE_TEXT ,"initial value already declared for characteristic %1 in same part" ,"ISO/IEC 10179:1996 12.4.6" ,"first declaration was here" #endif ); const MessageType1 InterpreterMessages::invalidStyleKeyword( MessageType::error, MessageFragment::xModule, 61 #ifndef SP_NO_MESSAGE_TEXT ,"%1 is not a valid keyword in a style expression" ,"ISO/IEC 10179:1996 12.4.5" #endif ); const MessageType2 InterpreterMessages::invalidMakeKeyword( MessageType::error, MessageFragment::xModule, 62 #ifndef SP_NO_MESSAGE_TEXT ,"%1 is not a valid keyword in a make expression for flow object class %2" ,"ISO/IEC 10179:1996 12.4.3" #endif ); const MessageType1 InterpreterMessages::unknownFlowObjectClass( MessageType::error, MessageFragment::xModule, 63 #ifndef SP_NO_MESSAGE_TEXT ,"%1 is not the name of any flow object class" #endif ); const MessageType1 InterpreterMessages::atomicContent( MessageType::error, MessageFragment::xModule, 64 #ifndef SP_NO_MESSAGE_TEXT ,"content expression cannot be specified in make expression for atomic flow object class %1" ,"ISO/IEC 10179:1996 12.4.3" #endif ); const MessageType0 InterpreterMessages::labelNotASymbol( MessageType::error, MessageFragment::xModule, 65 #ifndef SP_NO_MESSAGE_TEXT ,"value for \"label:\" not a symbol" ,"ISO/IEC 10179:1996 12.4.3" #endif ); const MessageType1 InterpreterMessages::badConnection( MessageType::error, MessageFragment::xModule, 66 #ifndef SP_NO_MESSAGE_TEXT ,"no port for label %1" #endif ); const MessageType0 InterpreterMessages::badContentMap( MessageType::error, MessageFragment::xModule, 67 #ifndef SP_NO_MESSAGE_TEXT ,"invalid content map" ,"ISO/IEC 10179:1996 12.4.3" #endif ); const MessageType1 InterpreterMessages::contentMapBadPort( MessageType::error, MessageFragment::xModule, 68 #ifndef SP_NO_MESSAGE_TEXT ,"content map references non-existent port %1" ,"ISO/IEC 10179:1996 12.4.3" #endif ); const MessageType1 InterpreterMessages::invalidCharacteristicValue( MessageType::error, MessageFragment::xModule, 69 #ifndef SP_NO_MESSAGE_TEXT ,"invalid value for %1 characteristic" #endif ); const MessageType0 InterpreterMessages::condFail( MessageType::error, MessageFragment::xModule, 70 #ifndef SP_NO_MESSAGE_TEXT ,"no clause in cond expression matched" ,"ISO/IEC 10179:1996 8.3.2.1" #endif ); const MessageType1 InterpreterMessages::caseFail( MessageType::error, MessageFragment::xModule, 71 #ifndef SP_NO_MESSAGE_TEXT ,"no clause in case expression matched %1" ,"ISO/IEC 10179:1996 8.3.2.2" #endif ); const MessageType1 InterpreterMessages::caseElse( MessageType::error, MessageFragment::xModule, 72 #ifndef SP_NO_MESSAGE_TEXT ,"expected \"else\" not %1" ,"ISO/IEC 10179:1996 8.3.2.2 [45]" #endif ); const MessageType0 InterpreterMessages::caseUnresolvedQuantities( MessageType::error, MessageFragment::xModule, 73 #ifndef SP_NO_MESSAGE_TEXT ,"sorry, cannot handle unresolvable quantities in datums in case expression" #endif ); const MessageType1 InterpreterMessages::errorProc( MessageType::error, MessageFragment::xModule, 74 #ifndef SP_NO_MESSAGE_TEXT ,"%1" ,"ISO/IEC 10179:1996 8.5.12" #endif ); const MessageType0 InterpreterMessages::divideBy0( MessageType::error, MessageFragment::xModule, 75 #ifndef SP_NO_MESSAGE_TEXT ,"division by zero" ,"ISO/IEC 10179:1996 8.5.7.13" #endif ); const MessageType1 InterpreterMessages::invalidKeyArg( MessageType::error, MessageFragment::xModule, 76 #ifndef SP_NO_MESSAGE_TEXT ,"procedure does not have %1 keyword argument" ,"ISO/IEC 10179:1996 8.3.1.4" #endif ); const MessageType0 InterpreterMessages::keyArgsNotKey( MessageType::error, MessageFragment::xModule, 77 #ifndef SP_NO_MESSAGE_TEXT ,"argument not a keyword" ,"ISO/IEC 10179:1996 8.3.1.4" #endif ); const MessageType0 InterpreterMessages::specNotArc( MessageType::error, MessageFragment::xModule, 79 #ifndef SP_NO_MESSAGE_TEXT ,"specification document does not have the DSSSL architecture as a base architecture" ,"ISO/IEC 10179:1996 7p1" #endif ); const MessageType0 InterpreterMessages::noStyleSpec( MessageType::error, MessageFragment::xModule, 80 #ifndef SP_NO_MESSAGE_TEXT ,"specification document did not contain a style-specification-body element" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType1 InterpreterMessages::unknownCharName( MessageType::error, MessageFragment::xModule, 81 #ifndef SP_NO_MESSAGE_TEXT ,"unknown character name %1" ,"ISO/IEC 10179:1996 8.5.8" #endif ); const MessageType0 InterpreterMessages::noCurrentNode( MessageType::error, MessageFragment::xModule, 82 #ifndef SP_NO_MESSAGE_TEXT ,"attempt to use current node when there is none" ,"ISO/IEC 10179:1996 10.1.1 12.4.1" #endif ); const MessageType0 InterpreterMessages::noCurrentProcessingMode( MessageType::error, MessageFragment::xModule, 83 #ifndef SP_NO_MESSAGE_TEXT ,"attempt to process node in illegal context" ,"ISO/IEC 10179:1996 12.4.1" #endif ); const MessageType0 InterpreterMessages::invalidRadix( MessageType::error, MessageFragment::xModule, 84 #ifndef SP_NO_MESSAGE_TEXT ,"radix must be 2, 8, 10 or 16" #endif ); const MessageType0 InterpreterMessages::sosofoContext( MessageType::error, MessageFragment::xModule, 85 #ifndef SP_NO_MESSAGE_TEXT ,"this context requires a sosofo" #endif ); const MessageType0 InterpreterMessages::styleContext( MessageType::error, MessageFragment::xModule, 86 #ifndef SP_NO_MESSAGE_TEXT ,"this context requires a style object" #endif ); const MessageType0 InterpreterMessages::notInCharacteristicValue( MessageType::error, MessageFragment::xModule, 87 #ifndef SP_NO_MESSAGE_TEXT ,"procedure can only be used in evaluation of characteristic value" ,"ISO/IEC 10179:1996 12.4.6" #endif ); const MessageType1 InterpreterMessages::colorArgCount( MessageType::error, MessageFragment::xModule, 89 #ifndef SP_NO_MESSAGE_TEXT ,"%1 color requires three arguments" #endif ); const MessageType1 InterpreterMessages::colorArgType( MessageType::error, MessageFragment::xModule, 90 #ifndef SP_NO_MESSAGE_TEXT ,"arguments for %1 color must be numbers" #endif ); const MessageType1 InterpreterMessages::colorArgRange( MessageType::error, MessageFragment::xModule, 91 #ifndef SP_NO_MESSAGE_TEXT ,"arguments for %1 color must be in the range 0 to 1" #endif ); const MessageType1 InterpreterMessages::colorProcResType( MessageType::error, MessageFragment::xModule, 92 #ifndef SP_NO_MESSAGE_TEXT ,"result of procedure in %1 color must be a number" #endif ); const MessageType1 InterpreterMessages::unknownColorSpaceFamily( MessageType::error, MessageFragment::xModule, 93 #ifndef SP_NO_MESSAGE_TEXT ,"unknown color-space family %1" ,"ISO/IEC 10179:1996 12.5.9" #endif ); const MessageType1 InterpreterMessages::colorSpaceNoArgs( MessageType::error, MessageFragment::xModule, 94 #ifndef SP_NO_MESSAGE_TEXT ,"%1 color-space family does not take any arguments" #endif ); const MessageType1 InterpreterMessages::colorSpaceArgError( MessageType::error, MessageFragment::xModule, 95 #ifndef SP_NO_MESSAGE_TEXT ,"invalid parameters for %1 color-space family" #endif ); const MessageType1 InterpreterMessages::notABuiltinInheritedC( MessageType::error, MessageFragment::xModule, 96 #ifndef SP_NO_MESSAGE_TEXT ,"%1 is not a pre-defined inherited characteristic" #endif ); const MessageType1 InterpreterMessages::invalidNumberFormat( MessageType::error, MessageFragment::xModule, 97 #ifndef SP_NO_MESSAGE_TEXT ,"invalid number format %1" ,"ISO/IEC 10179:1996 8.5.7.24" #endif ); const MessageType1 InterpreterMessages::invalidPublicIdChar( MessageType::error, MessageFragment::xModule, 98 #ifndef SP_NO_MESSAGE_TEXT ,"invalid character %1 in public identifier" #endif ); const MessageType1 InterpreterMessages::debug( MessageType::info, MessageFragment::xModule, 99 #ifndef SP_NO_MESSAGE_TEXT ,"debug %1" #endif ); const MessageType0 InterpreterMessages::useLoop( MessageType::error, MessageFragment::xModule, 100 #ifndef SP_NO_MESSAGE_TEXT ,"circular use of specification parts" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType1 InterpreterMessages::missingPart( MessageType::error, MessageFragment::xModule, 101 #ifndef SP_NO_MESSAGE_TEXT ,"no style-specification or external-specification with ID %1" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType0 InterpreterMessages::noParts( MessageType::error, MessageFragment::xModule, 102 #ifndef SP_NO_MESSAGE_TEXT ,"document did not contain any style-specifications or external-specifications" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType0 InterpreterMessages::tableCellOutsideTable( MessageType::error, MessageFragment::xModule, 103 #ifndef SP_NO_MESSAGE_TEXT ,"table-cell flow object not inside a table" #endif ); const MessageType0 InterpreterMessages::tableRowOutsideTable( MessageType::error, MessageFragment::xModule, 104 #ifndef SP_NO_MESSAGE_TEXT ,"table-row flow object not inside a table" #endif ); const MessageType1 InterpreterMessages::noNodePropertyValue( MessageType::error, MessageFragment::xModule, 105 #ifndef SP_NO_MESSAGE_TEXT ,"no value for node property %1" ,"ISO/IEC 10179:1996 10.1.6" #endif ); const MessageType0 InterpreterMessages::returnNotNodeList( MessageType::error, MessageFragment::xModule, 106 #ifndef SP_NO_MESSAGE_TEXT ,"value returned by procedure was not a node-list" #endif ); const MessageType0 InterpreterMessages::stackTrace( MessageType::info, MessageFragment::xModule, 107 #ifndef SP_NO_MESSAGE_TEXT ,"called from here" #endif ); const MessageType1 InterpreterMessages::stackTraceEllipsis( MessageType::info, MessageFragment::xModule, 108 #ifndef SP_NO_MESSAGE_TEXT ,"called from here...(%1 calls omitted)" #endif ); const MessageType0 InterpreterMessages::processNodeLoop( MessageType::error, MessageFragment::xModule, 109 #ifndef SP_NO_MESSAGE_TEXT ,"node processing loop detected" #endif ); const MessageType0 InterpreterMessages::spliceNotList( MessageType::error, MessageFragment::xModule, 110 #ifndef SP_NO_MESSAGE_TEXT ,"unquote-splicing expression does not evaluate to a list" ,"ISO/IEC 10179:1996 8.3.2.7" #endif ); const MessageType0 InterpreterMessages::readOnly( MessageType::error, MessageFragment::xModule, 111 #ifndef SP_NO_MESSAGE_TEXT ,"object is read-only" #endif ); const MessageType1 InterpreterMessages::topLevelAssignment( MessageType::error, MessageFragment::xModule, 112 #ifndef SP_NO_MESSAGE_TEXT ,"assignment to top-level variable %1" #endif ); const MessageType0 InterpreterMessages::continuationDead( MessageType::error, MessageFragment::xModule, 113 #ifndef SP_NO_MESSAGE_TEXT ,"invalid call to continuation" #endif ); const MessageType0 InterpreterMessages::patternEmptyGi( MessageType::error, MessageFragment::xModule, 114 #ifndef SP_NO_MESSAGE_TEXT ,"empty generic identifier in pattern" #endif ); const MessageType0 InterpreterMessages::patternNotList( MessageType::error, MessageFragment::xModule, 115 #ifndef SP_NO_MESSAGE_TEXT ,"pattern is not a list" #endif ); const MessageType1 InterpreterMessages::patternBadGi( MessageType::error, MessageFragment::xModule, 116 #ifndef SP_NO_MESSAGE_TEXT ,"%1 cannot be used as a generic identifier in a pattern" #endif ); const MessageType1 InterpreterMessages::patternBadMember( MessageType::error, MessageFragment::xModule, 117 #ifndef SP_NO_MESSAGE_TEXT ,"%1 cannot occur in a pattern" #endif ); const MessageType0 InterpreterMessages::patternMissingQualifierValue( MessageType::error, MessageFragment::xModule, 118 #ifndef SP_NO_MESSAGE_TEXT ,"value missing for qualifier in pattern" #endif ); const MessageType1 InterpreterMessages::patternUnknownQualifier( MessageType::error, MessageFragment::xModule, 119 #ifndef SP_NO_MESSAGE_TEXT ,"unknown pattern qualifier %1" #endif ); const MessageType2 InterpreterMessages::patternBadQualifierValue( MessageType::error, MessageFragment::xModule, 120 #ifndef SP_NO_MESSAGE_TEXT ,"bad value %1 for %2 qualifier in pattern" #endif ); const MessageType0 InterpreterMessages::patternChildRepeat( MessageType::error, MessageFragment::xModule, 121 #ifndef SP_NO_MESSAGE_TEXT ,"repeat qualifier not allowed inside children qualifier" #endif ); const MessageType0 InterpreterMessages::patternBadAttributeQualifier( MessageType::error, MessageFragment::xModule, 122 #ifndef SP_NO_MESSAGE_TEXT ,"bad value for attributes qualifier in pattern" #endif ); const MessageType1L InterpreterMessages::ambiguousStyle( MessageType::error, MessageFragment::xModule, 123 #ifndef SP_NO_MESSAGE_TEXT ,"characteristic %1 applied in style rule with same specificity" ,0 ,"other style rule is here" #endif ); const MessageType0 InterpreterMessages::ambiguousMatch( MessageType::error, MessageFragment::xModule, 125 #ifndef SP_NO_MESSAGE_TEXT ,"node matches more than one pattern with the same specificity" ,"ISO/IEC 10179:1996 12.4.1" #endif ); const MessageType1 InterpreterMessages::uninitializedVariableReference( MessageType::error, MessageFragment::xModule, 126 #ifndef SP_NO_MESSAGE_TEXT ,"reference to uninitialized variable %1" #endif ); const MessageType1 InterpreterMessages::actualLoop( MessageType::error, MessageFragment::xModule, 127 #ifndef SP_NO_MESSAGE_TEXT ,"circular use of actual value of characteristic %1" ,"ISO/IEC 10179:1996 12.4.6" #endif ); const MessageType1L InterpreterMessages::duplicateCharacteristic( MessageType::error, MessageFragment::xModule, 128 #ifndef SP_NO_MESSAGE_TEXT ,"characteristic %1 already defined in same part" ,"ISO/IEC 10179:1996 12.4.6" ,"first definition was here" #endif ); const MessageType1L InterpreterMessages::duplicateFlowObjectClass( MessageType::error, MessageFragment::xModule, 130 #ifndef SP_NO_MESSAGE_TEXT ,"flow object class %1 already defined in same part" ,"ISO/IEC 10179:1996 12.4.3 [178]" ,"first definition was here" #endif ); const MessageType1 InterpreterMessages::undefinedMode( MessageType::error, MessageFragment::xModule, 132 #ifndef SP_NO_MESSAGE_TEXT ,"mode %1 not defined" ,"ISO/IEC 10179:1996 12.4.3 [180]" #endif ); const MessageType1 InterpreterMessages::duplicateCharName( MessageType::error, MessageFragment::xModule, 133 #ifndef SP_NO_MESSAGE_TEXT ,"duplicate character name %1" ,"ISO/IEC 10179:1996 7.1.4" #endif ); const MessageType1 InterpreterMessages::duplicateSdataEntityName( MessageType::error, MessageFragment::xModule, 134 #ifndef SP_NO_MESSAGE_TEXT ,"duplicate SDATA entity name %1" ,"ISO/IEC 10179:1996 7.1.8" #endif ); const MessageType1 InterpreterMessages::duplicateSdataEntityText( MessageType::error, MessageFragment::xModule, 135 #ifndef SP_NO_MESSAGE_TEXT ,"duplicate SDATA entity text %1" ,"ISO/IEC 10179:1996 7.1.8" #endif ); const MessageType0 InterpreterMessages::unsupportedDeclaration( MessageType::warning, MessageFragment::xModule, 136 #ifndef SP_NO_MESSAGE_TEXT ,"unsupported declaration will be ignored" #endif ); const MessageType1 InterpreterMessages::unsupportedCharRepertoire( MessageType::warning, MessageFragment::xModule, 137 #ifndef SP_NO_MESSAGE_TEXT ,"unsupported character repertoire %1 will be ignored" #endif ); const MessageType0 InterpreterMessages::badDeclaration( MessageType::error, MessageFragment::xModule, 138 #ifndef SP_NO_MESSAGE_TEXT ,"error in declaration element" #endif ); const MessageType1 InterpreterMessages::invalidIdentifier( MessageType::error, MessageFragment::xModule, 140 #ifndef SP_NO_MESSAGE_TEXT ,"%1 is not a valid identifier" ,"ISO/IEC 10179:1996 7.3.2 [1]" #endif ); const MessageType0 InterpreterMessages::badLanguageDefinition( MessageType::error, MessageFragment::xModule, 141 #ifndef SP_NO_MESSAGE_TEXT ,"error in language definition" ,"ISO/IEC 10179:1996 8.5.8.2.1 [100]" #endif ); const MessageType0 InterpreterMessages::noCurrentLanguage( MessageType::error, MessageFragment::xModule, 142 #ifndef SP_NO_MESSAGE_TEXT ,"no current language" ,"ISO/IEC 10179:1996 8.5.8.4 8.5.8.5 8.5.8.6 8.5.9.5 8.5.9.6" #endif ); const MessageType3 InterpreterMessages::notALanguage( MessageType::error, MessageFragment::xModule, 143 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a language" ,"ISO/IEC 10179:1996 8.5.8.2" #endif ); const MessageType3 InterpreterMessages::notAPositiveInteger( MessageType::error, MessageFragment::xModule, 144 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a positive integer" #endif ); const MessageType3 InterpreterMessages::notAnInteger( MessageType::error, MessageFragment::xModule, 145 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an integer" #endif ); const MessageType3 InterpreterMessages::notAKeyword( MessageType::error, MessageFragment::xModule, 146 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a keyword" #endif ); const MessageType3 InterpreterMessages::notAnAlist( MessageType::error, MessageFragment::xModule, 147 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not an alist" #endif ); const MessageType3 InterpreterMessages::notACharList( MessageType::error, MessageFragment::xModule, 148 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a list of characters" #endif ); const MessageType3 InterpreterMessages::lengthError( MessageType::error, MessageFragment::xModule, 149 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 has wrong length" #endif ); const MessageType1 InterpreterMessages::noExactRepresentation( MessageType::warning, MessageFragment::xModule, 150 #ifndef SP_NO_MESSAGE_TEXT ,"quantity %1 can't be represented exactly" ,"ISO/IEC 10179:1996 8.5.7.2" #endif ); const MessageType0L InterpreterMessages::duplicateDefLangDecl( MessageType::error, MessageFragment::xModule, 151 #ifndef SP_NO_MESSAGE_TEXT ,"default language already declared in this part" ,"ISO/IEC 10179:1996 8.5.8.2 [99]" ,"first declaration was here" #endif ); const MessageType1 InterpreterMessages::defLangDeclRequiresLanguage( MessageType::error, MessageFragment::xModule, 153 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not a language as required in a default-language-declaration" ,"ISO/IEC 10179:1996 8.5.8.2" #endif ); const MessageType1 InterpreterMessages::invalidUnitName( MessageType::error, MessageFragment::xModule, 154 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not a valid unit name" ,"ISO/IEC 10179:1996 8.5.7.4 [87]" #endif ); const MessageType1 InterpreterMessages::invalidCharName( MessageType::error, MessageFragment::xModule, 155 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not a valid character name" ,"ISO/IEC 10179:1996 8.5.8 [95]" #endif ); const MessageType1 InterpreterMessages::invalidCharNumber( MessageType::error, MessageFragment::xModule, 156 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not a valid character number" ,"ISO/IEC 10179:1996 7.1.4p2 7.1.6p2" #endif ); const MessageType1 InterpreterMessages::unknownCharProperty( MessageType::error, MessageFragment::xModule, 157 #ifndef SP_NO_MESSAGE_TEXT ,"unknown character property %1" ,"ISO/IEC 10179:1996 8.5.8.1" #endif ); const MessageType0 InterpreterMessages::badAddCharProperty( MessageType::error, MessageFragment::xModule, 158 #ifndef SP_NO_MESSAGE_TEXT ,"error in character property declaration" ,"ISO/IEC 10179:1996 8.5.8.1" #endif ); const MessageType1L InterpreterMessages::duplicateCharPropertyDecl( MessageType::error, MessageFragment::xModule, 159 #ifndef SP_NO_MESSAGE_TEXT ,"character property %1 already declared in same part" ,"ISO/IEC 10179:1996 8.5.8.1" ,"first declaration was here" #endif ); const MessageType1L InterpreterMessages::duplicateAddCharProperty( MessageType::error, MessageFragment::xModule, 161 #ifndef SP_NO_MESSAGE_TEXT ,"added value for character property %1 already declared in same part" ,"ISO/IEC 10179:1996 8.5.8.1" ,"previous declaration was here" #endif ); const MessageType0 InterpreterMessages::returnNotSosofo( MessageType::error, MessageFragment::xModule, 163 #ifndef SP_NO_MESSAGE_TEXT ,"value returned by procedure was not a sosofo" #endif ); const MessageType1 InterpreterMessages::charPropertyLoop( MessageType::error, MessageFragment::xModule, 164 #ifndef SP_NO_MESSAGE_TEXT ,"loop in specification of value of character property %1" #endif ); const MessageType2 InterpreterMessages::charPropertyNotInteger( MessageType::error, MessageFragment::xModule, 165 #ifndef SP_NO_MESSAGE_TEXT ,"value for character property %1 of wrong type: %2 not an integer" #endif ); const MessageType2 InterpreterMessages::charPropertyNotIntegerOrFalse( MessageType::error, MessageFragment::xModule, 166 #ifndef SP_NO_MESSAGE_TEXT ,"value for character property %1 of wrong type: %2 not an integer or the value \"#f\"" #endif ); const MessageType1 InterpreterMessages::unknownFeature( MessageType::error, MessageFragment::xModule, 167 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not a style or transformation language feature" ,"ISO/IEC 10179:1996 11.1 12.1" #endif ); const MessageType1 InterpreterMessages::missingFeature( MessageType::error, MessageFragment::xModule, 168 #ifndef SP_NO_MESSAGE_TEXT ,"undeclared use of feature %1" ,"ISO/IEC 10179:1996 7.1.1" #endif ); const MessageType1 InterpreterMessages::unsupportedFeature( MessageType::warning, MessageFragment::xModule, 169 #ifndef SP_NO_MESSAGE_TEXT ,"feature %1 not supported" #endif ); const MessageType1 InterpreterMessages::partiallySupportedFeature( MessageType::warning, MessageFragment::xModule, 170 #ifndef SP_NO_MESSAGE_TEXT ,"feature %1 only partially supported" #endif ); const MessageType0 InterpreterMessages::styleLanguage( MessageType::error, MessageFragment::xModule, 171 #ifndef SP_NO_MESSAGE_TEXT ,"only allowed in style language" #endif ); const MessageType0 InterpreterMessages::transformationLanguage( MessageType::error, MessageFragment::xModule, 172 #ifndef SP_NO_MESSAGE_TEXT ,"only allowed in transformation language" #endif ); const MessageType0 InterpreterMessages::mixedLanguages( MessageType::error, MessageFragment::xModule, 173 #ifndef SP_NO_MESSAGE_TEXT ,"style and transformation language parts mixed" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType0 InterpreterMessages::partialSpec( MessageType::warning, MessageFragment::xModule, 174 #ifndef SP_NO_MESSAGE_TEXT ,"specification is marked as partial" ,"ISO/IEC 10179:1996 7.1" #endif ); const MessageType1 InterpreterMessages::cantOmitModule( MessageType::warning, MessageFragment::xModule, 175 #ifndef SP_NO_MESSAGE_TEXT ,"grove plan excluding module %1 not supported" #endif ); const MessageType1 InterpreterMessages::cantAddModule( MessageType::warning, MessageFragment::xModule, 176 #ifndef SP_NO_MESSAGE_TEXT ,"grove plan including module %1 not supported" #endif ); const MessageType1 InterpreterMessages::unknownModule( MessageType::error, MessageFragment::xModule, 177 #ifndef SP_NO_MESSAGE_TEXT ,"%1 not an SGML property set module" #endif ); const MessageType2 InterpreterMessages::notACharInCharMap( MessageType::error, MessageFragment::xModule, 178 #ifndef SP_NO_MESSAGE_TEXT ,"Function for char-map characteristic returned non-char object %2 for character %1" ,"ISO/IEC 10179:1996 12.6.11" #endif ); const MessageType2 InterpreterMessages::charPropertyNotPublicId( MessageType::error, MessageFragment::xModule, 179 #ifndef SP_NO_MESSAGE_TEXT ,"value for character property %1 of wrong type: %2 not a public identifier or the value \"#f\"" #endif ); const MessageType1 InterpreterMessages::duplicateVariableBinding( MessageType::error, MessageFragment::xModule, 180 #ifndef SP_NO_MESSAGE_TEXT ,"variable %1 occurs more than once in bindings" ,"ISO/IEC 10179:1996 8.3.2.5" #endif ); const MessageType0 InterpreterMessages::subgroveArgs( MessageType::error, MessageFragment::xModule, 181 #ifndef SP_NO_MESSAGE_TEXT ,"exactly one of node:, subgrove: and class: needed" ,"ISO/IEC 10179:1996 11.3.1" #endif ); const MessageType0 InterpreterMessages::subgroveSubgroveArgs( MessageType::warning, MessageFragment::xModule, 182 #ifndef SP_NO_MESSAGE_TEXT ,"add:, null:, remove:, children:, sub: make no sense with subgrove:" ,"ISO/IEC 10179:1996 11.3.1" #endif ); const MessageType0 InterpreterMessages::subgroveClassArgs( MessageType::warning, MessageFragment::xModule, 183 #ifndef SP_NO_MESSAGE_TEXT ,"remove: makes no sense with class:" ,"ISO/IEC 10179:1996 11.3.1" #endif ); const MessageType3 InterpreterMessages::notASubgroveSpec( MessageType::error, MessageFragment::xModule, 184 #ifndef SP_NO_MESSAGE_TEXT ,"%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec" #endif ); const MessageType1 InterpreterMessages::notACspecList( MessageType::error, MessageFragment::xModule, 185 #ifndef SP_NO_MESSAGE_TEXT ,"wrong type: %1 not a list of create-specs" #endif ); const MessageType1 InterpreterMessages::notACspecOrCspecList( MessageType::error, MessageFragment::xModule, 186 #ifndef SP_NO_MESSAGE_TEXT ,"wrong type: %1 not a create-spec or list of create-specs" #endif ); const MessageType1 InterpreterMessages::queryNotANodeList( MessageType::error, MessageFragment::xModule, 187 #ifndef SP_NO_MESSAGE_TEXT ,"query expression: %1 not a node list" ,"ISO/IEC 10179:1996 11.2 12.4.1 [152] [164]" #endif ); const MessageType1 InterpreterMessages::priorityNotAnExactInteger( MessageType::error, MessageFragment::xModule, 188 #ifndef SP_NO_MESSAGE_TEXT ,"priority expression: %1 not an exact integer" ,"ISO/IEC 10179:1996 11.2 12.4.1 [152] [164]" #endif ); const MessageType0 InterpreterMessages::badTopLevelFlowObj( MessageType::error, MessageFragment::xModule, 189 #ifndef SP_NO_MESSAGE_TEXT ,"flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence" ,"ISO/IEC 10179:1996 12.4.1" #endif ); const MessageType0 InterpreterMessages::noPrincipalPort( MessageType::error, MessageFragment::xModule, 190 #ifndef SP_NO_MESSAGE_TEXT ,"current flow parent has no principal port" #endif ); const MessageType0 InterpreterMessages::noParagraphAncestor( MessageType::error, MessageFragment::xModule, 191 #ifndef SP_NO_MESSAGE_TEXT ,"this flow object requires a paragraph as an ancestor flow object" #endif ); const MessageType0 InterpreterMessages::notInlineFlowObj( MessageType::error, MessageFragment::xModule, 192 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only inline flow objects accepted" #endif ); const MessageType0 InterpreterMessages::notDisplayFlowObj( MessageType::error, MessageFragment::xModule, 193 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only display flow objects accepted" #endif ); const MessageType0 InterpreterMessages::notInlineOrDisplayFlowObj( MessageType::error, MessageFragment::xModule, 194 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only display or inline flow objects accepted" #endif ); const MessageType0 InterpreterMessages::notValidInParagraph( MessageType::error, MessageFragment::xModule, 195 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted in a paragraph; only inline, display or paragraph-break flow objects accepted" #endif ); const MessageType0 InterpreterMessages::notSideBySideItem( MessageType::error, MessageFragment::xModule, 196 #ifndef SP_NO_MESSAGE_TEXT ,"a side-by-side flow object only accepts side-by-side-item flow objects as children" #endif ); const MessageType0 InterpreterMessages::notMathSequence( MessageType::error, MessageFragment::xModule, 197 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects accepted" #endif ); const MessageType0 InterpreterMessages::notGridCell( MessageType::error, MessageFragment::xModule, 198 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; must be grid-cell" #endif ); const MessageType0 InterpreterMessages::notSingleChar( MessageType::error, MessageFragment::xModule, 199 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only a single character flow object accepted" #endif ); const MessageType0 InterpreterMessages::badTableContent( MessageType::error, MessageFragment::xModule, 200 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowed" #endif ); const MessageType0 InterpreterMessages::badTablePartHF( MessageType::error, MessageFragment::xModule, 201 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only table-row or table-cell flow objects accepted" #endif ); const MessageType0 InterpreterMessages::badTablePartBody( MessageType::error, MessageFragment::xModule, 202 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowd" #endif ); const MessageType0 InterpreterMessages::badTableRow( MessageType::error, MessageFragment::xModule, 203 #ifndef SP_NO_MESSAGE_TEXT ,"flow object not accepted by port; only table-cell flow objects accepted" #endif ); const MessageType0 InterpreterMessages::priorityNotNumber( MessageType::error, MessageFragment::xModule, 204 #ifndef SP_NO_MESSAGE_TEXT ,"priority-expression must be a number" #endif ); const MessageType0 InterpreterMessages::queryNotNodelist( MessageType::error, MessageFragment::xModule, 205 #ifndef SP_NO_MESSAGE_TEXT ,"query-expression must be a node-list" #endif ); const MessageType0 InterpreterMessages::sorryPriority( MessageType::error, MessageFragment::xModule, 206 #ifndef SP_NO_MESSAGE_TEXT ,"Sorry, non-integral priorities not implemented" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/style/InterpreterMessages.h0000444000021000000240000002507607067713002015041 // This file was automatically generated from InterpreterMessages.msg by msggen.pl. #ifndef InterpreterMessages_INCLUDED #define InterpreterMessages_INCLUDED 1 #ifdef __GNUG__ #pragma interface #endif #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct InterpreterMessages { // 0 static const MessageType0 unexpectedEof; // 1 static const MessageType0 invalidChar; // 2 static const MessageType0 unknownHash; // 3 static const MessageType1 unknownNamedConstant; // 4 static const MessageType1 unexpectedToken; // 5 static const MessageType0 unterminatedString; // 6 static const MessageType0 missingCloseParen; // 7 static const MessageType1 invalidNumber; // 8 static const MessageType1 invalidAfiiGlyphId; // 9 static const MessageType1 callNonFunction; // 10 static const MessageType0 tooManyArgs; // 11 static const MessageType0 oddKeyArgs; // 12 static const MessageType0 missingArg; // 13 static const MessageType1 syntacticKeywordAsVariable; // 14 static const MessageType1 undefinedVariableReference; // 15 static const MessageType1 badCharName; // 18 static const MessageType1 unknownTopLevelForm; // 19 static const MessageType1 badModeForm; // 20 static const MessageType1L duplicateDefinition; // 22 static const MessageType1 identifierLoop; // 23 static const MessageType0 outOfRange; // 24 static const MessageType1 unitLoop; // 25 static const MessageType1 badUnitDefinition; // 26 static const MessageType1L duplicateUnitDefinition; // 28 static const MessageType1 undefinedQuantity; // 29 static const MessageType0 incompatibleDimensions; // 30 static const MessageType3 notABoolean; // 31 static const MessageType3 notAPair; // 32 static const MessageType3 notAList; // 33 static const MessageType3 notASymbol; // 34 static const MessageType3 notAString; // 35 static const MessageType3 notAStringOrSymbol; // 36 static const MessageType3 notAChar; // 37 static const MessageType3 notAStyle; // 38 static const MessageType3 notAnExactInteger; // 39 static const MessageType3 notAQuantity; // 40 static const MessageType3 notAColorSpace; // 41 static const MessageType3 notANumber; // 42 static const MessageType3 notASosofo; // 43 static const MessageType3 notAnOptSingletonNode; // 44 static const MessageType3 notASingletonNode; // 45 static const MessageType3 notANodeList; // 46 static const MessageType3 notANamedNodeList; // 47 static const MessageType3 notALengthSpec; // 48 static const MessageType3 notAQuantityOrLengthSpec; // 49 static const MessageType3 notAPriority; // 51 static const MessageType3 notAnAddress; // 52 static const MessageType3 notAGlyphId; // 53 static const MessageType3 notAGlyphSubstTable; // 54 static const MessageType3 notAGlyphIdPairList; // 55 static const MessageType3 notAProcedure; // 56 static const MessageType3 notAVector; // 57 static const MessageType0L duplicateRootRule; // 59 static const MessageType1L duplicateInitialValue; // 61 static const MessageType1 invalidStyleKeyword; // 62 static const MessageType2 invalidMakeKeyword; // 63 static const MessageType1 unknownFlowObjectClass; // 64 static const MessageType1 atomicContent; // 65 static const MessageType0 labelNotASymbol; // 66 static const MessageType1 badConnection; // 67 static const MessageType0 badContentMap; // 68 static const MessageType1 contentMapBadPort; // 69 static const MessageType1 invalidCharacteristicValue; // 70 static const MessageType0 condFail; // 71 static const MessageType1 caseFail; // 72 static const MessageType1 caseElse; // 73 static const MessageType0 caseUnresolvedQuantities; // 74 static const MessageType1 errorProc; // 75 static const MessageType0 divideBy0; // 76 static const MessageType1 invalidKeyArg; // 77 static const MessageType0 keyArgsNotKey; // 79 static const MessageType0 specNotArc; // 80 static const MessageType0 noStyleSpec; // 81 static const MessageType1 unknownCharName; // 82 static const MessageType0 noCurrentNode; // 83 static const MessageType0 noCurrentProcessingMode; // 84 static const MessageType0 invalidRadix; // 85 static const MessageType0 sosofoContext; // 86 static const MessageType0 styleContext; // 87 static const MessageType0 notInCharacteristicValue; // 89 static const MessageType1 colorArgCount; // 90 static const MessageType1 colorArgType; // 91 static const MessageType1 colorArgRange; // 92 static const MessageType1 colorProcResType; // 93 static const MessageType1 unknownColorSpaceFamily; // 94 static const MessageType1 colorSpaceNoArgs; // 95 static const MessageType1 colorSpaceArgError; // 96 static const MessageType1 notABuiltinInheritedC; // 97 static const MessageType1 invalidNumberFormat; // 98 static const MessageType1 invalidPublicIdChar; // 99 static const MessageType1 debug; // 100 static const MessageType0 useLoop; // 101 static const MessageType1 missingPart; // 102 static const MessageType0 noParts; // 103 static const MessageType0 tableCellOutsideTable; // 104 static const MessageType0 tableRowOutsideTable; // 105 static const MessageType1 noNodePropertyValue; // 106 static const MessageType0 returnNotNodeList; // 107 static const MessageType0 stackTrace; // 108 static const MessageType1 stackTraceEllipsis; // 109 static const MessageType0 processNodeLoop; // 110 static const MessageType0 spliceNotList; // 111 static const MessageType0 readOnly; // 112 static const MessageType1 topLevelAssignment; // 113 static const MessageType0 continuationDead; // 114 static const MessageType0 patternEmptyGi; // 115 static const MessageType0 patternNotList; // 116 static const MessageType1 patternBadGi; // 117 static const MessageType1 patternBadMember; // 118 static const MessageType0 patternMissingQualifierValue; // 119 static const MessageType1 patternUnknownQualifier; // 120 static const MessageType2 patternBadQualifierValue; // 121 static const MessageType0 patternChildRepeat; // 122 static const MessageType0 patternBadAttributeQualifier; // 123 static const MessageType1L ambiguousStyle; // 125 static const MessageType0 ambiguousMatch; // 126 static const MessageType1 uninitializedVariableReference; // 127 static const MessageType1 actualLoop; // 128 static const MessageType1L duplicateCharacteristic; // 130 static const MessageType1L duplicateFlowObjectClass; // 132 static const MessageType1 undefinedMode; // 133 static const MessageType1 duplicateCharName; // 134 static const MessageType1 duplicateSdataEntityName; // 135 static const MessageType1 duplicateSdataEntityText; // 136 static const MessageType0 unsupportedDeclaration; // 137 static const MessageType1 unsupportedCharRepertoire; // 138 static const MessageType0 badDeclaration; // 140 static const MessageType1 invalidIdentifier; // 141 static const MessageType0 badLanguageDefinition; // 142 static const MessageType0 noCurrentLanguage; // 143 static const MessageType3 notALanguage; // 144 static const MessageType3 notAPositiveInteger; // 145 static const MessageType3 notAnInteger; // 146 static const MessageType3 notAKeyword; // 147 static const MessageType3 notAnAlist; // 148 static const MessageType3 notACharList; // 149 static const MessageType3 lengthError; // 150 static const MessageType1 noExactRepresentation; // 151 static const MessageType0L duplicateDefLangDecl; // 153 static const MessageType1 defLangDeclRequiresLanguage; // 154 static const MessageType1 invalidUnitName; // 155 static const MessageType1 invalidCharName; // 156 static const MessageType1 invalidCharNumber; // 157 static const MessageType1 unknownCharProperty; // 158 static const MessageType0 badAddCharProperty; // 159 static const MessageType1L duplicateCharPropertyDecl; // 161 static const MessageType1L duplicateAddCharProperty; // 163 static const MessageType0 returnNotSosofo; // 164 static const MessageType1 charPropertyLoop; // 165 static const MessageType2 charPropertyNotInteger; // 166 static const MessageType2 charPropertyNotIntegerOrFalse; // 167 static const MessageType1 unknownFeature; // 168 static const MessageType1 missingFeature; // 169 static const MessageType1 unsupportedFeature; // 170 static const MessageType1 partiallySupportedFeature; // 171 static const MessageType0 styleLanguage; // 172 static const MessageType0 transformationLanguage; // 173 static const MessageType0 mixedLanguages; // 174 static const MessageType0 partialSpec; // 175 static const MessageType1 cantOmitModule; // 176 static const MessageType1 cantAddModule; // 177 static const MessageType1 unknownModule; // 178 static const MessageType2 notACharInCharMap; // 179 static const MessageType2 charPropertyNotPublicId; // 180 static const MessageType1 duplicateVariableBinding; // 181 static const MessageType0 subgroveArgs; // 182 static const MessageType0 subgroveSubgroveArgs; // 183 static const MessageType0 subgroveClassArgs; // 184 static const MessageType3 notASubgroveSpec; // 185 static const MessageType1 notACspecList; // 186 static const MessageType1 notACspecOrCspecList; // 187 static const MessageType1 queryNotANodeList; // 188 static const MessageType1 priorityNotAnExactInteger; // 189 static const MessageType0 badTopLevelFlowObj; // 190 static const MessageType0 noPrincipalPort; // 191 static const MessageType0 noParagraphAncestor; // 192 static const MessageType0 notInlineFlowObj; // 193 static const MessageType0 notDisplayFlowObj; // 194 static const MessageType0 notInlineOrDisplayFlowObj; // 195 static const MessageType0 notValidInParagraph; // 196 static const MessageType0 notSideBySideItem; // 197 static const MessageType0 notMathSequence; // 198 static const MessageType0 notGridCell; // 199 static const MessageType0 notSingleChar; // 200 static const MessageType0 badTableContent; // 201 static const MessageType0 badTablePartHF; // 202 static const MessageType0 badTablePartBody; // 203 static const MessageType0 badTableRow; // 204 static const MessageType0 priorityNotNumber; // 205 static const MessageType0 queryNotNodelist; // 206 static const MessageType0 sorryPriority; }; #ifdef SP_NAMESPACE } #endif #endif /* not InterpreterMessages_INCLUDED */ OpenJade-1.4devel/style/LangObj.cxx0000644000021000000240000002770007025631171012733 // Copyright (c) 1998, 1999 Matthias Clasen // See the file copying.txt for copying permission. #include "stylelib.h" #include "LangObj.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef SP_HAVE_LOCALE #include #endif #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef SP_HAVE_LOCALE static char *strdup(const char *s) { size_t l = strlen(s) + 1; return (char *) memcpy ((char *) malloc (sizeof (char) * l), s, l); } static char *stringify(const StringC &s) { char *r = (char *) malloc (sizeof(char)*(s.size() + 1)); for (size_t i = 0; i < s.size(); i++) r[i] = char(s[i]); r[s.size()] = 0; return r; } // FIXME this is unneeded if SP_WCHAR_IS_USHORT static wchar_t *wchartify(const StringC &s) { wchar_t *r = (wchar_t *) malloc (sizeof(wchar_t)*(s.size() + 1)); for (size_t i = 0; i < s.size(); i++) r[i] = wchar_t(s[i]); r[s.size()] = 0; return r; } char *RefLangObj::localeName(const StringC &lang, const StringC &country) { char *p; p = (char *) malloc (sizeof(char)*(lang.size() + country.size() + 2)); size_t i; for (i = 0; i < lang.size(); i++) p[i] = tolower(char(lang[i])); p[i++] = '_'; for (size_t j = 0; j < country.size(); j++, i++) p[i] = toupper(char(country[j])); p[i] = 0; return p; } bool RefLangObj::supportedLanguage(const StringC &lang, const StringC &country) { char *p = RefLangObj::localeName(lang, country); char *old = strdup(setlocale(LC_ALL, 0)); bool res = (setlocale(LC_ALL, p) != 0); setlocale(LC_ALL, old); free (p); free (old); return res; } RefLangObj::RefLangObj(const StringC &lang, const StringC &country) { char *p = localeName(lang, country); oldLocale_ = strdup(setlocale(LC_ALL, 0)); newLocale_ = strdup(setlocale(LC_ALL, p)); free (p); } RefLangObj::~RefLangObj() { free (oldLocale_); free (newLocale_); } LanguageObj *RefLangObj::asLanguage() { return this; } Char RefLangObj::toUpper(const Char c) const { setlocale(LC_ALL, newLocale_); Char uc = towupper(c); setlocale(LC_ALL, oldLocale_); return uc; } Char RefLangObj::toLower(const Char c) const { setlocale(LC_ALL, newLocale_); Char lc = towlower(c); setlocale(LC_ALL, oldLocale_); return lc; } bool RefLangObj::areEquivalent(const StringC &r, const StringC &s, const Char l) const { setlocale(LC_ALL, newLocale_); wchar_t *rr = wchartify(r); unsigned rn = wcsxfrm (0, rr, 0); wchar_t *rx = (wchar_t *) malloc (sizeof(wchar_t)*rn); wcsxfrm(rx, rr, rn); wchar_t *ss = wchartify(s); unsigned sn = wcsxfrm (0, ss, 0); wchar_t *sx = (wchar_t *) malloc (sizeof(wchar_t)*sn); wcsxfrm(sx, ss, sn); bool res; unsigned k = 0; for (unsigned i = 0; ; i++) { if (rx[i] != sx[i]) { res = 0; break; } if (rx[i] == 1) k++; if (k == l || rx[i] == 0) { res = 1; break; } } free (rr); free (ss); free (rx); free (sx); setlocale(LC_ALL, oldLocale_); return res; } bool RefLangObj::isLess(const StringC &r, const StringC &s) const { setlocale(LC_ALL, newLocale_); wchar_t *rr = wchartify(r); wchar_t *ss = wchartify(s); int res = wcscoll(rr, ss); free (rr); free (ss); setlocale(LC_ALL, oldLocale_); return (res < 0); } bool RefLangObj::isLessOrEqual(const StringC &r, const StringC &s) const { setlocale(LC_ALL, newLocale_); wchar_t *rr = wchartify(r); wchar_t *ss = wchartify(s); int res = wcscoll(rr, ss); free (rr); free (ss); setlocale(LC_ALL, oldLocale_); return (res <= 0); } #endif /* SP_HAVE_LOCALE */ class LangBuildData { public: LangBuildData() : currentpos(0) {}; HashTable order; Char currentpos; HashTable ce; HashTable syms; }; class LangData { public: LangData(); LangObj::LevelSort level[20]; // FIXME Char levels; HashTable weights; HashTable collate; CharMap toupper; CharMap tolower; }; LangData::LangData() { toupper.setAll(charMax); tolower.setAll(charMax); levels = 0; } void LangObj::addMultiCollatingElement(const StringC &sym, const StringC &str) { buildData_->ce.insert(sym, str); } void LangObj::addCollatingSymbol(const StringC &sym) { buildData_->syms.insert(sym, charMax); } void LangObj::addLevel(const LevelSort &sort) { data_->level[data_->levels++] = sort; } void LangObj::addDefaultPos() { StringC empty; addCollatingPos(empty); } bool LangObj::addCollatingPos(const StringC &sym) { if (!buildData_->ce.lookup(sym) && !buildData_->syms.lookup(sym)) if (sym.size() <= 1) buildData_->ce.insert(sym, sym); else return 0; buildData_->order.insert(StringC(&buildData_->currentpos, 1), sym); buildData_->currentpos++; return 1; } bool LangObj::addLevelWeight(const Char l, const StringC &w) { if (!buildData_->ce.lookup(w) && !buildData_->syms.lookup(w)) if (w.size() <= 1) buildData_->ce.insert(w, w); else return 0; StringC key; key.resize(3); key[0] = buildData_->currentpos - 1; key[1] = l; for (key[2] = 0; buildData_->order.lookup(key); key[2]++) ; buildData_->order.insert(key, w); return 1; } void LangObj::addToupper(const Char lc, const Char uc) { data_->toupper.setChar(lc, uc); } void LangObj::addTolower(const Char uc, const Char lc) { data_->tolower.setChar(uc, lc); } LangObj::LangObj() { buildData_ = new LangBuildData; data_ = new LangData; } LangObj::~LangObj() { if (buildData_) delete buildData_; if (data_) delete data_; } bool LangObj::compile() { const Char *col; StringC key, val, data; StringC empty; const StringC *match, *match2; data_->collate.insert(empty, buildData_->currentpos); key.resize(1); for (key[0] = 0; key[0] < buildData_->currentpos; key[0]++) { match = buildData_->order.lookup(key); if (match == 0) return 0; match2 = buildData_->ce.lookup(*match); if (match2 == 0) buildData_->syms.insert(*match, key[0]); else data_->collate.insert(*match2, key[0]); } key.resize(2); data.resize(3); for (data[0] = 0; data[0] < buildData_->currentpos; data[0]++) { key[0] = data[0]; for (data[1] = 0; data[1] < levels(); data[1]++) { key[1] = data[1]; val.resize(0); for (data[2] = 0; buildData_->order.lookup(data); data[2]++) { match = buildData_->order.lookup(data); if (match == 0) return 0; match2 = buildData_->ce.lookup(*match); if (match2 == 0) col = buildData_->syms.lookup(*match); else col = data_->collate.lookup(*match2); if (col == 0) return 0; val += *col; } data_->weights.insert(key, val); } } delete buildData_; buildData_ = 0; return 1; } LanguageObj *LangObj::asLanguage() { return this; } bool LangObj::areEquivalent(const StringC &r, const StringC &s, const Char k) const { return (compare(r, s, k) == 0); } int LangObj::compare(const StringC &rr, const StringC &ss, const Char k) const { StringC rc = asCollatingElts(rr); StringC sc = asCollatingElts(ss); for (Char l = 0; (l < k) && (l < levels()); l++) { StringC r = atLevel(rc, l); StringC s = atLevel(sc, l); for (size_t i = 0; (i < r.size()) || (i < s.size()); i++) { if (i == r.size()) return -1; if (i == s.size()) return 1; if (r[i] < s[i]) return -1; if (r[i] > s[i]) return 1; } } return 0; } StringC LangObj::asCollatingElts(const StringC &s) const { StringC res, key, empty; unsigned i, j; int col; const Char *c, *def; Char def_val; def = data_->collate.lookup(empty); def_val = (def == 0) ? charMax : *def; for (i = 0; i < s.size(); i = j) { col = def_val; key = empty; for (j = i; j < s.size(); j++) { key += s[j]; c = data_->collate.lookup(key); if (c == 0) break; col = *c; } if (i == j) // if we get here, s[j] is a single `unknown' char and // we better not reconsider it to avoid an infinite loop. j++; res += col; } return res; } StringC LangObj::atLevel(const StringC &s, const Char l) const { StringC cols, res, key; const StringC *w; if (data_->level[l].backward) for (int i = s.size() - 1; i >= 0; i--) cols += s[i]; else cols = s; key.resize(2); key[1] = l; for (size_t i = 0; i < cols.size(); i++) { key[0] = cols[i]; w = data_->weights.lookup(key); if (w == 0) return res; if (data_->level[l].backward) for (int j = w->size() - 1; j >= 0; j--) { if (data_->level[l].position) res += i; res += (*w)[j]; } else // forward for (int j = 0; j < w->size(); j++) { if (data_->level[l].position) res += i; res += (*w)[j]; } } return res; } Char LangObj::toUpper(const Char c) const { Char uc = data_->toupper[c]; return (uc == charMax) ? c : uc; } Char LangObj::toLower(const Char c) const { Char lc = data_->tolower[c]; return (lc == charMax) ? c : lc; } unsigned LangObj::levels() const { return data_->levels; } bool LangObj::isLess(const StringC &r, const StringC &s) const { return (compare(r, s, levels()) < 0); } bool LangObj::isLessOrEqual(const StringC &r, const StringC &s) const { return (compare(r, s, levels()) <= 0); } #ifdef DSSSL_NAMESPACE } #endif /* Notes on the LangObj class: All data is in the classes LanguageData and LanguageBuildData. The LanguageBuildData is only needed until we call LanguageObj::compile() and is freed afterwards. Once a LangObj is built, we use the functions isLess(), isLessOrEqual(), toUpper(), toLower() and areEquivalent() to implement the language-dependent functions of the expression language. The LangBuildData stores a map symbols --> strings for multi-collating-elements (ce) and a second map positions --> symbols (order). These are incrementally filled up while parsing a define-language expression. order also stores a map positions x levels x weight-numbers --> weights (there may be more than one weight for a given position and level). The empty string is used as key for the default entry in syms. Compilation is done in two phases: In the first phase, we build the syms and collate maps (syms maps symbols --> positions and collate maps multi-collating-elements --> positions). This is achived by inverting the corresponding part of order. In the next phase, the weights map is built. It maps positions x levels x weight-numbers --> positions. Comparing two string works in three phases: First, the strings are converted to positions (done by asCollatingElts()), then we are comparing one level at a time. For this, the strings of positions are converted into strings of weights. How this is done depends on the level. Finally the strings of weights are lexicographically compared. Notes on the RefLangObj class: It uses the underlying POSIX locale system and wchar_t. At least with GNU libc, wchar_t is always encoded as ISO-10646 UCS4, thus the Char and wchar_t codes of a character have the same value. But since sizeof(wchar_t) = 4 != 2 = sizeof(Char), we have to do ugly conversions (at least on i386-linux-glibc2) to be able to use the libc wide character routines wcscoll() and wcsxfrm(). To create a language by reference to a locale, use the external procedure with pubid UNREGISTERED::OpenJade//Procedure::language (language lang country) where lang and country are symbols or strings like the ones used for the language: and country: characteristics of the paragraph FO. If the locale is not supported, language returns #f. If Jade is compiled without locale support (!SP_HAVE_LOCALE) language *always* returns #f. The implementation of string-equiv? depends on the fact that wcsxfrm() returns a 0-terminated string of integers where the substrings for each level are separated by 1. This is true for glibc, but I don't know if it is universally true. */ OpenJade-1.4devel/style/LangObj.h0000644000021000000240000000514307025631171012355 // Copyright (c) 1998, 1999 Matthias Clasen // See the file copying.txt for copying permission. #ifndef LangObj_INCLUDED #define LangObj_INCLUDED 1 #include "config.h" #include "ELObj.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class LanguageObj : public ELObj { public: virtual Char toUpper(const Char) const = 0; virtual Char toLower(const Char) const = 0; virtual bool areEquivalent(const StringC &, const StringC &, const Char) const = 0; virtual bool isLess(const StringC &, const StringC &) const = 0; virtual bool isLessOrEqual(const StringC &, const StringC &) const = 0; }; #ifdef SP_HAVE_LOCALE class RefLangObj : public LanguageObj { public: static bool supportedLanguage(const StringC &, const StringC &); RefLangObj(const StringC &, const StringC &); ~RefLangObj(); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LanguageObj *asLanguage(); Char toUpper(const Char) const; Char toLower(const Char) const; bool areEquivalent(const StringC &, const StringC &, const Char) const; bool isLess(const StringC &, const StringC &) const; bool isLessOrEqual(const StringC &, const StringC &) const; private: static char *localeName(const StringC &, const StringC &); char *oldLocale_; char *newLocale_; }; #endif /* SP_HAVE_LOCALE */ class LangBuildData; class LangData; class LangObj : public LanguageObj { public: struct LevelSort { unsigned int forward :1; unsigned int backward :1; unsigned int position :1; }; LangObj(); ~LangObj(); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LanguageObj *asLanguage(); unsigned levels() const; Char toUpper(const Char) const; Char toLower(const Char) const; bool areEquivalent(const StringC &, const StringC &, const Char) const; bool isLess(const StringC &, const StringC &) const; bool isLessOrEqual(const StringC &, const StringC &) const; private: void addMultiCollatingElement(const StringC &, const StringC &); void addCollatingSymbol(const StringC &); void addLevel(const LevelSort &); void addDefaultPos(); bool addCollatingPos(const StringC &); bool addLevelWeight(const Char, const StringC &); void addToupper(const Char, const Char); void addTolower(const Char, const Char); bool compile(); int compare(const StringC &, const StringC &, const Char) const; StringC asCollatingElts(const StringC &) const; StringC atLevel(const StringC &, const Char) const; LangBuildData *buildData_; LangData *data_; friend class SchemeParser; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not LangObj_INCLUDED */ OpenJade-1.4devel/style/MacroFlowObj.cxx0000644000021000000240000001232307025631171013736 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "MacroFlowObj.h" #include "VM.h" #include "Insn2.h" #include "Insn.h" #include "Expression.h" #include "Interpreter.h" #include "ProcessContext.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif MacroFlowObj::MacroFlowObj(Vector &nics, NCVector > &inits, const Identifier *contentsId, Owner &body) : sp_(new S(new Definition(nics, inits, contentsId, body))) { size_t n = sp_->def_->nics().size(); sp_->charicVals_ = new ELObj *[n]; for (size_t i = 0; i < n; i++) sp_->charicVals_[i] = 0; } MacroFlowObj::MacroFlowObj(const MacroFlowObj &obj) : CompoundFlowObj(obj), sp_(new S(obj.sp_->def_.pointer())) { size_t n = sp_->def_->nics().size(); sp_->charicVals_ = new ELObj *[n]; for (size_t i = 0; i < n; i++) sp_->charicVals_[i] = obj.sp_->charicVals_[i]; } MacroFlowObj::~MacroFlowObj() { delete [] sp_->charicVals_; } FlowObj *MacroFlowObj::copy(Collector &c) const { return new (c) MacroFlowObj(*this); } CompoundFlowObj *MacroFlowObj::asCompoundFlowObj() { if (sp_->def_->isCompound()) return this; else return 0; } bool MacroFlowObj::hasNonInheritedC(const Identifier *id) const { const Vector &nics = sp_->def_->nics(); for (size_t i = 0; i < nics.size(); i++) if (nics[i] == id) return 1; return 0; } void MacroFlowObj::setNonInheritedC(const Identifier *id, ELObj *obj, const Location &, Interpreter &) { const Vector &nics = sp_->def_->nics(); for (size_t i = 0;; i++) { if (nics[i] == id) { sp_->charicVals_[i] = obj; return; } } } void MacroFlowObj::traceSubObjects(Collector &c) const { size_t n = sp_->def_->nics().size(); for (size_t i = 0; i < n; i++) c.trace(sp_->charicVals_[i]); CompoundFlowObj::traceSubObjects(c); } class EmptyStyleObj : public StyleObj { public: void appendIter(StyleObjIter &) const { } }; void MacroFlowObj::unpack(VM &vm) { size_t n = sp_->def_->nics().size(); vm.needStack(n + 1 + sp_->def_->isCompound()); for (size_t i = 0; i < n; i++) *vm.sp++ = sp_->charicVals_[i]; if (sp_->def_->isCompound()) { ELObj *tem = content(); if (!tem) tem = new (*vm.interp) ProcessChildrenSosofoObj(vm.interp->initialProcessingMode(), location()); *vm.sp++ = tem; } } void MacroFlowObj::processInner(ProcessContext &context) { FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSequence(); sp_->def_->process(context, this); fotb.endSequence(); } MacroFlowObj::Definition::Definition(Vector &charics, NCVector > &charicInits, const Identifier *contentsId, Owner &body) : contentsId_(contentsId) { charics.swap(charics_); charicInits.swap(charicInits_); charicInits_.resize(charics_.size()); body.swap(body_); } void MacroFlowObj::Definition::process(ProcessContext &context, MacroFlowObj *macro) { VM &vm = context.vm(); Interpreter &interp = *vm.interp;; if (code_.isNull()) compile(interp); StyleStack *saveStyleStack = vm.styleStack; vm.styleStack = &context.currentStyleStack(); unsigned saveSpecLevel = vm.specLevel; vm.specLevel = vm.styleStack->level(); Vector dep; vm.actualDependencies = &dep; ELObj *obj = context.vm().eval(code_.pointer(), 0, macro); vm.styleStack = saveStyleStack; vm.specLevel = saveSpecLevel; if (!interp.isError(obj)) { ELObjDynamicRoot protect(interp, obj); ((SosofoObj *)obj)->process(context); } } class UnpackMacroFlowObjInsn : public Insn { public: UnpackMacroFlowObjInsn(InsnPtr next) : next_(next) { } const Insn *execute(VM &vm) const { ((MacroFlowObj *)*--vm.sp)->unpack(vm); return next_.pointer(); } private: InsnPtr next_; }; void MacroFlowObj::Definition::compile(Interpreter &interp) { InsnPtr result; result = new CheckSosofoInsn(body_->location(), result); int nPush = charics_.size() + (contentsId_ != 0); result = PopBindingsInsn::make(nPush, result); BoundVarList frameVars; for (size_t i = 0; i < charics_.size(); i++) { if (i > 0 && charicInits_[i]) charicInits_[i]->markBoundVars(frameVars, 0); frameVars.append(charics_[i], 0); } if (contentsId_) frameVars.append(contentsId_, 0); body_->markBoundVars(frameVars, 0); result = Expression::optimizeCompile(body_, interp, Environment(frameVars, BoundVarList()), nPush, result); for (size_t i = charics_.size(); i > 0; i--) { int stackOffset = int(i) - nPush - 1; if (frameVars[i - 1].boxed()) result = new BoxStackInsn(stackOffset, result); InsnPtr ifNull = new SetKeyArgInsn(stackOffset, result); if (charicInits_[i - 1]) { BoundVarList f(frameVars); f.resize(i - 1); ifNull = Expression::optimizeCompile(charicInits_[i - 1], interp, Environment(f, BoundVarList()), nPush, ifNull); } else ifNull = new ConstantInsn(interp.makeFalse(), ifNull); result = new TestNullInsn(stackOffset, ifNull, result); } code_ = new UnpackMacroFlowObjInsn(result); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/MacroFlowObj.h0000644000021000000240000000452707025631171013372 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #ifndef MacroFlowObj_INCLUDED #define MacroFlowObj_INCLUDED 1 #include "SosofoObj.h" #include "Insn.h" #include #include #include #include #include #include "Expression.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ProcessContext; class Identifier; class Interpreter; class MacroFlowObj : public CompoundFlowObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } class Definition : public Resource { public: Definition(Vector &, NCVector > &, const Identifier *contentsId, Owner &); void process(ProcessContext &, MacroFlowObj *); bool isCompound() const; const Vector &nics() const; private: Definition(const Definition &); // undefined void operator=(const Definition &); // undefined void compile(Interpreter &); Vector charics_; NCVector > charicInits_; const Identifier *contentsId_; Owner body_; InsnPtr code_; }; MacroFlowObj(Vector &, NCVector > &, const Identifier *contentsId, Owner &); MacroFlowObj(const MacroFlowObj &); ~MacroFlowObj(); FlowObj *copy(Collector &) const; CompoundFlowObj *asCompoundFlowObj(); bool hasNonInheritedC(const Identifier *) const; void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); void traceSubObjects(Collector &) const; void processInner(ProcessContext &); AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } void unpack(VM &); private: void operator=(const MacroFlowObj &); // undefined // Only one pointer/owner allowed. struct S { S(Definition *d, ELObj **c = 0) : def_(d), charicVals_(c) {} Ptr def_; ELObj **charicVals_; }; Owner sp_; }; inline bool MacroFlowObj::Definition::isCompound() const { return contentsId_ != 0; } inline const Vector &MacroFlowObj::Definition::nics() const { return charics_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not MacroFlowObj_INCLUDED */ OpenJade-1.4devel/style/NumberCache.cxx0000644000021000000240000001207707025631171013574 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "NumberCache.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif NumberCache::NumberCache() { } inline void advance(NodePtr &node) { if (node.assignNextChunkAfter() != accessOK) CANNOT_HAPPEN(); } // This caching scheme will be defeated (but not disastrously so) // by numbering both notes and footnotes, say, per chapter. unsigned long NumberCache::elementNumberAfter(const NodePtr &node, const StringC &gi, const StringC &resetGi) { NodePtr start; NodePtr lastMatch; unsigned long resetCount = 0; unsigned long count = 0; ElementEntry *entry = elementNumbers_.lookup(resetGi); if (entry) { unsigned long nodeIndex, entryIndex; bool useSubnode = 1; node->elementIndex(nodeIndex); unsigned long nodeGroveIndex = node->groveIndex(); if (entry->node) { if (*entry->node == *node) return 0; entry->node->elementIndex(entryIndex); if (entryIndex < nodeIndex && entry->node->groveIndex() == nodeGroveIndex) { start = lastMatch = entry->node; advance(start); resetCount = entry->num; } else useSubnode = 0; } if (entry->subNode && useSubnode) { GroveString tem; if (entry->subNode->getGi(tem) == accessOK && tem == GroveString(gi.data(), gi.size())) { if (*entry->subNode == *node) return entry->subNum; entry->subNode->elementIndex(entryIndex); if (entryIndex < nodeIndex && entry->subNode->groveIndex() == nodeGroveIndex) { start = entry->subNode; advance(start); count = entry->subNum; } } } } else elementNumbers_.insert(entry = new ElementEntry(resetGi)); if (!start) { node->getGroveRoot(start); start->getDocumentElement(start); } for (;;) { GroveString tem; if (start->getGi(tem) == accessOK) { if (tem == GroveString(resetGi.data(), resetGi.size())) { lastMatch = start; resetCount++; count = 0; } else if (tem == GroveString(gi.data(), gi.size())) count++; } if (*start == *node) break; advance(start); } entry->node = lastMatch; entry->num = resetCount; entry->subNode = node; entry->subNum = count; return count; } unsigned long NumberCache::elementNumber(const NodePtr &node, const StringC &gi) { NodePtr start; NodePtr lastMatch; unsigned long count = 0; ElementEntry *entry = elementNumbers_.lookup(gi); if (entry && entry->node) { if (*entry->node == *node) { lastMatch = node; return entry->num; } unsigned long nodeIndex, entryIndex; entry->node->elementIndex(entryIndex); node->elementIndex(nodeIndex); if (entryIndex < nodeIndex && node->groveIndex() == entry->node->groveIndex()) { lastMatch = start = entry->node; count = entry->num; advance(start); } } if (!start) { node->getGroveRoot(start); start->getDocumentElement(start); } for (;;) { GroveString tem; if (start->getGi(tem) == accessOK && tem == GroveString(gi.data(), gi.size())) { lastMatch = start; count++; } if (*start == *node) break; advance(start); } if (count) { ASSERT(lastMatch); if (!entry) elementNumbers_.insert(entry = new ElementEntry(gi)); entry->node = lastMatch; entry->subNode.clear(); entry->num = count; } return count; } bool NumberCache::childNumber(const NodePtr &node, unsigned long &result) { GroveString gs; if (node->getGi(gs) != accessOK) return 0; NodePtr tem; if (node->getParent(tem) != accessOK) { // must be document element result = 0; return 1; } NodePtr parent(tem); unsigned level = 0; while (tem->getParent(tem) == accessOK) level++; StringC gi(gs.data(), gs.size()); if (level >= childNumbers_.size()) childNumbers_.resize(level + 1); NodePtr start; unsigned long count = 0; Entry *entry = childNumbers_[level].lookup(gi); if (entry) { if (*entry->node == *node) { result = entry->num; return 1; } // Start counting from the cached entry if it has the same // parent as us and it is before us. NodePtr entryParent; entry->node->getParent(entryParent); if (*entryParent == *parent) { unsigned long nodeIndex, entryIndex; entry->node->elementIndex(entryIndex); node->elementIndex(nodeIndex); if (entryIndex < nodeIndex && node->groveIndex() == entry->node->groveIndex()) { start = entry->node; count = entry->num; } } } else { entry = new Entry(gi); childNumbers_[level].insert(entry); } if (!start) node->firstSibling(start); while (*start != *node) { GroveString tem; if (start->getGi(tem) == accessOK && tem == gs) count++; if (start.assignNextChunkSibling() != accessOK) CANNOT_HAPPEN(); } entry->node = node; entry->num = count; result = count; return 1; } NumberCache::Entry::Entry(const StringC &name) : Named(name) { } NumberCache::ElementEntry::ElementEntry(const StringC &name) : NumberCache::Entry(name) { } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/NumberCache.h0000644000021000000240000000247507025631171013222 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef NumberCache_INCLUDED #define NumberCache_INCLUDED 1 #include #include "Node.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class NumberCache { public: NumberCache(); // Return 0 if argument is not a node. bool childNumber(const NodePtr &node, unsigned long &); // Number of elements before or equal to node whose gi is equal to s. unsigned long elementNumber(const NodePtr &node, const StringC &s); // Number of elements before or equal to node whose gi is equal to s, // and that are after the last element before node with gi reset. unsigned long elementNumberAfter(const NodePtr &, const StringC &s, const StringC &reset); private: struct Entry : Named { Entry(const StringC &); NodePtr node; unsigned long num; }; // A separate cache for each level of the tree. NCVector > childNumbers_; struct ElementEntry : Entry { ElementEntry(const StringC &); NodePtr subNode; unsigned long subNum; }; NamedTable elementNumbers_; friend struct ElementEntry; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not NumberCache_INCLUDED */ OpenJade-1.4devel/style/Pattern.cxx0000644000021000000240000002605107067706571013047 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "Pattern.h" #include #include #include "Interpreter.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif Pattern::Pattern() { } Pattern::Pattern(IList &ancestors) : MatchBase(computeTrivial(ancestors)) { ancestors_.swap(ancestors); } bool Pattern::computeTrivial(const IList &ancestors) { IListIter iter(ancestors); if (iter.done()) return 1; if (!iter.cur()->trivial()) return 0; iter.next(); if (!iter.done()) return 0; return 1; } Pattern::Element::Element(const StringC &gi) : gi_(gi), minRepeat_(1), maxRepeat_(1) { } bool Pattern::Element::matches(const NodePtr &nd, MatchContext &context) const { if (gi_.size()) { if (!nd->hasGi(GroveString(gi_.data(), gi_.size()))) return 0; } else { GroveString tem; if (nd->getGi(tem) != accessOK) return 0; } for (IListIter iter(qualifiers_); !iter.done(); iter.next()) if (!iter.cur()->satisfies(nd, context)) return 0; return 1; } bool Pattern::Element::trivial() const { if (minRepeat_ > 1) return 0; for (IListIter iter(qualifiers_); !iter.done(); iter.next()) if (!iter.cur()->vacuous()) return 0; return 1; } void Pattern::Element::contributeSpecificity(int *s) const { if (gi_.size()) s[giSpecificity] += minRepeat_; for (IListIter iter(qualifiers_); !iter.done(); iter.next()) iter.cur()->contributeSpecificity(s); if (minRepeat_ != maxRepeat_) s[repeatSpecificity] -= 1; } Pattern::Qualifier::~Qualifier() { } bool Pattern::Qualifier::vacuous() const { return 0; } bool Pattern::Qualifier::matchAttribute(const StringC &name, const StringC &value, const NodePtr &nd, MatchContext &context) { NamedNodeListPtr atts; if (nd->getAttributes(atts) != accessOK) return 0; NodePtr att; if (atts->namedNode(GroveString(name.data(), name.size()), att) != accessOK) return 0; bool implied; if (att->getImplied(implied) == accessOK && implied) return 0; GroveString tokens; if (att->tokens(tokens) == accessOK) { if (tokens.size() != value.size()) return 0; NodePtr node; NamedNodeListPtr normalizer; if (att->firstChild(node) != accessOK || node->getEntity(node) != accessOK || node->getGroveRoot(node) != accessOK || node->getEntities(normalizer) != accessOK) normalizer = atts; StringC tem(value); tem.resize(normalizer->normalize(&tem[0], tem.size())); if (tokens != GroveString(tem.data(), tem.size())) return 0; } else { NodePtr tem; StringC s; if (att->firstChild(tem) == accessOK) { do { GroveString chunk; if (tem->charChunk(context, chunk) == accessOK) s.append(chunk.data(), chunk.size()); } while (tem.assignNextChunkSibling() == accessOK); } if (s != value) return 0; } return 1; } Pattern::ChildrenQualifier::ChildrenQualifier(IList &children) { children.swap(children_); } bool Pattern::ChildrenQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { ASSERT(!children_.empty()); NodePtr child; if (nd->firstChild(child) != accessOK) return 0; Vector toMatch; for (IListIter iter(children_); !iter.done(); iter.next()) toMatch.push_back(iter.cur()); do { size_t j = 0; for (size_t i = 0; i < toMatch.size(); i++) { if (!toMatch[i]->matches(child, context)) { if (j != i) toMatch[j] = toMatch[i]; j++; } } if (j == 0) return 1; toMatch.resize(j); } while (child.assignNextChunkSibling() == accessOK); return 0; } void Pattern::ChildrenQualifier::contributeSpecificity(int *s) const { for (IListIter iter(children_); !iter.done(); iter.next()) iter.cur()->contributeSpecificity(s); } Pattern::IdQualifier::IdQualifier(const StringC &id) : id_(id) { } bool Pattern::IdQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { GroveString nodeId; if (nd->getId(nodeId) == accessOK) { size_t len = id_.size(); if (nodeId.size() == len) { StringC tem(id_); Interpreter::normalizeGeneralName(nd, tem); GroveString patternId(tem.data(), tem.size()); if (patternId == nodeId) return 1; } } const Vector &idAtts = context.idAttributeNames(); for (size_t i = 0; i < idAtts.size(); i++) if (matchAttribute(idAtts[i], id_, nd, context)) return 1; return 0; } void Pattern::IdQualifier::contributeSpecificity(int *s) const { s[idSpecificity] += 1; } Pattern::ClassQualifier::ClassQualifier(const StringC &cls) : class_(cls) { } bool Pattern::ClassQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { const Vector &classAtts = context.classAttributeNames(); for (size_t i = 0; i < classAtts.size(); i++) if (matchAttribute(classAtts[i], class_, nd, context)) return 1; return 0; } void Pattern::ClassQualifier::contributeSpecificity(int *s) const { s[classSpecificity] += 1; } Pattern::AttributeHasValueQualifier::AttributeHasValueQualifier(const StringC &name) : name_(name) { } bool Pattern::AttributeHasValueQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { NamedNodeListPtr atts; if (nd->getAttributes(atts) != accessOK) return 0; NodePtr att; if (atts->namedNode(GroveString(name_.data(), name_.size()), att) != accessOK) return 0; bool implied; if (att->getImplied(implied) == accessOK && implied) return 0; return 1; } void Pattern::AttributeHasValueQualifier::contributeSpecificity(int *s) const { s[attributeSpecificity] += 1; } Pattern::AttributeMissingValueQualifier::AttributeMissingValueQualifier(const StringC &name) : name_(name) { } bool Pattern::AttributeMissingValueQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { NamedNodeListPtr atts; if (nd->getAttributes(atts) != accessOK) return 1; NodePtr att; if (atts->namedNode(GroveString(name_.data(), name_.size()), att) != accessOK) return 1; bool implied; if (att->getImplied(implied) == accessOK && implied) return 1; return 0; } void Pattern::AttributeMissingValueQualifier::contributeSpecificity(int *s) const { s[attributeSpecificity] += 1; } Pattern::AttributeQualifier::AttributeQualifier(const StringC &name, const StringC &value) : name_(name), value_(value) { } bool Pattern::AttributeQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { return matchAttribute(name_, value_, nd, context); } void Pattern::AttributeQualifier::contributeSpecificity(int *s) const { s[attributeSpecificity] += 1; } void Pattern::PositionQualifier::contributeSpecificity(int *s) const { s[positionSpecificity] += 1; } bool Pattern::FirstOfTypeQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { GroveString ndType; nd->getGi(ndType); NodePtr tem; if (nd->firstSibling(tem) != accessOK) return 1; // must be document element while (*tem != *nd) { GroveString temType; if (tem->getGi(temType) == accessOK && temType == ndType) return 0; tem.assignNextChunkSibling(); } return 1; } bool Pattern::LastOfTypeQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { NodePtr tem; if (nd->nextChunkSibling(tem) != accessOK) return 1; GroveString ndType; nd->getGi(ndType); do { GroveString temType; if (tem->getGi(temType) == accessOK && temType == ndType) return 0; } while (tem.assignNextChunkSibling() == accessOK); return 1; } bool Pattern::FirstOfAnyQualifier::satisfies(const NodePtr &nd, MatchContext &) const { NodePtr tem; if (nd->firstSibling(tem) != accessOK) return 1; // must be document element while (*tem != *nd) { GroveString temType; if (tem->getGi(temType) == accessOK) return 0; tem.assignNextChunkSibling(); } return 1; } bool Pattern::LastOfAnyQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { NodePtr tem; if (nd->nextChunkSibling(tem) != accessOK) return 1; GroveString ndType; nd->getGi(ndType); do { GroveString temType; if (tem->getGi(temType) == accessOK) return 0; } while (tem.assignNextChunkSibling() == accessOK); return 1; } void Pattern::OnlyQualifier::contributeSpecificity(int *s) const { s[onlySpecificity] += 1; } bool Pattern::OnlyOfTypeQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { GroveString ndType; nd->getGi(ndType); NodePtr tem; if (nd->firstSibling(tem) != accessOK) return 1; // must be document element unsigned count = 0; do { GroveString temType; if (tem->getGi(temType) == accessOK && temType == ndType) { if (count++) return 0; } } while (tem.assignNextChunkSibling() == accessOK); return 1; } bool Pattern::OnlyOfAnyQualifier::satisfies(const NodePtr &nd, MatchContext &context) const { NodePtr tem; if (nd->firstSibling(tem) != accessOK) return 1; // must be document element unsigned count = 0; do { GroveString temType; if (tem->getGi(temType) == accessOK) { if (count++) return 0; } } while (tem.assignNextChunkSibling() == accessOK); return 1; } bool Pattern::VacuousQualifier::vacuous() const { return 1; } Pattern::PriorityQualifier::PriorityQualifier(long n) : n_(n) { } void Pattern::PriorityQualifier::contributeSpecificity(int *s) const { s[prioritySpecificity] += n_; } bool Pattern::PriorityQualifier::satisfies(const NodePtr &, MatchContext &) const { return 1; } Pattern::ImportanceQualifier::ImportanceQualifier(long n) : n_(n) { } void Pattern::ImportanceQualifier::contributeSpecificity(int *s) const { s[importanceSpecificity] += n_; } bool Pattern::ImportanceQualifier::satisfies(const NodePtr &, MatchContext &) const { return 1; } bool Pattern::matchAncestors1(const IListIter &ancestors, const NodePtr &node, MatchContext &context) { const Element &r = *ancestors.cur(); NodePtr tem(node); for (Repeat i = 0; i < r.minRepeat(); i++) { if (!tem || !r.matches(tem, context)) return 0; if (tem->getParent(tem) != accessOK) tem.clear(); } Repeat i = r.minRepeat(); for (;;) { IListIter up(ancestors); up.next(); if (matchAncestors(up, tem, context)) break; if (i == r.maxRepeat() || !tem || !r.matches(tem, context)) return 0; i++; if (tem->getParent(tem) != accessOK) tem.clear(); } return 1; } void Pattern::computeSpecificity(int *s) const { for (int i = 0; i < nSpecificity; i++) s[i] = 0; for (IListIter iter(ancestors_); !iter.done(); iter.next()) iter.cur()->contributeSpecificity(s); } int Pattern::compareSpecificity(const Pattern &pattern1, const Pattern &pattern2) { int s1[nSpecificity]; int s2[nSpecificity]; int i; // declare here to avoid gcc bug pattern1.computeSpecificity(s1); pattern2.computeSpecificity(s2); for (i = 0; i < nSpecificity; i++) { if (s1[i] != s2[i]) return s1[i] > s2[i] ? -1 : 1; } return 0; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Pattern.h0000644000021000000240000001713607067706572012501 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #ifndef Pattern_INCLUDED #define Pattern_INCLUDED 1 #include #include "Node.h" #include #include #include #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class MatchBase { public: class MatchContext : public SdataMapper { public: const Vector &classAttributeNames() const; const Vector &idAttributeNames() const; protected: Vector classAttributeNames_; Vector idAttributeNames_; }; MatchBase() : trivial_(0) {} MatchBase(bool trivial) : trivial_(trivial) {} bool trivial() const { return trivial_; } virtual bool matches(const NodePtr &, MatchContext &) const = 0; void swap(MatchBase &mb) { bool tem = trivial_; trivial_ = mb.trivial_; mb.trivial_ = tem; } private: bool trivial_; }; class Pattern : virtual public MatchBase { public: class Qualifier : public Link { public: virtual ~Qualifier(); virtual bool satisfies(const NodePtr &, MatchContext &) const = 0; virtual void contributeSpecificity(int *) const = 0; virtual bool vacuous() const; protected: static bool matchAttribute(const StringC &name, const StringC &value, const NodePtr &nd, MatchContext &context); }; class IdQualifier : public Qualifier { public: IdQualifier(const StringC &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: StringC id_; }; class ClassQualifier : public Qualifier { public: ClassQualifier(const StringC &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: StringC class_; }; class AttributeHasValueQualifier : public Qualifier { public: AttributeHasValueQualifier(const StringC &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: StringC name_; }; class AttributeMissingValueQualifier : public Qualifier { public: AttributeMissingValueQualifier(const StringC &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: StringC name_; }; class AttributeQualifier : public Qualifier { public: AttributeQualifier(const StringC &, const StringC &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: StringC name_; StringC value_; }; class PositionQualifier : public Qualifier { public: void contributeSpecificity(int *) const; }; class FirstOfTypeQualifier : public PositionQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class LastOfTypeQualifier : public PositionQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class FirstOfAnyQualifier : public PositionQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class LastOfAnyQualifier : public PositionQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class OnlyQualifier : public Qualifier { public: void contributeSpecificity(int *) const; }; class OnlyOfTypeQualifier : public OnlyQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class OnlyOfAnyQualifier : public OnlyQualifier { public: bool satisfies(const NodePtr &, MatchContext &) const; }; class VacuousQualifier : public Qualifier { public: bool vacuous() const; }; class PriorityQualifier : public VacuousQualifier { public: PriorityQualifier(long); void contributeSpecificity(int *) const; bool satisfies(const NodePtr &, MatchContext &) const; private: long n_; }; class ImportanceQualifier : public VacuousQualifier { public: ImportanceQualifier(long); void contributeSpecificity(int *) const; bool satisfies(const NodePtr &, MatchContext &) const; private: long n_; }; typedef unsigned Repeat; class Element : public Link { public: Element(const StringC &); bool matches(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; void addQualifier(Qualifier *); void setRepeat(Repeat minRepeat, Repeat maxRepeat); Repeat minRepeat() const; Repeat maxRepeat() const; bool mustHaveGi(StringC &) const; bool trivial() const; private: StringC gi_; Repeat minRepeat_; Repeat maxRepeat_; IList qualifiers_; }; class ChildrenQualifier : public Qualifier { public: ChildrenQualifier(IList &); bool satisfies(const NodePtr &, MatchContext &) const; void contributeSpecificity(int *) const; private: IList children_; }; Pattern(); Pattern(IList &); void swap(Pattern &); bool matches(const NodePtr &, MatchContext &) const; // If mustHaveGi returns true, then any element that matches the pattern // must have the string returned in str. bool mustHaveGi(StringC &str) const; // A pattern is trivial if any element that has the gi returned my mustHaveGi // matches the pattern, or, if mustHaveGi returns false, if any element matches // the pattern. static int compareSpecificity(const Pattern &, const Pattern &); enum { importanceSpecificity, idSpecificity, classSpecificity, giSpecificity, repeatSpecificity, prioritySpecificity, onlySpecificity, positionSpecificity, attributeSpecificity, nSpecificity }; private: Pattern(const Pattern &); // undefined void operator=(const Pattern &); // undefined void computeSpecificity(int *) const; static bool computeTrivial(const IList &); static bool matchAncestors(const IListIter &, const NodePtr &, MatchContext &); static bool matchAncestors1(const IListIter &, const NodePtr &, MatchContext &); IList ancestors_; // first is self, second is parent ... }; inline void Pattern::Element::setRepeat(Repeat minRepeat, Repeat maxRepeat) { minRepeat_ = minRepeat; maxRepeat_ = maxRepeat; } inline Pattern::Repeat Pattern::Element::minRepeat() const { return minRepeat_; } inline Pattern::Repeat Pattern::Element::maxRepeat() const { return maxRepeat_; } inline void Pattern::Element::addQualifier(Qualifier *q) { qualifiers_.insert(q); } inline bool Pattern::matchAncestors(const IListIter &ancestors, const NodePtr &node, MatchContext &context) { return ancestors.done() || matchAncestors1(ancestors, node, context); } inline bool Pattern::matches(const NodePtr &nd, MatchContext &context) const { return matchAncestors(IListIter(ancestors_), nd, context); } inline void Pattern::swap(Pattern &pattern) { MatchBase::swap(pattern); ancestors_.swap(pattern.ancestors_); } inline bool Pattern::Element::mustHaveGi(StringC &gi) const { if (minRepeat_ == 0) return 0; else if (gi_.size()) { gi = gi_; return 1; } else return 0; } inline bool Pattern::mustHaveGi(StringC &gi) const { return !ancestors_.empty() && ancestors_.head()->mustHaveGi(gi); } inline const Vector &Pattern::MatchContext::classAttributeNames() const { return classAttributeNames_; } inline const Vector &Pattern::MatchContext::idAttributeNames() const { return idAttributeNames_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not Pattern_INCLUDED */ OpenJade-1.4devel/style/ProcessContext.cxx0000644000021000000240000006751307067706575014431 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "ProcessContext.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "SosofoObj.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class RootValidator : public ProcessContext::Validator { public: RootValidator() : s_(sNone) { } bool isValid(const FlowObj &, ProcessContext &); bool charsValid(size_t, const Location &, ProcessContext &); private: enum { sNone, sScroll, sPaging }; int s_; }; class NoPrincipalPortValidator : public ProcessContext::Validator { public: NoPrincipalPortValidator() : errorFlag_(false) { } bool isValid(const FlowObj &fo, ProcessContext &context) { return charsValid(1, fo.location(), context); } bool charsValid(size_t, const Location &loc, ProcessContext &context) { if (!errorFlag_) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::noPrincipalPort); errorFlag_ = true; } return false; } private: bool errorFlag_; }; ProcessContext::ProcessContext(Interpreter &interp, FOTBuilder &fotb) : Collector::DynamicRoot(interp), vm_(interp), flowObjLevel_(0), havePageType_(0), connectableStackLevel_(0) { connectionStack_.insert(new Connection(&fotb)); validatorStack_.push_back(new RootValidator); } ProcessContext::~ProcessContext() { ASSERT(validatorStack_.size() == 1); ASSERT(invalidLevels_.size() == 0); } void ProcessContext::process(const NodePtr &node) { Interpreter &interp = *vm_.interp; StyleObj *style = interp.initialStyle(); if (style) { currentStyleStack().push(style, vm(), currentFOTBuilder()); currentFOTBuilder().startSequence(); } processNode(node, interp.initialProcessingMode(), Location()); if (style) { currentFOTBuilder().endSequence(); currentStyleStack().pop(); } } void ProcessContext::processNodeSafe(const NodePtr &nodePtr, const ProcessingMode *processingMode, const Location &loc, bool chunk) { unsigned long elementIndex; if (nodePtr->elementIndex(elementIndex) == accessOK) { unsigned groveIndex = nodePtr->groveIndex(); for (size_t i = 0; i < nodeStack_.size(); i++) { const NodeStackEntry &nse = nodeStack_[i]; if (nse.elementIndex == elementIndex && nse.groveIndex == groveIndex && nse.processingMode == processingMode) { vm_.interp->setNodeLocation(nodePtr); vm_.interp->message(InterpreterMessages::processNodeLoop); return; } } nodeStack_.resize(nodeStack_.size() + 1); NodeStackEntry &e = nodeStack_.back(); e.elementIndex = elementIndex; e.groveIndex = groveIndex; e.processingMode = processingMode; processNode(nodePtr, processingMode, loc, chunk); nodeStack_.resize(nodeStack_.size() - 1); } else processNode(nodePtr, processingMode, loc, chunk); } void ProcessContext::processNode(const NodePtr &nodePtr, const ProcessingMode *processingMode, const Location &loc, bool chunk) { ASSERT(processingMode != 0); GroveString str; if (nodePtr->charChunk(*vm_.interp, str) == accessOK) { if (!processingMode->hasCharRules()) { currentFOTBuilder().charactersFromNode(nodePtr, str.data(), chunk ? str.size() : 1); return; } else if (chunk) { NodePtr ptr = nodePtr; for (int i = 0; i < str.size(); i++) { processNode(ptr, processingMode, loc, 0); ptr->nextSibling(ptr); } return; } } EvalContext::CurrentNodeSetter cns(nodePtr, processingMode, vm()); ProcessingMode::Specificity saveSpecificity(matchSpecificity_); matchSpecificity_ = ProcessingMode::Specificity(); bool hadStyle = 0; currentFOTBuilder().startNode(nodePtr, processingMode->name()); for (;;) { const ProcessingMode::Rule *rule = vm().processingMode->findMatch(nodePtr, *vm_.interp, *vm_.interp, matchSpecificity_); if (!rule) { if (hadStyle) { currentStyleStack().pushEnd(vm(), currentFOTBuilder()); currentFOTBuilder().startSequence(); } if (nodePtr->charChunk(*vm_.interp, str) == accessOK) currentFOTBuilder().charactersFromNode(nodePtr, str.data(), 1); else processChildren(processingMode, loc); break; } if (!matchSpecificity_.isStyle()) { SosofoObj *sosofoObj; InsnPtr insn; rule->action().get(insn, sosofoObj); if (hadStyle) { currentStyleStack().pushEnd(vm(), currentFOTBuilder()); currentFOTBuilder().startSequence(); } if (sosofoObj) sosofoObj->process(*this); else { ELObj *obj = vm().eval(insn.pointer()); if (vm_.interp->isError(obj)) { if (processingMode->name().size() == 0) processChildren(processingMode, loc); } else { ELObjDynamicRoot protect(*vm_.interp, obj); ((SosofoObj *)obj)->process(*this); } } break; } SosofoObj *sosofoObj; InsnPtr insn; rule->action().get(insn, sosofoObj); ELObj *obj = vm().eval(insn.pointer()); if (!vm_.interp->isError(obj)) { if (!hadStyle) { currentStyleStack().pushStart(); hadStyle = 1; } currentStyleStack().pushContinue((StyleObj *)obj, rule, nodePtr, vm_.interp); } } if (hadStyle) { currentFOTBuilder().endSequence(); currentStyleStack().pop(); } currentFOTBuilder().endNode(); matchSpecificity_ = saveSpecificity; } void ProcessContext::nextMatch(StyleObj *overridingStyle, const Location &loc) { ProcessingMode::Specificity saveSpecificity(matchSpecificity_); StyleObj *saveOverridingStyle = vm().overridingStyle; if (overridingStyle) vm().overridingStyle = overridingStyle; const ProcessingMode::Rule *rule = vm().processingMode->findMatch(vm().currentNode, *vm_.interp, *vm_.interp, matchSpecificity_); if (rule) { ASSERT(!matchSpecificity_.isStyle()); SosofoObj *sosofoObj; InsnPtr insn; rule->action().get(insn, sosofoObj); if (sosofoObj) sosofoObj->process(*this); else { ELObj *obj = vm().eval(insn.pointer()); if (vm_.interp->isError(obj)) processChildren(vm().processingMode, loc); else { ELObjDynamicRoot protect(*vm_.interp, obj); ((SosofoObj *)obj)->process(*this); } } } else processChildren(vm().processingMode, loc); vm().overridingStyle = saveOverridingStyle; matchSpecificity_ = saveSpecificity; } void ProcessContext::processChildren(const ProcessingMode *processingMode, const Location &loc) { if (vm().currentNode.assignFirstChild() == accessOK) { do { processNode(vm().currentNode, processingMode, loc); } while (vm().currentNode.assignNextChunkSibling() == accessOK); } else if (vm().currentNode->getDocumentElement(vm().currentNode) == accessOK) processNode(vm().currentNode, processingMode, loc); } inline bool isWhiteSpace(Char c, Interpreter &interp) { return interp.isInputWhitespace().getValue(c); } static bool onlyWhiteSpaceFollows(const NodePtr &node, Interpreter &interp) { NodePtr tem; if (node->nextChunkSibling(tem) == accessOK) { do { GroveString str; if (tem->charChunk(interp, str) == accessOK) { for (size_t i = 0; i < str.size(); i++) if (!isWhiteSpace(str[i], interp)) return 0; } else if (tem->getGi(str) == accessOK) return 0; } while (tem.assignNextChunkSibling() == accessOK); } return 1; } void ProcessContext::processChildrenTrim(const ProcessingMode *processingMode, const Location &loc) { if (vm().currentNode.assignFirstChild() == accessOK) { bool atStart = 1; do { NodePtr curNode = vm().currentNode; GroveString str; if (curNode->charChunk(*vm().interp, str) == accessOK) { if (atStart) { const Char *s = str.data(); size_t n = str.size(); for (; n > 0; n--, s++) { if (!isWhiteSpace(*s, *vm().interp)) break; } if (n == 0) str.assign(0, 0); else { atStart = 0; if (s != str.data()) { if (curNode->followSiblingRef(str.size() - (n + 1), curNode) != accessOK) CANNOT_HAPPEN(); str.assign(s, n); } } } if (str.size()) { if (isWhiteSpace(str[str.size() - 1], *vm().interp) && onlyWhiteSpaceFollows(curNode, *vm().interp)) { for (size_t n = str.size() - 1; n > 0; n--) { if (!isWhiteSpace(str[n - 1], *vm().interp)) { charactersFromNode(curNode, str.data(), n, loc); return; } } return; } charactersFromNode(curNode, str.data(), str.size(), loc); } } else { if (atStart && vm().currentNode->getGi(str) == accessOK) atStart = 0; processNode(vm().currentNode, processingMode, loc); } } while (vm().currentNode.assignNextChunkSibling() == accessOK); } else if (vm().currentNode->getDocumentElement(vm().currentNode) == accessOK) processNode(vm().currentNode, processingMode, loc); } void ProcessContext::characters(const Char *ch, size_t n, const Location &loc) { if (validatorStack_.back()->charsValid(n, loc, *this)) { Vector dep; if (vm().interp->fotbDescr().wantCharPropertyNICs || currentStyleStack().actual(vm().interp->charMapC(), *vm().interp, dep)->asFunction()) { Vector v(n); // FIXME. Assumes Vector::iterator is T*. // FIXME. Location is not correct. FlowObj::fixCharNICs(ch, n, v.begin(), loc, *this); currentFOTBuilder().characters(v); } else currentFOTBuilder().characters(ch, n); } } void ProcessContext::charactersFromNode(const NodePtr &nd, const Char *ch, size_t n, const Location &loc) { if (validatorStack_.back()->charsValid(n, loc, *this)) { Vector dep; if (vm().interp->fotbDescr().wantCharPropertyNICs || currentStyleStack().actual(vm().interp->charMapC(), *vm().interp, dep)->asFunction()) { Vector v(n); // FIXME. See prev. function. // FIXME. Location is not correct. FlowObj::fixCharNICs(ch, n, v.begin(), loc, *this); currentFOTBuilder().characters(v); } else currentFOTBuilder().charactersFromNode(nd, ch, n); } } void ProcessContext::startConnection(SymbolObj *label, const Location &loc) { unsigned connLevel = connectableStackLevel_; for (IListIter iter(connectableStack_); !iter.done(); iter.next(), --connLevel) { Connectable *conn = iter.cur(); for (size_t i = 0; i < conn->ports.size(); i++) { Port &port = conn->ports[i]; for (size_t j = 0; j < port.labels.size(); j++) if (port.labels[j] == label) { restoreConnection(connLevel, i); return; } } for (size_t i = 0; i < conn->principalPortLabels.size(); i++) if (conn->principalPortLabels[i] == label) { restoreConnection(connLevel, size_t(-1)); return; } } vm().interp->setNextLocation(loc); vm().interp->message(InterpreterMessages::badConnection, StringMessageArg(*label->name())); connectionStack_.head()->nBadFollow++; } void ProcessContext::endConnection() { if (inTableRow() && tableStack_.head()->rowConnectableLevel == connectableStackLevel_) endTableRow(); if (connectionStack_.head()->nBadFollow > 0) connectionStack_.head()->nBadFollow--; else { currentFOTBuilder().endNode(); Port *port = connectionStack_.head()->port; if (port && --(port->connected) == 0) { while (!port->saveQueue.empty()) { NodeSaveFOTBuilder *saved = port->saveQueue.get(); saved->emit(*port->fotb); delete saved; } } delete connectionStack_.get(); ASSERT(validatorStack_.size() > 1); validatorStack_.resize(validatorStack_.size() - 1); } } void ProcessContext::restoreConnection(unsigned connectableLevel, size_t portIndex) { unsigned connLevel = connectableStackLevel_; IListIter iter(connectableStack_); for (; connLevel != connectableLevel; iter.next(), --connLevel) ; Connectable *conn = iter.cur(); if (portIndex != size_t(-1)) { Port &port = conn->ports[portIndex]; Connection *c = new Connection(conn->styleStack, &port, connLevel); if (port.connected) { port.connected++; NodeSaveFOTBuilder *save = new NodeSaveFOTBuilder(vm().currentNode, vm().processingMode->name()); c->fotb = save; port.saveQueue.append(save); } else { c->fotb = port.fotb; port.connected = 1; } connectionStack_.insert(c); ASSERT(port.validator.pointer() != 0); validatorStack_.push_back(port.validator); currentFOTBuilder().startNode(vm().currentNode, vm().processingMode->name()); } else { Connection *c = new Connection(conn->styleStack, 0, connLevel); if (conn->flowObjLevel == flowObjLevel_) { c->fotb = ¤tFOTBuilder(); } else { NodeSaveFOTBuilder *save = new NodeSaveFOTBuilder(vm().currentNode, vm().processingMode->name()); c->fotb = save; if (conn->flowObjLevel >= principalPortSaveQueues_.size()) principalPortSaveQueues_.resize(conn->flowObjLevel + 1); principalPortSaveQueues_[conn->flowObjLevel].append(save); } connectionStack_.insert(c); ASSERT(conn->principalPortValidator != 0); validatorStack_.push_back(conn->principalPortValidator); currentFOTBuilder().startNode(vm().currentNode, vm().processingMode->name()); } } void ProcessContext::endFlowObj() { flowObjLevel_--; if (flowObjLevel_ < principalPortSaveQueues_.size()) { IQueue &saveQueue = principalPortSaveQueues_[flowObjLevel_]; while (!saveQueue.empty()) { NodeSaveFOTBuilder *saved = saveQueue.get(); saved->emit(currentFOTBuilder()); delete saved; } } } ProcessContext::Connection::Connection(const StyleStack &s, Port *p, unsigned connLevel) : styleStack(s), port(p), nBadFollow(0), connectableLevel(connLevel) { } ProcessContext::Connection::Connection(FOTBuilder *f, const StyleStack &s) : fotb(f), port(0), nBadFollow(0), connectableLevel(0), styleStack(s) { } void ProcessContext::validate(const FlowObj &fo) { if (!validatorStack_.back()->isValid(fo, *this)) { // Ensure that the FOTBuilder gets the ICs correct. FOTBuilder &fotb = currentFOTBuilder(); fotb.startSequence(); fotb.endSequence(); invalidLevels_.resize(invalidLevels_.size() + 1); invalidLevels_.back() = flowObjLevel_; // FIXME: Is this the right thing to do? (i.e. how about the style stack?) pushPseudoPort(&ignoreFotb_, new Validator); } } void ProcessContext::endValidate() { ASSERT(invalidLevels_.size() == 0 || flowObjLevel_ >= invalidLevels_.back()); if (invalidLevels_.size() > 0 && invalidLevels_.back() == flowObjLevel_) { invalidLevels_.resize(invalidLevels_.size() - 1); popPseudoPort(); } } void ProcessContext::pushPorts(bool hasPrincipalPort, const Vector &labels, const Vector &fotbs, const Vector validators, Validator *principalPortValidator) { ASSERT(!hasPrincipalPort || principalPortValidator!=0); Connectable *c = new Connectable(labels.size(), currentStyleStack(), flowObjLevel_); connectableStack_.insert(c); for (size_t i = 0; i < labels.size(); i++) { c->ports[i].labels.push_back(labels[i]); c->ports[i].fotb = fotbs[i]; c->ports[i].validator = validators[i]; } connectableStackLevel_++; // FIXME deal with !hasPrincipalPort // Doing so now. if (hasPrincipalPort) { c->principalPortValidator = principalPortValidator; pushPrincipalPort(principalPortValidator); } else { Validator *v(new NoPrincipalPortValidator); c->principalPortValidator = v; pushPrincipalPort(v); } } void ProcessContext::popPorts() { popPrincipalPort(); connectableStackLevel_--; delete connectableStack_.get(); } void ProcessContext::pushPrincipalPort(Validator *validator) { validatorStack_.push_back(validator); } void ProcessContext::popPrincipalPort() { ASSERT(validatorStack_.size() > 1); validatorStack_.resize(validatorStack_.size() - 1); } void ProcessContext::pushPseudoPort(FOTBuilder* principalPort, Validator *validator) { connectionStack_.insert(new Connection(principalPort)); validatorStack_.push_back(validator); } void ProcessContext::popPseudoPort() { ASSERT(validatorStack_.size() > 1); validatorStack_.resize(validatorStack_.size() - 1); delete connectionStack_.get(); } void ProcessContext::startDiscardLabeled(SymbolObj *label) { startFlowObj(); Connectable *c = new Connectable(1, currentStyleStack(), flowObjLevel_); connectableStack_.insert(c); c->ports[0].labels.push_back(label); c->ports[0].fotb = &ignoreFotb_; c->ports[0].validator = new Validator; } void ProcessContext::endDiscardLabeled() { delete connectableStack_.get(); endFlowObj(); } void ProcessContext::startMapContent(ELObj *contentMap, const Location &loc) { bool badFlag = 0; if (!connectableStack_.head() || connectableStack_.head()->flowObjLevel != flowObjLevel_) { connectableStack_.insert(new Connectable(0, currentStyleStack(), flowObjLevel_)); connectableStack_.head()->principalPortValidator = validatorStack_.back(); } Connectable &conn = *connectableStack_.head(); Vector portNames(conn.ports.size()); for (size_t i = 0; i < conn.ports.size(); i++) { portNames[i] = conn.ports[i].labels[0]; conn.ports[i].labels.clear(); } for (;;) { if (contentMap->isNil()) break; PairObj *tem = contentMap->asPair(); if (!tem) { badContentMap(badFlag, loc); break; } ELObj *entry = tem->car(); contentMap = tem->cdr(); tem = entry->asPair(); if (tem) { SymbolObj *label = tem->car()->asSymbol(); if (label) { // FIXME check if label already specified tem = tem->cdr()->asPair(); if (tem) { SymbolObj *port = tem->car()->asSymbol(); if (port) { for (size_t i = 0; i < portNames.size(); i++) if (portNames[i] == port) { conn.ports[i].labels.push_back(label); port = 0; break; } if (port) { vm().interp->setNextLocation(loc); vm().interp->message(InterpreterMessages::contentMapBadPort, StringMessageArg(*port->name())); } } else if (tem->car() == vm().interp->makeFalse()) conn.principalPortLabels.push_back(label); else badContentMap(badFlag, loc); if (!tem->cdr()->isNil()) badContentMap(badFlag, loc); } else badContentMap(badFlag, loc); } else badContentMap(badFlag, loc); } else badContentMap(badFlag, loc); } } void ProcessContext::endMapContent() { if (connectableStack_.head()->ports.size() == 0) delete connectableStack_.get(); } void ProcessContext::badContentMap(bool &badFlag, const Location &loc) { if (badFlag) return; badFlag = 1; vm().interp->setNextLocation(loc); vm().interp->message(InterpreterMessages::badContentMap); } ProcessContext::Connectable::Connectable(int nPorts, const StyleStack &ss, unsigned fol) : ports(nPorts), styleStack(ss), flowObjLevel(fol) { } ProcessContext::Port::Port() : connected(0), fotb(0) { } void ProcessContext::trace(Collector &c) const { for (IListIter iter(connectionStack_); !iter.done(); iter.next()) iter.cur()->styleStack.trace(c); for (IListIter iter(connectableStack_); !iter.done(); iter.next()) iter.cur()->styleStack.trace(c); for (IListIter iter(tableStack_); !iter.done(); iter.next()) { c.trace(iter.cur()->rowStyle); Vector > &styles = iter.cur()->columnStyles; for (size_t i = 0; i < styles.size(); i++) for (size_t j = 0; j < styles[i].size(); j++) c.trace(styles[i][j]); } } bool ProcessContext::Validator::isValid(const FlowObj &fo, ProcessContext &) { return true; } bool ProcessContext::Validator::charsValid(size_t n, const Location &loc, ProcessContext &) { return true; } bool RootValidator::isValid(const FlowObj &fo, ProcessContext &context) { FlowObj::AcceptFlags af(fo.acceptFlags(context)); if (af & FlowObj::afAlways) return true; switch (s_) { case sNone: if (af & FlowObj::afScroll) s_ = sScroll; else if (af & FlowObj::afPaging) s_ = sPaging; else break; return true; case sScroll: if (af & FlowObj::afScroll) { s_ = sScroll; return true; } break; case sPaging: if (af & FlowObj::afPaging) { s_ = sPaging; return true; } break; default: CANNOT_HAPPEN(); } Interpreter &interp = *context.vm().interp; interp.setNextLocation(fo.location()); interp.message(InterpreterMessages::badTopLevelFlowObj); return false; } bool RootValidator::charsValid(size_t, const Location &loc, ProcessContext &context) { Interpreter &interp = *context.vm().interp; interp.setNextLocation(loc); interp.message(InterpreterMessages::badTopLevelFlowObj); return false; } SosofoObj *SosofoObj::asSosofo() { return this; } bool SosofoObj::tableBorderStyle(StyleObj *&) { return 0; } bool SosofoObj::isRule() { return 0; } bool SosofoObj::ruleStyle(ProcessContext &, StyleObj *&) { return 0; } bool SosofoObj::isCharacter() { return 0; } bool SosofoObj::characterStyle(ProcessContext &, StyleObj *&, FOTBuilder::CharacterNIC &) { return 0; } void AppendSosofoObj::process(ProcessContext &context) { for (size_t i = 0; i < v_.size(); i++) v_[i]->process(context); } void AppendSosofoObj::traceSubObjects(Collector &c) const { for (size_t i = 0; i < v_.size(); i++) c.trace(v_[i]); } void LiteralSosofoObj::process(ProcessContext &context) { const Char *s; size_t n; if (str_->stringData(s, n)) context.characters(s, n, loc_); } void LiteralSosofoObj::traceSubObjects(Collector &c) const { c.trace(str_); } void ProcessChildrenSosofoObj::process(ProcessContext &context) { NodePtr node(context.vm().currentNode); context.processChildren(mode_, loc_); context.vm().currentNode = node; } void ProcessChildrenTrimSosofoObj::process(ProcessContext &context) { NodePtr node(context.vm().currentNode); context.processChildrenTrim(mode_, loc_); context.vm().currentNode = node; } NextMatchSosofoObj::NextMatchSosofoObj(StyleObj *style, const Location &loc) : style_(style), loc_(loc) { } void NextMatchSosofoObj::process(ProcessContext &context) { context.nextMatch(style_, loc_); } void EmptySosofoObj::process(ProcessContext &) { // nothing needed } ProcessNodeListSosofoObj::ProcessNodeListSosofoObj(NodeListObj *nodeList, const ProcessingMode *mode, const Location &loc) : nodeList_(nodeList), mode_(mode), loc_(loc) { hasSubObjects_ = 1; } void ProcessNodeListSosofoObj::process(ProcessContext &context) { NodeListObj *nl = nodeList_; Interpreter &interp = *context.vm().interp; ELObjDynamicRoot protect(interp, nl); for (;;) { NodePtr node = nl->nodeListFirst(context.vm(), interp); if (!node) break; bool chunk; nl = nl->nodeListChunkRest(context.vm(), interp, chunk); protect = nl; context.processNodeSafe(node, mode_, loc_, chunk); } } void ProcessNodeListSosofoObj::traceSubObjects(Collector &c) const { c.trace(nodeList_); } ProcessNodeSosofoObj::ProcessNodeSosofoObj(const NodePtr &node, const ProcessingMode *mode, const Location &loc) : node_(node), mode_(mode), loc_(loc) { } void ProcessNodeSosofoObj::process(ProcessContext &context) { context.processNode(node_, mode_, loc_); } void CurrentNodePageNumberSosofoObj::process(ProcessContext &context) { // FIXME. Validate. context.currentFOTBuilder().currentNodePageNumber(node_); } void PageNumberSosofoObj::process(ProcessContext &context) { // FIXME. Validate. context.currentFOTBuilder().pageNumber(); } SetNonInheritedCsSosofoObj ::SetNonInheritedCsSosofoObj(FlowObj *flowObj, const InsnPtr &code, ELObj **display, const NodePtr &node) : flowObj_(flowObj), code_(code), display_(display), node_(node) { hasSubObjects_ = 1; } SetNonInheritedCsSosofoObj::~SetNonInheritedCsSosofoObj() { delete [] display_; } ELObj *SetNonInheritedCsSosofoObj::resolve(ProcessContext &context) { VM &vm = context.vm(); EvalContext::CurrentNodeSetter cns(node_, 0, vm); StyleStack *saveStyleStack = vm.styleStack; vm.styleStack = &context.currentStyleStack(); unsigned saveSpecLevel = vm.specLevel; vm.specLevel = vm.styleStack->level(); Vector dep; vm.actualDependencies = &dep; ELObj *obj = vm.eval(code_.pointer(), display_, flowObj_->copy(*vm.interp)); vm.styleStack = saveStyleStack; vm.specLevel = saveSpecLevel; if (vm.interp->isError(obj)) return 0; return obj; } void SetNonInheritedCsSosofoObj::process(ProcessContext &context) { context.startFlowObj(); unsigned flags = 0; flowObj_->pushStyle(context, flags); ELObj *obj = resolve(context); if (obj) { ELObjDynamicRoot protect(*context.vm().interp, obj); context.validate(*(FlowObj *)obj); ((FlowObj *)obj)->processInner(context); context.endValidate(); } else { // Ensure that the FOTBuilder gets the inherited charics right by inserting // a harmless sequence FO. FOTBuilder &fotb = context.currentFOTBuilder(); fotb.startSequence(); fotb.endSequence(); } flowObj_->popStyle(context, flags); context.endFlowObj(); } bool SetNonInheritedCsSosofoObj::isCharacter() { return flowObj_->isCharacter(); } bool SetNonInheritedCsSosofoObj::isRule() { return flowObj_->isRule(); } bool SetNonInheritedCsSosofoObj::characterStyle(ProcessContext &context, StyleObj *&style, FOTBuilder::CharacterNIC &nic) { ELObj *obj = resolve(context); if (obj) { ELObjDynamicRoot protect(*context.vm().interp, obj); return ((SosofoObj *)obj)->characterStyle(context, style, nic); } return 0; } bool SetNonInheritedCsSosofoObj::ruleStyle(ProcessContext &context, StyleObj *&style) { ELObj *obj = resolve(context); if (obj) { ELObjDynamicRoot protect(*context.vm().interp, obj); return ((SosofoObj *)obj)->ruleStyle(context, style); } return 0; } void SetNonInheritedCsSosofoObj::traceSubObjects(Collector &c) const { c.trace(flowObj_); if (display_) for (ELObj **p = display_; *p; p++) c.trace(*p); } LabelSosofoObj::LabelSosofoObj(SymbolObj *label, const Location &loc, SosofoObj *content) : label_(label), locp_(new Location(loc)), content_(content) { hasSubObjects_ = 1; } void LabelSosofoObj::process(ProcessContext &context) { context.startConnection(label_, *locp_); content_->process(context); context.endConnection(); } void LabelSosofoObj::traceSubObjects(Collector &c) const { // Symbols are permanent and don't need tracing. c.trace(content_); } ContentMapSosofoObj::ContentMapSosofoObj(ELObj *contentMap, const Location *locp, SosofoObj *content) : contentMap_(contentMap), locp_(locp), content_(content) { hasSubObjects_ = 1; } void ContentMapSosofoObj::process(ProcessContext &context) { context.startMapContent(contentMap_, *locp_); content_->process(context); context.endMapContent(); } void ContentMapSosofoObj::traceSubObjects(Collector &c) const { c.trace(contentMap_); c.trace(content_); } DiscardLabeledSosofoObj::DiscardLabeledSosofoObj(SymbolObj *label, SosofoObj *content) : label_(label), content_(content) { hasSubObjects_ = 1; } void DiscardLabeledSosofoObj::process(ProcessContext &context) { context.startDiscardLabeled(label_); content_->process(context); context.endDiscardLabeled(); } void DiscardLabeledSosofoObj::traceSubObjects(Collector &c) const { c.trace(content_); } PageTypeSosofoObj::PageTypeSosofoObj(unsigned pageTypeFlag, SosofoObj *match, SosofoObj *noMatch) : pageTypeFlag_(pageTypeFlag), match_(match), noMatch_(noMatch) { hasSubObjects_ = 1; } void PageTypeSosofoObj::process(ProcessContext &context) { unsigned pageType; if (context.getPageType(pageType)) { if (pageType & pageTypeFlag_) match_->process(context); else noMatch_->process(context); } } void PageTypeSosofoObj::traceSubObjects(Collector &c) const { c.trace(match_); c.trace(noMatch_); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/ProcessContext.h0000644000021000000240000001547407025631171014034 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef ProcessContext_INCLUDED #define ProcessContext_INCLUDED 1 #include #include #include #include #include #include "Collector.h" #include "Style.h" #include "FOTBuilder.h" #include "ELObj.h" #include "SosofoObj.h" #include "VM.h" #include "ProcessingMode.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Expression; class ProcessContext : public Collector::DynamicRoot { public: ProcessContext(Interpreter &, FOTBuilder &); ~ProcessContext(); FOTBuilder ¤tFOTBuilder(); StyleStack ¤tStyleStack(); void process(const NodePtr &); void processNode(const NodePtr &, const ProcessingMode *, const Location &, bool chunk = 1); void processNodeSafe(const NodePtr &, const ProcessingMode *, const Location &, bool chunk = 1); void nextMatch(StyleObj *, const Location &loc); void processChildren(const ProcessingMode *, const Location &); void processChildrenTrim(const ProcessingMode *, const Location &); void characters(const Char *, size_t, const Location &); void charactersFromNode(const NodePtr &, const Char *, size_t, const Location &); void trace(Collector &) const; void startFlowObj(); void endFlowObj(); // Uses of label: do this void startConnection(SymbolObj *, const Location &); void endConnection(); // Contains information about which flow object classes a port shall accept // and can validate flow objects according to this information. class Validator : public Resource { public: // If the flow object specified by the argument is valid in the current // position in this stream, this function returns true and updates // state information as if the flow object was added to the stream. // If the FO isn't valid, this method reports it with a message. // Default implementation returns true. virtual bool isValid(const FlowObj &, ProcessContext &); virtual bool charsValid(size_t, const Location &, ProcessContext &); }; void validate(const FlowObj &); void endValidate(); // happens only for object with a non-principal port void pushPorts(bool hasPrincipalPort, const Vector &ports, const Vector &fotbs, const Vector validators, Validator *principalPortValidator = 0); void popPorts(); void pushPrincipalPort(Validator *); void popPrincipalPort(); // Used by SpS headers and footers. void pushPseudoPort(FOTBuilder *principalPort, Validator *); void popPseudoPort(); // happens inside pushPorts() (if any) void startMapContent(ELObj *, const Location &); void endMapContent(); void startDiscardLabeled(SymbolObj *); void endDiscardLabeled(); // table support void startTable(); void endTable(); void startTablePart(); void endTablePart(); void addTableColumn(unsigned columnIndex, unsigned span, StyleObj *); unsigned currentTableColumn(); void noteTableCell(unsigned colIndex, unsigned colSpan, unsigned rowSpan); StyleObj *tableColumnStyle(unsigned columnIndex, unsigned span); StyleObj *tableRowStyle(); void startTableRow(StyleObj *); bool inTable() const; bool inTableRow(); void endTableRow(); void clearPageType(); void setPageType(unsigned); bool getPageType(unsigned &) const; void startParagraph(); void endParagraph(); bool paragraphAncestor() const; VM &vm(); private: ProcessContext(const ProcessContext &); // undefined void operator=(const ProcessContext &); // undefined void badContentMap(bool &, const Location &); void coverSpannedRows(); void restoreConnection(unsigned connectableLevel, size_t portIndex); struct Port { Port(); FOTBuilder *fotb; IQueue saveQueue; Vector labels; Ptr validator; unsigned connected; }; // A flow object with a port that can be connected to. struct Connectable; friend struct Connectable; struct Connectable : public Link { Connectable(int nPorts, const StyleStack &, unsigned); NCVector ports; StyleStack styleStack; unsigned flowObjLevel; Vector principalPortLabels; Ptr principalPortValidator; }; // A connection between a flow object and its flow parent // made with label:. struct Connection; friend struct Connection; struct Connection : public Link { Connection(FOTBuilder *, const StyleStack & = StyleStack()); Connection(const StyleStack &, Port *, unsigned connectableLevel); FOTBuilder *fotb; StyleStack styleStack; Port *port; unsigned connectableLevel; unsigned nBadFollow; }; struct Table : public Link { Table(); unsigned currentColumn; // first index is column (zero-based) // second is span - 1. Vector > columnStyles; // for each column, how many rows are covered // starting with the current row Vector covered; unsigned nColumns; StyleObj *rowStyle; bool inTableRow; unsigned rowConnectableLevel; }; struct NodeStackEntry { unsigned long elementIndex; unsigned groveIndex; const ProcessingMode *processingMode; }; FOTBuilder ignoreFotb_; IList connectionStack_; IList connectableStack_; unsigned connectableStackLevel_; IList
tableStack_; NCVector > principalPortSaveQueues_; VM vm_; ProcessingMode::Specificity matchSpecificity_; unsigned flowObjLevel_; bool havePageType_; unsigned pageType_; unsigned paragraphLevel_; Vector nodeStack_; Vector invalidLevels_; Vector > validatorStack_; friend class CurrentNodeSetter; friend struct Table; }; inline FOTBuilder &ProcessContext::currentFOTBuilder() { return *connectionStack_.head()->fotb; } inline StyleStack &ProcessContext::currentStyleStack() { return connectionStack_.head()->styleStack; } inline VM &ProcessContext::vm() { return vm_; } inline void ProcessContext::startFlowObj() { flowObjLevel_++; } inline void ProcessContext::setPageType(unsigned n) { havePageType_ = 1; pageType_ = n; } inline void ProcessContext::clearPageType() { havePageType_ = 0; } inline bool ProcessContext::getPageType(unsigned &n) const { if (!havePageType_) return 0; n = pageType_; return 1; } inline bool ProcessContext::inTable() const { return !tableStack_.empty(); } inline void ProcessContext::startParagraph() { paragraphLevel_++; } inline void ProcessContext::endParagraph() { paragraphLevel_--; } inline bool ProcessContext::paragraphAncestor() const { return paragraphLevel_ > 0; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not ProcessContext_INCLUDED */ OpenJade-1.4devel/style/ProcessingMode.cxx0000644000021000000240000004401107067706577014355 // Copyright (c) 1996, 1997 James Clark, 2000 Matthias Clasen // See the file copying.txt for copying permission. #include "stylelib.h" #include "ProcessingMode.h" #include "Interpreter.h" #include #include "InterpreterMessages.h" #include "Expression.h" #include "Insn.h" #include "Insn2.h" #include "VM.h" #include #include "LocNode.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif extern "C" { static int ruleCompare(const void *p1, const void *p2) { const ProcessingMode::Rule *const *r1 = (const ProcessingMode::Rule *const *)p1; const ProcessingMode::Rule *const *r2 = (const ProcessingMode::Rule *const *)p2; return ((*r1)->compareSpecificity(**r2)); } } static void sortRules(ProcessingMode::Rule **v, size_t size) { #if 1 //FIXME I had problems getting the right versions of compareSpecificity // called in ruleCompare, but now it seems to work. qsort(&(v[0]), size, sizeof(ProcessingMode::Rule *), ruleCompare); #else // FIXME implement a better sorting algorithm for (size_t i = 0; i + 1 < size;) { if (v[i]->compareSpecificity(*(v[i + 1])) > 0) { ProcessingMode::Rule *tem = v[i]; v[i] = v[i + 1]; v[i + 1] = tem; i = 0; } else i++; } #endif } ProcessingMode::ProcessingMode(const StringC &name, const ProcessingMode *initial) : Named(name), initial_(initial), defined_(0), hasCharRules_(0) { } void ProcessingMode::GroveRules::build(const IList *lists, const Vector *qvecs, const NodePtr &node, Messenger &) { built = 1; for (int ruleType = 0; ruleType < nRuleType; ruleType++) { for (IListIter iter(lists[ruleType]); !iter.done(); iter.next()) { StringC gi; if (iter.cur()->mustHaveGi(gi)) { Interpreter::normalizeGeneralName(node, gi); ElementRules *p = elementTable.lookup(gi); if (!p) { p = new ElementRules(gi); elementTable.insert(p); } p->rules[ruleType].push_back(iter.cur()); } else otherRules[ruleType].push_back(iter.cur()); } } for (int ruleType = 0; ruleType < nRuleType; ruleType++) for (size_t j = 0; j < qvecs[ruleType].size(); j++) if (qvecs[ruleType][j]->matches(ComponentName::idElement)) otherRules[ruleType].push_back(qvecs[ruleType][j]); for (int ruleType = 0; ruleType < nRuleType; ruleType++) { NamedTableIter iter(elementTable); for (;;) { ElementRules *p = iter.next(); if (!p) break; size_t j = p->rules[ruleType].size(); p->rules[ruleType].resize(p->rules[ruleType].size() + otherRules[ruleType].size()); for (size_t i = 0; i < otherRules[ruleType].size(); i++) p->rules[ruleType][j++] = otherRules[ruleType][i]; sortRules((Rule **)p->rules[ruleType].begin(), p->rules[ruleType].size()); } sortRules((Rule **)otherRules[ruleType].begin(), otherRules[ruleType].size()); } } void ProcessingMode::compile(Interpreter &interp, const NodePtr &root) { for (int ruleType = 0; ruleType < nRuleType; ruleType++) { for (size_t j = 0; j < rootRules_[ruleType].size(); j++) rootRules_[ruleType][j]->action().compile(interp, RuleType(ruleType)); for (size_t j = 0; j < queryRules_[ruleType].size(); j++) { queryRules_[ruleType][j]->action().compile(interp, RuleType(ruleType)); queryRules_[ruleType][j]->compile(root); } sortRules((Rule **)queryRules_[ruleType].begin(), queryRules_[ruleType].size()); for (size_t j = 0; j < queryRules_[ruleType].size(); j++) if (queryRules_[ruleType][j]->matches(ComponentName::idSgmlDocument)) rootRules_[ruleType].push_back(queryRules_[ruleType][j]); sortRules((Rule **)rootRules_[ruleType].begin(), rootRules_[ruleType].size()); for (size_t j = 0; !hasCharRules_ && j < queryRules_[ruleType].size(); j++) if (queryRules_[ruleType][j]->matches(ComponentName::idDataChar)) hasCharRules_ = 1; for (IListIter iter(elementRules_[ruleType]); !iter.done(); iter.next()) iter.cur()->action().compile(interp, RuleType(ruleType)); } } ProcessingMode::Action::Action(unsigned partIndex, Owner &expr, const Location &loc) : partIndex_(partIndex), defLoc_(loc), sosofo_(0) { expr.swap(expr_); } ProcessingMode::Rule::Rule() { } ProcessingMode::Rule::Rule(const Ptr &action) : action_(action) { } int ProcessingMode::Rule::compareSpecificity2(const RootRule *rule) const { return - compareParts(rule); } int ProcessingMode::Rule::compareSpecificity2(const ElementRule *rule) const { return - compareParts(rule); } int ProcessingMode::Rule::compareSpecificity2(const QueryRule *rule) const { return - compareParts(rule); } int ProcessingMode::Rule::compareParts(const Rule *r) const { unsigned i1 = action().partIndex(); unsigned i2 = r->action().partIndex(); if (i1 == i2) return 0; return i1 < i2 ? -1 : 1; } void ProcessingMode::Action::compile(Interpreter &interp, RuleType ruleType) { expr_->optimize(interp, Environment(), expr_); ELObj *tem = expr_->constantValue(); if (tem) { if (ruleType == constructionRule) { sosofo_ = tem->asSosofo(); if (sosofo_) return; } } InsnPtr check; if (ruleType == constructionRule) check = new CheckSosofoInsn(defLoc_, check); insn_ = expr_->compile(interp, Environment(), 0, check); } ProcessingMode::ElementRule::ElementRule(const Ptr &action, Pattern &pattern) : Rule(action) { pattern.swap(*this); } int ProcessingMode::ElementRule::compareSpecificity(const Rule &rule) const { return rule.compareSpecificity2(this); } int ProcessingMode::ElementRule::compareSpecificity2(const ElementRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return Pattern::compareSpecificity(*rule, *this); } int ProcessingMode::ElementRule::compareSpecificity2(const QueryRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return -1; } ProcessingMode::QueryRule::QueryRule(const Ptr &action, Owner &query, Owner &priority, ProcessingMode *pm, Interpreter *interp) : Rule(action), nl_(0), priority_(0), pm_(pm), interp_(interp), Collector::DynamicRoot(*interp) { nlExpr_.swap(query); priorityExpr_.swap(priority); } void ProcessingMode::QueryRule::compile(const NodePtr &root) { if (priorityExpr_) { InsnPtr insn = priorityExpr_->compile(*interp_, Environment(), 0, InsnPtr()); EvalContext ec; VM vm(ec, *interp_); ELObj *val = vm.eval(insn.pointer()); double tem; if (!val || !val->realValue(tem)) { interp_->setNextLocation(location()); interp_->message(InterpreterMessages::priorityNotNumber); return; } if (!val->exactIntegerValue(priority_)) { interp_->setNextLocation(location()); interp_->message(InterpreterMessages::sorryPriority); return; } } { EvalContext ec; EvalContext::CurrentNodeSetter cns(root, pm_, ec); InsnPtr insn = nlExpr_->compile(*interp_, Environment(), 0, InsnPtr()); VM vm(ec, *interp_); ELObj *val = vm.eval(insn.pointer()); if (!val || !val->asNodeList()) { interp_->setNextLocation(location()); interp_->message(InterpreterMessages::queryNotNodelist); return; } nl_ = val->asNodeList(); interp_->makeReadOnly(nl_); } } bool ProcessingMode::QueryRule::matches(const NodePtr &nd, Pattern::MatchContext &) const { EvalContext ec; NodePtr tem = nl_->nodeListFirst(ec, *interp_); if (!tem) return 0; tem->getGroveRoot(tem); EvalContext::CurrentNodeSetter cns(tem, pm_, ec); return nl_->contains(ec, *interp_, nd); } bool ProcessingMode::QueryRule::matches(ComponentName::Id cls) const { EvalContext ec; NodePtr tem = nl_->nodeListFirst(ec, *interp_); if (!tem) return 0; tem->getGroveRoot(tem); EvalContext::CurrentNodeSetter cns(tem, pm_, ec); bool ret = nl_->contains(ec, *interp_, cls); return ret; } int ProcessingMode::QueryRule::compareSpecificity(const Rule &rule) const { return rule.compareSpecificity2(this); } int ProcessingMode::QueryRule::compareSpecificity2(const QueryRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; if (priority_ == rule->priority_) return 0; return priority_ < rule->priority_ ? -1 : 1; } int ProcessingMode::QueryRule::compareSpecificity2(const ElementRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return 1; } int ProcessingMode::QueryRule::compareSpecificity2(const RootRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return 1; } void ProcessingMode::QueryRule::trace(Collector &c) const { if (nl_) c.trace(nl_); } ProcessingMode::RootRule::RootRule() { } ProcessingMode::RootRule::RootRule(const Ptr &action) : MatchBase(1), Rule(action) { } int ProcessingMode::RootRule::compareSpecificity(const Rule &rule) const { rule.compareSpecificity2(this); } int ProcessingMode::RootRule::compareSpecificity2(const QueryRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return -1; } int ProcessingMode::RootRule::compareSpecificity2(const RootRule *rule) const { int result = Rule::compareSpecificity2(rule); if (result) return result; return 0; } bool ProcessingMode::RootRule::matches(const NodePtr &nd, Pattern::MatchContext &) const { // Doesn't matter since root rules are trivial return 1; } void ProcessingMode::addElementRule(NCVector &patterns, Owner &expr, RuleType ruleType, const Location &loc, Interpreter &interp) { Ptr action = new Action(interp.currentPartIndex(), expr, loc); for (size_t i = 0; i < patterns.size(); i++) elementRules_[ruleType].insert(new ElementRule(action, patterns[i])); } void ProcessingMode::addRootRule(Owner &expr, RuleType ruleType, const Location &loc, Interpreter &interp) { Ptr action = new Action(interp.currentPartIndex(), expr, loc); Vector &rules = rootRules_[ruleType]; rules.push_back(new RootRule(action)); for (size_t i = rules.size() - 1; i > 0; i--) { int cmp = rules[i - 1]->compareSpecificity(*(rules[i])); if (cmp <= 0) { if (cmp == 0 && ruleType == constructionRule) { interp.setNextLocation(loc); interp.message(InterpreterMessages::duplicateRootRule, rules[i - 1]->location()); } break; } Rule *tem = rules[i-1]; rules[i-1] = rules[i]; rules[i] = tem; } } void ProcessingMode::addQueryRule(Owner &query, Owner &expr, Owner &priority, RuleType ruleType, const Location &loc, Interpreter &interp) { Ptr action = new Action(interp.currentPartIndex(), expr, loc); queryRules_[ruleType].push_back( new QueryRule(action, query, priority, (ProcessingMode *)this, &interp)); } ProcessingMode::GroveRules::GroveRules() : built(0) { } ProcessingMode::ElementRules::ElementRules(const StringC &name) : Named(name) { } // Specificity gives specificity of last match; get specificity of current match. const ProcessingMode::Rule * ProcessingMode::findMatch(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity) const { GroveString gi; if (node->getGi(gi) == accessOK) return findElementMatch(StringC(gi.data(), gi.size()), node, context, mgr, specificity); NodePtr tem; if (node->getOrigin(tem) != accessOK) return findRootMatch(node, context, mgr, specificity); return findQueryMatch(node, context, mgr, specificity); } const ProcessingMode::Rule * ProcessingMode::findElementMatch(const StringC &gi, const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity) const { const Vector *vecP = 0; for (;;) { for (;;) { const ProcessingMode &mode = *(initial_ && specificity.toInitial_ ? initial_ : this); if (!vecP) { const GroveRules &gr = mode.groveRules(node, mgr); const ElementRules *er = gr.elementTable.lookup(gi); vecP = er ? er->rules : gr.otherRules; } const Vector &vec = vecP[specificity.ruleType_]; ASSERT(specificity.nextRuleIndex_ <= vec.size()); for (size_t &i = specificity.nextRuleIndex_; i < vec.size(); i++) { if (vec[i]->trivial() || vec[i]->matches(node, context)) { const Rule *rule = vec[i]; ruleAdvance(node, context, mgr, specificity, vec); return rule; } } if (!initial_) break; vecP = 0; if (specificity.toInitial_) break; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 1; } if (specificity.ruleType_ == constructionRule) break; specificity.ruleType_ = constructionRule; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 0; } return 0; } const ProcessingMode::Rule * ProcessingMode::findRootMatch(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity) const { for (;;) { for (;;) { const ProcessingMode &mode = *(initial_ && specificity.toInitial_ ? initial_ : this); const Vector &vec = mode.rootRules_[specificity.ruleType_]; ASSERT(specificity.nextRuleIndex_ <= vec.size()); for (size_t &i = specificity.nextRuleIndex_; i < vec.size(); i++) { if (vec[i]->trivial() || vec[i]->matches(node, context)) { const Rule *rule = vec[i]; ruleAdvance(node, context, mgr, specificity, vec); return rule; } } if (!initial_ || specificity.toInitial_) break; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 1; } if (specificity.ruleType_ == constructionRule) break; specificity.ruleType_ = constructionRule; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 0; } return 0; } const ProcessingMode::Rule * ProcessingMode::findQueryMatch(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity) const { for (;;) { for (;;) { const ProcessingMode &mode = *(initial_ && specificity.toInitial_ ? initial_ : this); const Vector &vec = mode.queryRules_[specificity.ruleType_]; ASSERT(specificity.nextRuleIndex_ <= vec.size()); for (size_t &i = specificity.nextRuleIndex_; i < vec.size(); i++) { if (vec[i]->matches(node, context)) { const Rule *rule = vec[i]; ruleAdvance(node, context, mgr, specificity, vec); return rule; } } if (!initial_ || specificity.toInitial_) break; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 1; } if (specificity.ruleType_ == constructionRule) break; specificity.ruleType_ = constructionRule; specificity.nextRuleIndex_ = 0; specificity.toInitial_ = 0; } return 0; } const ProcessingMode::GroveRules &ProcessingMode::groveRules(const NodePtr &node, Messenger &mgr) const { unsigned long n = node->groveIndex(); ProcessingMode *cache = (ProcessingMode *)this; if (n >= groveRules_.size()) cache->groveRules_.resize(n + 1); if (!groveRules_[n].built) cache->groveRules_[n].build(elementRules_, queryRules_, node, mgr); return groveRules_[n]; } void ProcessingMode::ruleAdvance(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const { size_t &i = specificity.nextRuleIndex_; if (specificity.ruleType_ != constructionRule) { ++i; return; } size_t hit = i; do { ++i; if (i >= vec.size() || vec[hit]->compareSpecificity(*vec[i]) != 0) return; } while (!(vec[i]->trivial() || vec[i]->matches(node, context))); const LocNode *lnp; Location nodeLoc; if ((lnp = LocNode::convert(node)) != 0 && lnp->getLocation(nodeLoc) == accessOK) mgr.setNextLocation(nodeLoc); mgr.message(InterpreterMessages::ambiguousMatch); do { ++i; } while (i < vec.size() && vec[hit]->compareSpecificity(*vec[i]) == 0); } void ProcessingMode::ruleAdvance(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const { size_t &i = specificity.nextRuleIndex_; if (specificity.ruleType_ != constructionRule) { ++i; return; } size_t hit = i; do { ++i; if (i >= vec.size() || vec[hit]->compareSpecificity(*vec[i]) != 0) return; } while (!(vec[i]->trivial() || vec[i]->matches(node, context))); const LocNode *lnp; Location nodeLoc; if ((lnp = LocNode::convert(node)) != 0 && lnp->getLocation(nodeLoc) == accessOK) mgr.setNextLocation(nodeLoc); mgr.message(InterpreterMessages::ambiguousMatch); do { ++i; } while (i < vec.size() && vec[hit]->compareSpecificity(*vec[i]) == 0); } void ProcessingMode::ruleAdvance(const NodePtr &node, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const { size_t &i = specificity.nextRuleIndex_; if (specificity.ruleType_ != constructionRule) { ++i; return; } size_t hit = i; do { ++i; if (i >= vec.size() || vec[hit]->compareSpecificity(*vec[i]) != 0) return; } while (!(vec[i]->trivial() || vec[i]->matches(node, context))); const LocNode *lnp; Location nodeLoc; if ((lnp = LocNode::convert(node)) != 0 && lnp->getLocation(nodeLoc) == accessOK) mgr.setNextLocation(nodeLoc); mgr.message(InterpreterMessages::ambiguousMatch); do { ++i; } while (i < vec.size() && vec[hit]->compareSpecificity(*vec[i]) == 0); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/ProcessingMode.h0000644000021000000240000001602607067706577014007 // Copyright (c) 1996 James Clark, 2000 Matthias Clasen // See the file copying.txt for copying permission. #ifndef ProcessingMode_INCLUDED #define ProcessingMode_INCLUDED 1 #include #include #include #include #include #include #include #include "Expression.h" #include "Insn.h" #include #include "Node.h" #include "FOTBuilder.h" #include #include "Pattern.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Interpreter; class SosofoObj; class ProcessingMode : public Named { public: enum RuleType { styleRule, constructionRule }; enum { nRuleType = 2 }; class Specificity { public: Specificity(); bool isStyle() const; private: bool toInitial_; // 1 if the match fell through from a named processing mode to // the initial processing mode RuleType ruleType_; size_t nextRuleIndex_; friend class ProcessingMode; }; class Action : public Resource { public: Action(unsigned partIndex, Owner &, const Location &); void compile(Interpreter &, RuleType); void get(InsnPtr &, SosofoObj *&) const; const Location &location() const; unsigned partIndex() const; private: Location defLoc_; Owner expr_; // One of these will be non-null. InsnPtr insn_; // must be permanent SosofoObj *sosofo_; unsigned partIndex_; }; class ElementRule; class RootRule; class QueryRule; class Rule : virtual public MatchBase { public: Rule(); Rule(const Ptr &); const Action &action() const; Action &action(); virtual int compareSpecificity(const Rule &) const = 0; virtual int compareSpecificity2(const ElementRule *) const; virtual int compareSpecificity2(const RootRule *) const; virtual int compareSpecificity2(const QueryRule *) const; const Location &location() const; void swap(Rule &); private: Ptr action_; int compareParts(const Rule *) const; }; class ElementRule : public Rule, public Pattern, public Link { public: ElementRule(const Ptr &, Pattern &); int compareSpecificity(const Rule &) const; int compareSpecificity2(const ElementRule *) const; int compareSpecificity2(const QueryRule *) const; }; class QueryRule : public Rule, private Collector::DynamicRoot { public: QueryRule(const Ptr &, Owner &, Owner &, ProcessingMode *, Interpreter *); int compareSpecificity(const Rule &) const; int compareSpecificity2(const ElementRule *) const; int compareSpecificity2(const RootRule *) const; int compareSpecificity2(const QueryRule *) const; void trace(Collector &) const; bool matches(const NodePtr &, Pattern::MatchContext &) const; bool matches(ComponentName::Id) const; void compile(const NodePtr &); private: ProcessingMode *pm_; Interpreter *interp_; Owner nlExpr_; mutable Owner priorityExpr_; mutable NodeListObj *nl_; mutable long priority_; }; class RootRule : public Rule { public: RootRule(); RootRule(const Ptr &); int compareSpecificity(const Rule &) const; int compareSpecificity2(const RootRule *) const; int compareSpecificity2(const QueryRule *) const; bool matches(const NodePtr &, Pattern::MatchContext &) const; }; ProcessingMode(const StringC &, const ProcessingMode *initial = 0); void addElementRule(NCVector &, Owner &expr, RuleType, const Location &, Interpreter &); void addRootRule(Owner &expr, RuleType, const Location &, Interpreter &); void addQueryRule(Owner &query, Owner &expr, Owner &priority, RuleType, const Location &, Interpreter &); // Specificity gives specificity of last match; gets specificity of current match. const Rule *findMatch(const NodePtr &, Pattern::MatchContext &, Messenger &, Specificity &) const; void compile(Interpreter &, const NodePtr &); bool defined() const; void setDefined(); bool hasCharRules() const; struct ElementRules : public Named { public: ElementRules(const StringC &); Vector rules[nRuleType]; }; struct GroveRules { GroveRules(); bool built; NamedTable elementTable; Vector otherRules[nRuleType]; void build(const IList *, const Vector *, const NodePtr &, Messenger &); }; private: const Rule *findElementMatch(const StringC &, const NodePtr &, Pattern::MatchContext &, Messenger &, Specificity &) const; const Rule *findRootMatch(const NodePtr &, Pattern::MatchContext &, Messenger &, Specificity &) const; const Rule *findQueryMatch(const NodePtr &, Pattern::MatchContext &, Messenger &, Specificity &) const; const GroveRules &groveRules(const NodePtr &, Messenger &) const; void ruleAdvance(const NodePtr &nd, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const; void ruleAdvance(const NodePtr &nd, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const; void ruleAdvance(const NodePtr &nd, Pattern::MatchContext &context, Messenger &mgr, Specificity &specificity, const Vector &vec) const; Vector rootRules_[nRuleType]; Vector queryRules_[nRuleType]; IList elementRules_[nRuleType]; NCVector groveRules_; const ProcessingMode *initial_; // 0 for initial mode bool defined_; bool hasCharRules_; }; inline bool ProcessingMode::defined() const { return defined_; } inline void ProcessingMode::setDefined() { defined_ = 1; } inline bool ProcessingMode::hasCharRules() const { if (hasCharRules_) return 1; if (initial_) return initial_->hasCharRules(); return 0; } inline ProcessingMode::Specificity::Specificity() : toInitial_(0), nextRuleIndex_(0), ruleType_(styleRule) { } inline bool ProcessingMode::Specificity::isStyle() const { return ruleType_ == styleRule; } inline void ProcessingMode::Action::get(InsnPtr &insn, SosofoObj *&sosofo) const { insn = insn_; sosofo = sosofo_; } inline const Location &ProcessingMode::Action::location() const { return defLoc_; } inline ProcessingMode::Action &ProcessingMode::Rule::action() { return *action_; } inline const ProcessingMode::Action &ProcessingMode::Rule::action() const { return *action_; } inline unsigned ProcessingMode::Action::partIndex() const { return partIndex_; } inline const Location &ProcessingMode::Rule::location() const { return action_->location(); } inline void ProcessingMode::Rule::swap(Rule &r) { action_.swap(r.action_); } #ifdef DSSSL_NAMESPACE } #endif #endif /* not ProcessingMode_INCLUDED */ OpenJade-1.4devel/style/SosofoObj.h0000644000021000000240000002055007025631172012744 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef SosofoObj_INCLUDED #define SosofoObj_INCLUDED 1 #include "ELObj.h" #include #include "FOTBuilder.h" #include #include #include "Insn.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ProcessContext; class Interpreter; class SosofoObj : public ELObj { public: virtual void process(ProcessContext &) = 0; SosofoObj *asSosofo(); virtual bool tableBorderStyle(StyleObj *&); virtual bool ruleStyle(ProcessContext &, StyleObj *&); virtual bool isRule(); virtual bool characterStyle(ProcessContext &, StyleObj *&, FOTBuilder::CharacterNIC &); virtual bool isCharacter(); }; class NextMatchSosofoObj : public SosofoObj { public: NextMatchSosofoObj(StyleObj *, const Location &); void process(ProcessContext &); private: StyleObj *style_; Location loc_; }; class EmptySosofoObj : public SosofoObj { public: void process(ProcessContext &); }; class ProcessingMode; class ProcessNodeSosofoObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ProcessNodeSosofoObj(const NodePtr &node, const ProcessingMode *mode, const Location &loc); void process(ProcessContext &); private: NodePtr node_; const ProcessingMode *mode_; Location loc_; }; class ProcessNodeListSosofoObj : public SosofoObj { public: ProcessNodeListSosofoObj(NodeListObj *, const ProcessingMode *, const Location &loc); void process(ProcessContext &); void traceSubObjects(Collector &) const; private: NodeListObj *nodeList_; const ProcessingMode *mode_; Location loc_; }; class AppendSosofoObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } AppendSosofoObj() { hasSubObjects_ = 1; } void process(ProcessContext &); void append(SosofoObj *); void traceSubObjects(Collector &) const; private: Vector v_; }; class LiteralSosofoObj : public SosofoObj { public: LiteralSosofoObj(ELObj *str, const Location &loc) : str_(str), loc_(loc) { hasSubObjects_ = 1; } void process(ProcessContext &); void traceSubObjects(Collector &) const; private: ELObj *str_; Location loc_; }; class CurrentNodePageNumberSosofoObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } CurrentNodePageNumberSosofoObj(const NodePtr &node) : node_(node) { } void process(ProcessContext &); private: NodePtr node_; Location loc_; }; class PageNumberSosofoObj : public SosofoObj { public: PageNumberSosofoObj() { } void process(ProcessContext &); }; class CompoundFlowObj; class FlowObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } FlowObj(); FlowObj(const FlowObj &fo) : SosofoObj(fo), style_(fo.style_), locp_(fo.locp_ ? new Location(*fo.locp_) : 0) { } virtual FlowObj *copy(Collector &) const = 0; virtual CompoundFlowObj *asCompoundFlowObj(); virtual bool hasNonInheritedC(const Identifier *) const; virtual bool hasPseudoNonInheritedC(const Identifier *) const; virtual void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &); virtual void setImplicitChar(Char); static void fixCharNICs(const Char *, size_t, FOTBuilder::CharacterNIC *, const Location &, ProcessContext &); void traceSubObjects(Collector &) const; void setStyle(StyleObj *); void setLocation(const Location &loc); void process(ProcessContext &); virtual void pushStyle(ProcessContext &, unsigned &); virtual void popStyle(ProcessContext &, unsigned); virtual void processInner(ProcessContext &) = 0; const Location &location() const { return *locp_; } // Accept flags. Used by ProcessContext::Validator descendants. enum { afNever=0, // I.e. only as characteristic value. afAlways=1<<0, // Always accepted afScroll=1<<1, // This is a scroll object. afPaging=1<<2, // A paging FO (i.e. (simple-)page-sequence afInline=1<<3, afDisplay=1<<4, afParagraphBreak=1<<5, afMathSequence=1<<6, // FO accepted in a math-sequence afChar=1<<7, afGridCell=1<<8, afSideBySideItem, afTablePart=1<<10, afTableColumn=1<<11, afTableRow=1<<12, afTableCell=1<<13, }; // Change when more than 16 flags (to be safe). typedef unsigned AcceptFlags; // This method has to be called AFTER pushStyle, since some FOs will // change flags according to some characteristic values. virtual AcceptFlags acceptFlags(ProcessContext &) const = 0; protected: static bool setDisplayNIC(FOTBuilder::DisplayNIC &, const Identifier *, ELObj *, const Location &, Interpreter &); static bool isDisplayNIC(const Identifier *); StyleObj *style_; Owner locp_; // We have two "pointer-sized" data members. Room for two more in // derived classes. }; class CompoundFlowObj : public FlowObj { public: CompoundFlowObj() : content_(0) { } void processInner(ProcessContext &); void traceSubObjects(Collector &) const; void setContent(SosofoObj *content) { content_ = content; } CompoundFlowObj *asCompoundFlowObj(); protected: SosofoObj *content() const; private: SosofoObj *content_; // One pointer left for NICs. }; class SequenceFlowObj : public CompoundFlowObj { public: SequenceFlowObj() { } void processInner(ProcessContext &); FlowObj *copy(Collector &) const; AcceptFlags acceptFlags(ProcessContext &) const { return afAlways; } }; class ProcessingMode; class ProcessChildrenSosofoObj : public SosofoObj { public: ProcessChildrenSosofoObj(const ProcessingMode *mode, const Location &loc) : mode_(mode), loc_(loc) { } void process(ProcessContext &); private: const ProcessingMode *mode_; Location loc_; }; class ProcessChildrenTrimSosofoObj : public SosofoObj { public: ProcessChildrenTrimSosofoObj(const ProcessingMode *mode, const Location &loc) : mode_(mode), loc_(loc) { } void process(ProcessContext &); private: const ProcessingMode *mode_; Location loc_; }; class SetNonInheritedCsSosofoObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } SetNonInheritedCsSosofoObj(FlowObj *, const InsnPtr &, ELObj **, const NodePtr &); ~SetNonInheritedCsSosofoObj(); void process(ProcessContext &); void traceSubObjects(Collector &) const; bool characterStyle(ProcessContext &, StyleObj *&, FOTBuilder::CharacterNIC &); bool isCharacter(); bool ruleStyle(ProcessContext &, StyleObj *&); bool isRule(); private: ELObj *resolve(ProcessContext &); FlowObj *flowObj_; ELObj **display_; InsnPtr code_; NodePtr node_; }; class Expression; // This wraps a flow object that has a label:. class LabelSosofoObj : public SosofoObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } LabelSosofoObj(SymbolObj *, const Location &, SosofoObj *content); void process(ProcessContext &); void traceSubObjects(Collector &) const; private: SymbolObj *label_; Owner locp_; SosofoObj *content_; }; // This wraps the content of a sosofo with a content-map:. class ContentMapSosofoObj : public SosofoObj { public: ContentMapSosofoObj(ELObj *, const Location *, SosofoObj *content); void process(ProcessContext &); void traceSubObjects(Collector &) const; private: ELObj *contentMap_; const Location *locp_; SosofoObj *content_; }; class DiscardLabeledSosofoObj : public SosofoObj { public: DiscardLabeledSosofoObj(SymbolObj *, SosofoObj *); void process(ProcessContext &); void traceSubObjects(Collector &) const; private: SymbolObj *label_; SosofoObj *content_; }; class PageTypeSosofoObj : public SosofoObj { public: PageTypeSosofoObj(unsigned, SosofoObj *, SosofoObj *); void process(ProcessContext &); void traceSubObjects(Collector &) const; private: unsigned pageTypeFlag_; SosofoObj *match_; SosofoObj *noMatch_; }; inline void FlowObj::setStyle(StyleObj *style) { style_ = style; } inline void FlowObj::setLocation(const Location &loc) { locp_ = new Location(loc); } inline void AppendSosofoObj::append(SosofoObj *obj) { v_.push_back(obj); } inline SosofoObj *CompoundFlowObj::content() const { return content_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not SosofoObj_INCLUDED */ OpenJade-1.4devel/style/SchemeParser.cxx0000644000021000000240000022274307067706657014026 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "SchemeParser.h" #include "InterpreterMessages.h" #include "Pattern.h" #include "MacroFlowObj.h" #include #include #include "LangObj.h" #include "VM.h" #include "ELObjMessageArg.h" #include "DssslSpecEventHandler.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif const Char defaultChar = 0xfffd; SchemeParser::SchemeParser(Interpreter &interp, Owner &in) : interp_(&interp), defMode_(interp.initialProcessingMode()), dsssl2_(interp.dsssl2()), lang_(0) { in_.swap(in); { StringC tem(Interpreter::makeStringC("ISO/IEC 10036/RA//Glyphs")); afiiPublicId_ = interp_->storePublicId(tem.data(), tem.size(), Location()); } } void SchemeParser::parseStandardChars() { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::charset, loc); for (;;) { Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) break; StringC name(currentToken_); if (!getToken(allowOtherExpr, tok) || tok != tokenNumber) { message(InterpreterMessages::badDeclaration); break; } int i; for (i = 0; i < name.size(); i++) if (interp_->lexCategory(name[i]) != Interpreter::lexLetter && ((i == 0) || (interp_->lexCategory(name[i]) != Interpreter::lexDigit && name[i] != '-' && name[i] != '.'))) break; if (i < name.size() || name.size() == 1) { message(InterpreterMessages::invalidCharName, StringMessageArg(name)); continue; } for (i = 0; i < currentToken_.size(); i++) if (interp_->lexCategory(currentToken_[i]) != Interpreter::lexDigit) break; if (i < currentToken_.size()) { message(InterpreterMessages::invalidCharNumber, StringMessageArg(currentToken_)); continue; } interp_->addStandardChar(name, currentToken_); } } void SchemeParser::parseNameChars() { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::charset, loc); for (;;) { Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) break; interp_->addNameChar(currentToken_); } } void SchemeParser::parseSeparatorChars() { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::charset, loc); for (;;) { Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) break; interp_->addSeparatorChar(currentToken_); } } void SchemeParser::parseFeatures() { interp_->explicitFeatures(); for (;;) { Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) break; interp_->declareFeature(currentToken_); } } void SchemeParser::parseGrovePlan() { interp_->explicitModules(); for (;;) { Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) break; interp_->addModule(currentToken_); } } void SchemeParser::parseMapSdataEntity(const StringC &ename, const StringC &etext) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::charset, loc); Token tok; if (!getToken(allowIdentifier|allowEndOfEntity, tok) || tok == tokenEndOfEntity) { message(InterpreterMessages::badDeclaration); return; } interp_->addSdataEntity(ename, etext, currentToken_); } void SchemeParser::parse() { bool recovering = 0; for (;;) { Token tok; if (!getToken(recovering ? ~0 : allowOpenParen|allowEndOfEntity, tok)) recovering = 1; else { if (tok == tokenEndOfEntity) break; if (tok != tokenOpenParen || !getToken(recovering ? ~0 : unsigned(allowIdentifier), tok) || tok != tokenIdentifier) recovering = 1; else { const Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) { if (!recovering) message(InterpreterMessages::unknownTopLevelForm, StringMessageArg(currentToken_)); recovering = 1; } else { switch (key) { case Identifier::keyDefine: recovering = !doDefine(); break; case Identifier::keyDefineUnit: recovering = !doDefineUnit(); break; case Identifier::keyDefault: recovering = !doDefault(); break; case Identifier::keyQuery: recovering = !doQuery(); break; case Identifier::keyElement: recovering = !doElement(); break; case Identifier::keyOrElement: recovering = !doOrElement(); break; case Identifier::keyRoot: recovering = !doRoot(); break; case Identifier::keyId: recovering = !doId(); break; case Identifier::keyMode: recovering = !doMode(); break; case Identifier::keyDeclareInitialValue: recovering = !doDeclareInitialValue(); break; case Identifier::keyDeclareCharacteristic: recovering = !doDeclareCharacteristic(); break; case Identifier::keyDeclareFlowObjectClass: recovering = !doDeclareFlowObjectClass(); break; case Identifier::keyDeclareClassAttribute: recovering = !doDeclareClassAttribute(); break; case Identifier::keyDeclareIdAttribute: recovering = !doDeclareIdAttribute(); break; case Identifier::keyDeclareFlowObjectMacro: recovering = !doDeclareFlowObjectMacro(); break; case Identifier::keyDeclareDefaultLanguage: recovering = !doDeclareDefaultLanguage(); break; case Identifier::keyDefineLanguage: recovering = !doDefineLanguage(); break; case Identifier::keyDeclareCharProperty: recovering = !doDeclareCharProperty(); break; case Identifier::keyAddCharProperties: recovering = !doAddCharProperties(); break; case Identifier::keyDeclareCharCharacteristicAndProperty: recovering = !doDeclareCharCharacteristicAndProperty(); break; case Identifier::keyDeclareReferenceValueType: case Identifier::keyDefinePageModel: case Identifier::keyDefineColumnSetModel: case Identifier::keyDefineTransliterationMap: recovering = !skipForm(); break; case Identifier::keyArrow: recovering = !doAssociation(); break; default: if (!recovering) message(InterpreterMessages::unknownTopLevelForm, StringMessageArg(currentToken_)); recovering = 1; break; } } } } } #if 0 NamedTableIter iter(identTable_); for (;;) { Identifier *ident = iter.next(); if (!ident) break; Location loc; unsigned part; if (ident->defined(part, loc)) { ELObj *obj = ident->computeValue(1, *this); if (!isError(obj)) { *os_ << ident->name() << "="; obj->print(*this, *os_); *os_ << OutputCharStream::newline; os_->flush(); } } } #endif } bool SchemeParser::parseExpression(Owner &expr) { Identifier::SyntacticKey key; Token tok; if (!parseExpression(0, expr, key, tok)) return 0; getToken(allowEndOfEntity, tok); return 1; } bool SchemeParser::doMode() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; defMode_ = lookupProcessingMode(currentToken_); defMode_->setDefined(); for (;;) { if (!getToken(allowOpenParen|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowIdentifier, tok)) return 0; const Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) { message(InterpreterMessages::badModeForm, StringMessageArg(currentToken_)); return 0; } else { switch (key) { case Identifier::keyDefault: if (!doDefault()) return 0; break; case Identifier::keyQuery: if (!doQuery()) return 0; break; case Identifier::keyElement: if (!doElement()) return 0; break; case Identifier::keyOrElement: if (!doOrElement()) return 0; break; case Identifier::keyRoot: if (!doRoot()) return 0; break; case Identifier::keyId: if (!doId()) return 0; break; default: message(InterpreterMessages::badModeForm, StringMessageArg(currentToken_)); return 0; } } } defMode_ = interp_->initialProcessingMode(); return 1; } bool SchemeParser::doQuery() { Location loc(in_->currentLocation()); Owner query, expr, priority; Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, query, key, tok)) return 0; ProcessingMode::RuleType ruleType; if (!parseRuleBody(expr, priority, ruleType, 1)) return 0; defMode_->addQueryRule(query, expr, priority, ruleType, loc, *interp_); return 1; } bool SchemeParser::doElement() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; ELObj *obj; if (!parseDatum(0, obj, loc, tok)) return 0; NCVector patterns(1); Owner expr; ProcessingMode::RuleType ruleType; if (interp_->convertToPattern(obj, loc, patterns[0])) { if (!parseRuleBody(expr, ruleType)) return 0; defMode_->addElementRule(patterns, expr, ruleType, loc, *interp_); } else if (!parseRuleBody(expr, ruleType)) return 0; return 1; } bool SchemeParser::doOrElement() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowOpenParen, tok)) return 0; NCVector patterns; unsigned allowed = 0; bool ok = 1; for (;;) { ELObj *obj; if (!parseDatum(allowed, obj, loc, tok)) return 0; if (!obj) break; allowed = allowCloseParen; if (ok) { patterns.resize(patterns.size() + 1); if (!interp_->convertToPattern(obj, loc, patterns.back())) ok = 0; } } ProcessingMode::RuleType ruleType; Owner expr; if (!parseRuleBody(expr, ruleType)) return 0; if (ok) defMode_->addElementRule(patterns, expr, ruleType, loc, *interp_); return 1; } bool SchemeParser::doId() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowString|allowIdentifier, tok)) return 0; StringC id(currentToken_); Owner expr; ProcessingMode::RuleType ruleType; if (!parseRuleBody(expr, ruleType)) return 0; IList list; Pattern::Element *elem = new Pattern::Element(StringC()); list.insert(elem); elem->addQualifier(new Pattern::IdQualifier(id)); Pattern pattern(list); NCVector patterns(1); patterns[0].swap(pattern); defMode_->addElementRule(patterns, expr, ruleType, loc, *interp_); return 1; } bool SchemeParser::doDefault() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Owner expr; ProcessingMode::RuleType ruleType; if (!parseRuleBody(expr, ruleType)) return 0; IList list; list.insert(new Pattern::Element(StringC())); Pattern pattern(list); NCVector patterns(1); pattern.swap(patterns[0]); defMode_->addElementRule(patterns, expr, ruleType, loc, *interp_); return 1; } bool SchemeParser::doRoot() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Owner expr; ProcessingMode::RuleType ruleType; if (!parseRuleBody(expr, ruleType)) return 0; defMode_->addRootRule(expr, ruleType, loc, *interp_); return 1; } bool SchemeParser::parseRuleBody(Owner &expr, ProcessingMode::RuleType &ruleType) { Owner tem; return parseRuleBody(expr, tem, ruleType, 0); } bool SchemeParser::parseRuleBody(Owner &expr, Owner &priority, ProcessingMode::RuleType &ruleType, bool query) { Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; const Identifier *k = dsssl2() ? expr->keyword() : 0; if (k) { // style rule Vector keys; NCVector > exprs; for (;;) { keys.push_back(k); exprs.resize(exprs.size() + 1); if (!parseExpression(0, exprs.back(), key, tok)) return 0; if (!getToken(allowKeyword|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; k = lookup(currentToken_); } expr = new StyleExpression(keys, exprs, expr->location()); ruleType = ProcessingMode::styleRule; } else { ruleType = ProcessingMode::constructionRule; if (query) { if (!parseExpression(allowCloseParen, priority, key, tok)) return 0; if (tok == tokenCloseParen) return 1; } if (!getToken(allowCloseParen, tok)) return 0; } return 1; } bool SchemeParser::doDeclareInitialValue() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); if (ident->inheritedC().isNull()) message(InterpreterMessages::notABuiltinInheritedC, StringMessageArg(ident->name())); Owner expr; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; if (ident->inheritedC().isNull()) return 1; interp_->installInitialValue(ident, expr); return 1; } bool SchemeParser::doDeclareCharCharacteristicAndProperty() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); CharProp *cp = interp_->lookupCharProperty(currentToken_); if (!getToken(allowString|(dsssl2() ? unsigned(allowFalse) : 0), tok)) return 0; StringC pubid; if (tok == tokenString) pubid = currentToken_; Owner expr; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if (ident->inheritedCDefined(defPart, defLoc)) { setNextLocation(loc); message(InterpreterMessages::duplicateCharacteristic, StringMessageArg(ident->name()), defLoc); } else if (ident->charNICDefined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { setNextLocation(loc); message(InterpreterMessages::duplicateCharacteristic, StringMessageArg(ident->name()), defLoc); } } else if (cp->declared (defPart, defLoc) && defPart <= interp_->currentPartIndex()) { setNextLocation(loc); message(InterpreterMessages::duplicateCharPropertyDecl, StringMessageArg(cp->name()), defLoc); } else { cp->declare(expr, interp_->currentPartIndex(), loc, interp_->installExtensionCharNIC(ident, pubid, loc)); } return 1; } bool SchemeParser::doDeclareCharacteristic() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); if (!getToken(allowString|(dsssl2() ? unsigned(allowFalse) : 0), tok)) return 0; StringC pubid; if (tok == tokenString) pubid = currentToken_; Owner expr; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if (ident->charNICDefined(defPart, defLoc)) { setNextLocation(loc); message(InterpreterMessages::duplicateCharacteristic, StringMessageArg(ident->name()), defLoc); } else if (ident->inheritedCDefined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { setNextLocation(loc); message(InterpreterMessages::duplicateCharacteristic, StringMessageArg(ident->name()), defLoc); } } else { interp_->installExtensionInheritedC(ident, pubid, loc); interp_->installInitialValue(ident, expr); } return 1; } bool SchemeParser::doDeclareFlowObjectClass() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); if (!getToken(allowString, tok)) return 0; Location defLoc; unsigned defPart; if (ident->inheritedCDefined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { setNextLocation(loc); message(InterpreterMessages::duplicateFlowObjectClass, StringMessageArg(ident->name()), defLoc); } } else interp_->installExtensionFlowObjectClass(ident, currentToken_, loc); if (!getToken(allowCloseParen, tok)) return 0; return 1; } bool SchemeParser::doDeclareFlowObjectMacro() { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); if (ident->flowObj()) // FIXME report an error if same part ; if (!getToken(allowOpenParen, tok)) return 0; Vector nics; NCVector > inits; const Identifier *contentsId = 0; unsigned allowed = (allowOpenParen|allowCloseParen|allowIdentifier|allowHashContents); for (;;) { if (!getToken(allowed, tok)) return 0; if (tok == tokenCloseParen) break; switch (tok) { case tokenHashContents: if (!getToken(allowIdentifier, tok)) return 0; contentsId = lookup(currentToken_); allowed = allowCloseParen; break; case tokenIdentifier: nics.push_back(lookup(currentToken_)); break; case tokenOpenParen: { if (!getToken(allowIdentifier, tok)) return 0; nics.push_back(lookup(currentToken_)); inits.resize(nics.size()); Identifier::SyntacticKey key; if (!parseExpression(0, inits.back(), key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; } break; default: CANNOT_HAPPEN(); } } // We could allow sequence which is appended together here. Owner body; Identifier::SyntacticKey key; if (!parseExpression(0, body, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if (ident->inheritedCDefined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { setNextLocation(loc); message(InterpreterMessages::duplicateFlowObjectClass, StringMessageArg(ident->name()), defLoc); } } else { MacroFlowObj *flowObj = new (*interp_) MacroFlowObj(nics, inits, contentsId, body); interp_->makePermanent(flowObj); ident->setFlowObj(flowObj); } return 1; } bool SchemeParser::doDeclareClassAttribute() { Token tok; if (!getToken(allowString|allowIdentifier, tok)) return 0; interp_->addClassAttributeName(currentToken_); if (!getToken(allowCloseParen, tok)) return 0; return 1; } bool SchemeParser::doDeclareIdAttribute() { Token tok; if (!getToken(allowString|allowIdentifier, tok)) return 0; interp_->addIdAttributeName(currentToken_); if (!getToken(allowCloseParen, tok)) return 0; return 1; } bool SchemeParser::doDefine() { Location loc(in_->currentLocation()); bool internal = 0; Interpreter::Feature feature = Interpreter::noFeature; if (interp_->currentPartIndex() == unsigned(-1)) { Token tok; if (!getToken(allowOpenParen|allowIdentifier|allowKeyword, tok)) return 0; if (tok == tokenKeyword) { if (currentToken_ == interp_->makeStringC("internal")) internal = 1; else if (currentToken_ == interp_->makeStringC("feature")) { if (!getToken(allowIdentifier, tok) || !interp_->convertFeature(currentToken_, feature)) return 0; } else return 0; } else in_->ungetToken(); } Identifier *ident = 0; Owner expr; if (!parseDefine(ident, expr)) return 0; Location defLoc; unsigned defPart; if (ident->defined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) message(InterpreterMessages::duplicateDefinition, StringMessageArg(ident->name()), defLoc); } else if (internal) ident->setBuiltinDefinition(expr, interp_->currentPartIndex(), loc); else ident->setDefinition(expr, interp_->currentPartIndex(), loc); ident->setFeature(feature); return 1; } bool SchemeParser::parseDefine(Identifier *&ident, Owner &expr) { Location loc(in_->currentLocation()); Token tok; Vector formals; bool isProcedure; if (!getToken(allowOpenParen|allowIdentifier, tok)) return 0; if (tok == tokenOpenParen) { interp_->requireFeature(Interpreter::expression, loc); if (!getToken(allowIdentifier, tok)) return 0; isProcedure = 1; } else isProcedure = 0; ident = lookup(currentToken_); Identifier::SyntacticKey key; if (ident->syntacticKey(key) && key <= int(Identifier::lastSyntacticKey)) message(InterpreterMessages::syntacticKeywordAsVariable, StringMessageArg(currentToken_)); NCVector > inits; int nOptional; int nKey; bool hasRest; if (isProcedure && !parseFormals(formals, inits, nOptional, hasRest, nKey)) return 0; if (isProcedure) { if (!parseBody(expr)) return 0; } else { if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; } if (isProcedure) expr = new LambdaExpression(formals, inits, nOptional, hasRest, nKey, expr, loc); return 1; } bool SchemeParser::doDefineUnit() { Location loc(in_->currentLocation()); Token tok; if (!getToken(allowIdentifier, tok)) return 0; int i; for (i = 0; i < currentToken_.size(); i++) if (interp_->lexCategory(currentToken_[i]) != Interpreter::lexLetter) break; if ((i < currentToken_.size()) || ((currentToken_.size() == 1) && (currentToken_[0] =='e'))) { message(InterpreterMessages::invalidUnitName, StringMessageArg(currentToken_)); return 0; } Unit *unit = interp_->lookupUnit(currentToken_); Owner expr; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if (unit->defined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) message(InterpreterMessages::duplicateUnitDefinition, StringMessageArg(unit->name()), defLoc); } else unit->setDefinition(expr, interp_->currentPartIndex(), loc); return 1; } bool SchemeParser::doAssociation() { Location loc(in_->currentLocation()); if (interp_->style()) { interp_->setNextLocation(loc); interp_->message(InterpreterMessages::transformationLanguage); return 0; } Owner qexpr, texpr, pexpr; Identifier::SyntacticKey key; Token tok; if (!parseExpression(0, qexpr, key, tok) || !parseExpression(0, texpr, key, tok) || !parseExpression(allowCloseParen, pexpr, key, tok)) return 0; if (!pexpr) pexpr = new ConstantExpression(interp_->makeInteger(0), in_->currentLocation()); else if (!getToken(allowCloseParen, tok)) return 0; interp_->transformationMode()->addAssociation(qexpr, texpr, pexpr, loc, *interp_); return 1; } bool SchemeParser::skipForm() { static const unsigned allow = (~0 & ~allowEndOfEntity); unsigned level = 0; for (;;) { Token tok; if (!getToken(allow, tok)) break; switch (tok) { case tokenOpenParen: level++; break; case tokenCloseParen: if (level == 0) return 1; level--; break; default: break; } } return 0; } bool SchemeParser::parseExpression(unsigned allowed, Owner &expr, Identifier::SyntacticKey &key, Token &tok) { expr.clear(); key = Identifier::notKey; ELObj *obj; if (!parseSelfEvaluating(allowed, obj, tok)) return 0; if (obj) { interp_->makePermanent(obj); expr = new ConstantExpression(obj, in_->currentLocation()); return 1; } switch (tok) { case tokenQuote: { Location loc; if (!parseDatum(0, obj, loc, tok)) return 0; interp_->makePermanent(obj); expr = new ConstantExpression(obj, loc); break; } case tokenQuasiquote: { bool spliced; return parseQuasiquoteTemplate(0, 0, expr, key, tok, spliced); } case tokenOpenParen: { Location loc(in_->currentLocation()); if (!parseExpression(allowExpressionKey, expr, key, tok)) return 0; if (expr) { NCVector > args; for (;;) { args.resize(args.size() + 1); if (!parseExpression(allowCloseParen, args.back(), key, tok)) return 0; if (!args.back()) { args.resize(args.size() - 1); break; } } expr = new CallExpression(expr, args, loc); } else { switch (key) { case Identifier::keyQuote: return parseQuote(expr); case Identifier::keyLambda: return parseLambda(expr); case Identifier::keyIf: return parseIf(expr); case Identifier::keyCond: return parseCond(expr); case Identifier::keyAnd: return parseAnd(expr); case Identifier::keyOr: return parseOr(expr); case Identifier::keyCase: return parseCase(expr); case Identifier::keyLet: return parseLet(expr); case Identifier::keyLetStar: return parseLetStar(expr); case Identifier::keyLetrec: return parseLetrec(expr); case Identifier::keyThereExists: return parseSpecialQuery(expr, "node-list-some?"); case Identifier::keyForAll: return parseSpecialQuery(expr, "node-list-every?"); case Identifier::keySelectEach: return parseSpecialQuery(expr, "node-list-filter"); case Identifier::keyUnionForEach: return parseSpecialQuery(expr, "node-list-union-map"); case Identifier::keyMake: return parseMake(expr); case Identifier::keyStyle: return parseStyle(expr); case Identifier::keyWithMode: return parseWithMode(expr); case Identifier::keyQuasiquote: return parseQuasiquote(expr); case Identifier::keySet: return parseSet(expr); case Identifier::keyBegin: return parseBegin(expr); default: CANNOT_HAPPEN(); } } break; } case tokenIdentifier: { const Identifier *ident = lookup(currentToken_); if (ident->syntacticKey(key) && key <= int(Identifier::lastSyntacticKey)) { switch (key) { case Identifier::keyDefine: if (allowed & allowKeyDefine) return 1; break; case Identifier::keyArrow: if (allowed & allowKeyArrow) return 1; break; case Identifier::keyElse: if (allowed & allowKeyElse) return 1; break; case Identifier::keyUnquote: case Identifier::keyUnquoteSplicing: break; default: if (allowed & allowExpressionKey) return 1; break; } message(InterpreterMessages::syntacticKeywordAsVariable, StringMessageArg(currentToken_)); } expr = new VariableExpression(ident, in_->currentLocation()); } break; default: break; } return 1; } bool SchemeParser::parseQuote(Owner &expr) { Token tok; Location loc; ELObj *obj; if (!parseDatum(0, obj, loc, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; interp_->makePermanent(obj); expr = new ConstantExpression(obj, loc); return 1; } bool SchemeParser::parseQuasiquote(Owner &expr) { bool spliced; Token tok; Identifier::SyntacticKey key; if (!parseQuasiquoteTemplate(0, 0, expr, key, tok, spliced)) return 0; return getToken(allowCloseParen, tok); } bool SchemeParser::parseQuasiquoteTemplate(unsigned level, unsigned allowed, Owner &expr, Identifier::SyntacticKey &key, Token &tok, bool &spliced) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::expression, loc); key = Identifier::notKey; spliced = 0; ELObj *obj; if (!parseSelfEvaluating(allowed|allowUnquote|allowVector, obj, tok)) return 0; switch (tok) { case tokenQuasiquote: if (!parseQuasiquoteTemplate(level + 1, 0, expr, key, tok, spliced)) return 0; createQuasiquoteAbbreviation("quasiquote", expr); break; case tokenQuote: if (!parseQuasiquoteTemplate(level, 0, expr, key, tok, spliced)) break; createQuasiquoteAbbreviation("quote", expr); break; case tokenUnquote: case tokenUnquoteSplicing: if (level == 0) { spliced = (tok == tokenUnquoteSplicing); if (!parseExpression(0, expr, key, tok)) return 0; } else { Token tem; if (!parseQuasiquoteTemplate(level - 1, 0, expr, key, tem, spliced)) break; createQuasiquoteAbbreviation(tok == tokenUnquote ? "unquote" : "unquote-splicing", expr); } break; case tokenOpenParen: case tokenVector: { QuasiquoteExpression::Type type = (tok == tokenVector ? QuasiquoteExpression::vectorType : QuasiquoteExpression::listType); Location loc(in_->currentLocation()); NCVector > exprs(1); Vector exprsSpliced; bool temSpliced; if (!parseQuasiquoteTemplate(level, allowCloseParen|allowQuasiquoteKey|allowUnquoteSplicing, exprs[0], key, tok, temSpliced)) return 0; if (!exprs[0]) { switch (key) { case Identifier::keyQuasiquote: if (!parseQuasiquoteTemplate(level + 1, 0, expr, key, tok, spliced)) return 0; createQuasiquoteAbbreviation("quasiquotation", expr); break; case Identifier::keyUnquoteSplicing: spliced = 1; // fall through case Identifier::keyUnquote: if (level == 0) { if (!parseExpression(0, expr, key, tok)) return 0; } else { if (!parseQuasiquoteTemplate(level - 1, 0, expr, key, tok, temSpliced)) return 0; createQuasiquoteAbbreviation(spliced ? "unquote-splicing" : "unquote", expr); spliced = 0; } break; default: expr = new ConstantExpression(interp_->makeNil(), loc); return 1; } return getToken(allowCloseParen, tok); } exprsSpliced.push_back(PackedBoolean(temSpliced)); for (;;) { Owner tem; if (!parseQuasiquoteTemplate(level, allowCloseParen|allowUnquoteSplicing |(type == QuasiquoteExpression::vectorType ? 0 : allowPeriod), tem, key, tok, temSpliced)) return 0; if (!tem) { if (tok == tokenCloseParen) break; exprs.resize(exprs.size() + 1); type = QuasiquoteExpression::improperType; if (!parseQuasiquoteTemplate(level, 0, exprs.back(), key, tok, temSpliced)) return 0; if (!getToken(allowCloseParen, tok)) return 0; exprsSpliced.push_back(0); break; } exprs.resize(exprs.size() + 1); exprs.back().swap(tem); exprsSpliced.push_back(PackedBoolean(temSpliced)); } expr = new QuasiquoteExpression(exprs, exprsSpliced, type, loc); } break; case tokenIdentifier: if (allowed & allowQuasiquoteKey) { const Identifier *ident = lookup(currentToken_); if (ident->syntacticKey(key)) { switch (key) { case Identifier::keyUnquoteSplicing: case Identifier::keyUnquote: case Identifier::keyQuasiquote: return 1; default: break; } } } obj = interp_->makeSymbol(currentToken_); // fall through default: if (obj) { interp_->makePermanent(obj); expr = new ConstantExpression(obj, in_->currentLocation()); } break; } return 1; } void SchemeParser::createQuasiquoteAbbreviation(const char *sym, Owner &expr) { Location loc(expr->location()); NCVector > v(2); v[1].swap(expr); v[0] = new ConstantExpression(interp_->makeSymbol(Interpreter::makeStringC(sym)), loc); Vector spliced; spliced.push_back(0); spliced.push_back(0); expr = new QuasiquoteExpression(v, spliced, QuasiquoteExpression::listType, loc); } bool SchemeParser::parseIf(Owner &expr) { Location loc(in_->currentLocation()); Owner expr0, expr1, expr2; Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, expr0, key, tok) || !parseExpression(0, expr1, key, tok) || !parseExpression(dsssl2() ? allowCloseParen : 0, expr2, key, tok)) return 0; if (!expr2) expr2 = new ConstantExpression(interp_->makeUnspecified(), in_->currentLocation()); else if (!getToken(allowCloseParen, tok)) return 0; expr = new IfExpression(expr0, expr1, expr2, loc); return 1; } bool SchemeParser::parseCond(Owner &expr, bool opt) { Location loc(in_->currentLocation()); Token tok; if (!getToken(allowOpenParen|(opt ? unsigned(allowCloseParen) : 0), tok)) return 0; if (tok == tokenCloseParen) { if (dsssl2()) expr = new ConstantExpression(interp_->makeUnspecified(), loc); else expr = new CondFailExpression(loc); return 1; } Identifier::SyntacticKey key; Owner testExpr; if (!parseExpression(allowKeyElse, testExpr, key, tok)) return 0; if (!testExpr) { if (!parseBegin(expr)) return 0; return getToken(allowCloseParen, tok); } NCVector > valExprs; Owner tem; bool arrow = 0; if (!parseExpression(allowCloseParen|allowKeyArrow, tem, key, tok)) return 0; if (key == Identifier::keyArrow) { arrow = 1; interp_->requireFeature(Interpreter::expression, testExpr->location()); if (!parseExpression(0, tem, key, tok)) return 0; } if (!tem) interp_->requireFeature(Interpreter::expression, testExpr->location()); else { valExprs.resize(valExprs.size() + 1); tem.swap(valExprs.back()); if (arrow || !dsssl2()) { if (!getToken(allowCloseParen, tok)) return 0; } else for (;;) { if (!parseExpression(allowCloseParen, tem, key, tok)) return 0; if (!tem) break; valExprs.resize(valExprs.size() + 1); tem.swap(valExprs.back()); } } Owner valExpr; if (valExprs.size() == 1) valExprs[0].swap(valExpr); else if (valExprs.size()) valExpr = new SequenceExpression(valExprs, valExprs[0]->location()); Owner elseExpr; if (!parseCond(elseExpr, 1)) return 0; if (arrow) { const Identifier *ident = interp_->lookup(interp_->makeStringC("cond")); Vector vars; NCVector > inits(1), args(1); Owner thenExpr, body; vars.push_back(ident); testExpr.swap(inits.back()); testExpr = new VariableExpression(ident, loc); args.back() = new VariableExpression(ident, loc); thenExpr = new CallExpression(valExpr, args, loc); body = new IfExpression(testExpr, thenExpr, elseExpr, loc); expr = new LetExpression(vars, inits, body, loc); } else if (valExpr) expr = new IfExpression(testExpr, valExpr, elseExpr, loc); else expr = new OrExpression(testExpr, elseExpr, loc); return 1; } bool SchemeParser::parseCase(Owner &expr) { Owner keyExpr; Owner elseClause; NCVector cases; Location loc(in_->currentLocation()); Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, keyExpr, key, tok)) return 0; for (;;) { if (!getToken(allowOpenParen |(cases.size() ? unsigned(allowCloseParen) : 0), tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowOpenParen|allowIdentifier, tok)) return 0; if (tok == tokenOpenParen) { cases.resize(cases.size() + 1); Location loc; for (;;) { ELObj *obj; if (!parseDatum(allowCloseParen, obj, loc, tok)) return 0; if (tok == tokenCloseParen) break; interp_->makePermanent(obj); cases.back().datums.push_back(obj); } if (!parseBegin(cases.back().expr)) return 0; } else { const Identifier *ident = lookup(currentToken_); if (ident->syntacticKey(key) && key == Identifier::keyElse) { if (!parseBegin(elseClause)) return 0; if (!getToken(allowCloseParen, tok)) return 0; break; } else { message(InterpreterMessages::caseElse, StringMessageArg(currentToken_)); return 0; } } } if (dsssl2() && !elseClause) elseClause = new ConstantExpression(interp_->makeUnspecified(), loc); expr = new CaseExpression(keyExpr, cases, elseClause, loc); return 1; } bool SchemeParser::parseOr(Owner &expr) { Location loc(in_->currentLocation()); Token tok; Identifier::SyntacticKey key; Owner test1Expr; if (!parseExpression(allowCloseParen, test1Expr, key, tok)) return 0; if (!test1Expr) { expr = new ConstantExpression(interp_->makeFalse(), loc); return 1; } Owner test2Expr; if (!parseOr(test2Expr)) return 0; expr = new OrExpression(test1Expr, test2Expr, loc); return 1; } bool SchemeParser::parseAnd(Owner &expr, bool opt) { Location loc(in_->currentLocation()); Token tok; Identifier::SyntacticKey key; Owner testExpr; if (!parseExpression(allowCloseParen, testExpr, key, tok)) return 0; if (!testExpr) { if (!opt) expr = new ConstantExpression(interp_->makeTrue(), loc); return 1; } Owner restExpr; if (!parseAnd(restExpr, 1)) return 0; if (!restExpr) testExpr.swap(expr); else { // This relies on the fact that #f is the only false value. Owner falseExpr(new ConstantExpression(interp_->makeFalse(), loc)); expr = new IfExpression(testExpr, restExpr, falseExpr, loc); } return 1; } void SchemeParser::skipIntertokenSpace() { for (;;) { Xchar c = *in_->currentTokenEnd(); switch (c) { case InputSource::eE: return; case ' ': case '\r': case '\n': case '\t': case '\f': break; case ';': for (;;) { Xchar c1 = in_->tokenChar(*this); if (c1 == InputSource::eE || c1 == '\r') break; } break; default: if (interp_->lexCategory(c) != Interpreter::lexAddWhiteSpace) return; } in_->tokenChar(*this); } } bool SchemeParser::peekDefine() { // return true if we see (define, possibly with intertoken space // around the paren. Do not change the current pos of in_. size_t i = 0; StringC seen; in_->startToken(); skipIntertokenSpace(); if (in_->tokenChar(*this) == '(') { static char txt[] = "define"; skipIntertokenSpace(); for (i = 0; i < 6; i++) if (in_->tokenChar(*this) != txt[i]) break; } in_->ungetToken(); return (i == 6); } bool SchemeParser::parseBody(Owner &expr) { Location loc(in_->currentLocation()); Vector vars; NCVector > inits; // FIXME: This is an ugly workaround to unget two tokens // having something like setMark() and rewindToMark() in InputSource // would be much nicer while (peekDefine()) { Token tok; if (!getToken(allowOpenParen, tok) || !getToken(allowIdentifier, tok)) return 0; // FIXME: Should never happen since we have peeked Identifier *var; inits.resize(inits.size() + 1); if (!parseDefine(var, inits.back())) return 0; for (size_t i = 0; i < vars.size(); i++) if (vars[i]->name() == var->name()) { setNextLocation(in_->currentLocation()); message(InterpreterMessages::duplicateVariableBinding, StringMessageArg(var->name())); return 0; } vars.push_back(var); } if (!parseBegin(expr)) return 0; if (vars.size() > 0) expr = new LetrecExpression(vars, inits, expr, loc); return 1; } bool SchemeParser::parseBegin(Owner &expr) { Location loc(in_->currentLocation()); Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (dsssl2()) { NCVector > exprs; for (size_t i = 1;; i++) { Owner tem; if (!parseExpression(allowCloseParen, tem, key, tok)) return 0; if (!tem) break; exprs.resize(i + 1); tem.swap(exprs[i]); } if (exprs.size()) { expr.swap(exprs[0]); expr = new SequenceExpression(exprs, loc); } return 1; } else return getToken(allowCloseParen, tok); } bool SchemeParser::parseSet(Owner &expr) { Location loc(in_->currentLocation()); Token tok; if (!getToken(allowIdentifier, tok)) return 0; const Identifier *var = lookup(currentToken_); Identifier::SyntacticKey key; Owner value; if (!parseExpression(0, value, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; expr = new AssignmentExpression(var, value, loc); return 1; } bool SchemeParser::parseWithMode(Owner &expr) { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier|allowFalse, tok)) return 0; const ProcessingMode *mode; if (tok == tokenFalse) mode = interp_->initialProcessingMode(); else mode = interp_->lookupProcessingMode(currentToken_); Owner content; Identifier::SyntacticKey key; if (!parseExpression(0, content, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; expr = new WithModeExpression(mode, content, loc); return 1; } bool SchemeParser::parseMake(Owner &expr) { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } Token tok; if (!getToken(allowIdentifier, tok)) return 0; const Identifier *foc = lookup(currentToken_); NCVector > exprs; Vector keys; for (;;) { Owner tem; Identifier::SyntacticKey key; if (!parseExpression(allowCloseParen, tem, key, tok)) return 0; if (!tem) break; if (keys.size() == exprs.size()) { const Identifier *k = tem->keyword(); if (k) { tem.clear(); if (!parseExpression(0, tem, key, tok)) return 0; size_t i; for (i = 0; i < keys.size(); i++) if (keys[i]->name() == k->name()) break; if (i < keys.size()) continue; keys.push_back(k); } } exprs.resize(exprs.size() + 1); tem.swap(exprs.back()); } expr = new MakeExpression(foc, keys, exprs, loc); return 1; } bool SchemeParser::parseStyle(Owner &expr) { Location loc(in_->currentLocation()); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } NCVector > exprs; Vector keys; for (;;) { Token tok; if (!getToken(allowKeyword|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; keys.resize(keys.size() + 1); keys.back() = lookup(currentToken_); exprs.resize(exprs.size() + 1); Identifier::SyntacticKey key; if (!parseExpression(0, exprs.back(), key, tok)) return 0; } expr = new StyleExpression(keys, exprs, loc); return 1; } bool SchemeParser::parseLambda(Owner &expr) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::expression, loc); Token tok; if (!getToken(allowOpenParen, tok)) return 0; Vector formals; NCVector > inits; int nOptional; int nKey; bool hasRest; if (!parseFormals(formals, inits, nOptional, hasRest, nKey)) return 0; Owner body; if (!parseBody(body)) return 0; expr = new LambdaExpression(formals, inits, nOptional, hasRest, nKey, body, loc); return 1; } // The rest arg is put last. bool SchemeParser::parseFormals(Vector &formals, NCVector > &inits, int &nOptional, bool &hasRest, int &nKey) { Location loc(in_->currentLocation()); Token tok; enum FormalType { required, optional, rest, key } type = required; unsigned allowed = (allowCloseParen|allowIdentifier |allowHashOptional|allowHashRest|allowHashKey); int argCount[4]; for (int i = 0; i < 4; i++) argCount[i] = 0; for (;;) { if (!getToken(allowed, tok)) return 0; switch (tok) { case tokenHashOptional: allowed |= allowOpenParen; allowed &= ~allowHashOptional; type = optional; break; case tokenHashRest: allowed = allowIdentifier; type = rest; break; case tokenHashKey: interp_->requireFeature(Interpreter::keyword, loc); allowed = (allowOpenParen|allowCloseParen|allowIdentifier); type = key; break; case tokenOpenParen: { if (!getToken(allowIdentifier, tok)) return 0; argCount[type]++; formals.push_back(lookup(currentToken_)); inits.resize(argCount[optional] + argCount[key]); Identifier::SyntacticKey key; if (!parseExpression(0, inits.back(), key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; } break; case tokenIdentifier: { formals.push_back(lookup(currentToken_)); argCount[type]++; if (type == rest) allowed = (allowHashKey|allowCloseParen); } break; case tokenCloseParen: goto done; default: CANNOT_HAPPEN(); } } done: nOptional = argCount[optional]; nKey = argCount[key]; inits.resize(nOptional + nKey); hasRest = argCount[rest]; return 1; } bool SchemeParser::parseLet(Owner &expr) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::expression, loc); Token tok; if (!getToken(allowOpenParen|allowIdentifier, tok)) return 0; Vector vars; NCVector > inits; Owner body; const Identifier *name; if (tok == tokenOpenParen) { name = 0; if (!parseBindingsAndBody1(vars, inits, body)) return 0; } else { name = lookup(currentToken_); if (!parseBindingsAndBody(vars, inits, body)) return 0; } if (name) { // Named let NCVector > loopInit(1); NCVector > argsInit; loopInit[0] = new LambdaExpression(vars, argsInit, 0, 0, 0, body, loc); Vector loopFormal(1); loopFormal[0] = name; expr = new VariableExpression(name, loc); expr = new LetrecExpression(loopFormal, loopInit, expr, loc); expr = new CallExpression(expr, inits, loc); } else expr = new LetExpression(vars, inits, body, loc); return 1; } bool SchemeParser::parseLetStar(Owner &expr) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::expression, loc); Vector vars; NCVector > inits; Owner body; if (!parseBindingsAndBody(vars, inits, body)) return 0; expr = new LetStarExpression(vars, inits, body, loc); return 1; } bool SchemeParser::parseLetrec(Owner &expr) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::expression, loc); Vector vars; NCVector > inits; Owner body; if (!parseBindingsAndBody(vars, inits, body)) return 0; expr = new LetrecExpression(vars, inits, body, loc); return 1; } bool SchemeParser::parseBindingsAndBody(Vector &vars, NCVector > &inits, Owner &body) { Token tok; if (!getToken(allowOpenParen, tok)) return 0; return parseBindingsAndBody1(vars, inits, body); } bool SchemeParser::parseBindingsAndBody1(Vector &vars, NCVector > &inits, Owner &body) { Token tok; Identifier::SyntacticKey key; for (;;) { if (!getToken(allowCloseParen|allowOpenParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowIdentifier, tok)) return 0; Identifier *var = lookup(currentToken_); for (size_t i = 0; i < vars.size(); i++) if (vars[i]->name() == var->name()) { setNextLocation(in_->currentLocation()); message(InterpreterMessages::duplicateVariableBinding, StringMessageArg(var->name())); return 0; } vars.push_back(var); inits.resize(inits.size() + 1); if (!parseExpression(0, inits.back(), key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; } return parseBody(body); } bool SchemeParser::parseDatum(unsigned otherAllowed, ELObj *&result, Location &loc, Token &tok) { if (!parseSelfEvaluating(otherAllowed|allowVector|allowUnquote|allowUnquoteSplicing, result, tok)) return 0; loc = in_->currentLocation(); if (result) return 1; switch (tok) { case tokenIdentifier: result = interp_->makeSymbol(currentToken_); break; case tokenQuote: return parseAbbreviation("quote", result); case tokenQuasiquote: return parseAbbreviation("quasiquote", result); case tokenUnquote: return parseAbbreviation("unquote", result); case tokenUnquoteSplicing: return parseAbbreviation("unquote-splicing", result); case tokenOpenParen: { ELObj *tem; Location ignore; if (!parseDatum(allowCloseParen, tem, ignore, tok)) return 0; if (!tem) { result = interp_->makeNil(); break; } ELObjDynamicRoot list(*interp_, tem); PairObj *last = new (*interp_) PairObj(tem, 0); list = last; for (;;) { if (!parseDatum(allowCloseParen|allowPeriod, tem, ignore, tok)) return 0; if (!tem) { if (tok == tokenCloseParen) { last->setCdr(interp_->makeNil()); break; } if (!parseDatum(0, tem, ignore, tok)) return 0; last->setCdr(tem); if (!getToken(allowCloseParen, tok)) return 0; break; } last->setCdr(tem); // to protect it PairObj *p = new (*interp_) PairObj(tem, 0); last->setCdr(p); last = p; } result = list; } break; case tokenVector: { VectorObj *v = new (*interp_) VectorObj; ELObjDynamicRoot protect(*interp_, v); Vector &vec = *v; Location ignore; for (;;) { ELObj *tem; if (!parseDatum(allowCloseParen, tem, ignore, tok)) return 0; if (!tem) break; vec.push_back(tem); } result = v; } break; default: break; } return 1; } bool SchemeParser::parseSelfEvaluating(unsigned otherAllowed, ELObj *&result, Token &tok) { Location loc(in_->currentLocation()); if (!getToken(allowExpr|otherAllowed, tok)) return 0; switch (tok) { case tokenTrue: result = interp_->makeTrue(); break; case tokenFalse: result = interp_->makeFalse(); break; case tokenVoid: result = interp_->makeUnspecified(); break; case tokenString: result = new (*interp_) StringObj(currentToken_); break; case tokenKeyword: result = interp_->makeKeyword(currentToken_); break; case tokenChar: result = interp_->makeChar(currentToken_[0]); break; case tokenNumber: result = interp_->convertNumber(currentToken_); if (!result) { message(InterpreterMessages::invalidNumber, StringMessageArg(currentToken_)); result = interp_->makeError(); } break; case tokenGlyphId: if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); return 0; } result = convertAfiiGlyphId(currentToken_); break; default: result = 0; break; } return 1; } bool SchemeParser::parseAbbreviation(const char *sym, ELObj *&result) { SymbolObj *quoteSym = interp_->makeSymbol(Interpreter::makeStringC(sym)); ELObj *obj; Location ignore; Token tok; if (!parseDatum(0, obj, ignore, tok)) return 0; ELObjDynamicRoot protect(*interp_, obj); protect = new (*interp_) PairObj(protect, interp_->makeNil()); result = interp_->makePair(quoteSym, protect); return 1; } bool SchemeParser::getToken(unsigned allowed, Token &tok) { Location loc(in_->currentLocation()); InputSource *in = in_.pointer(); for (;;) { in->startToken(); Xchar c = in->tokenChar(*this); switch (c) { case InputSource::eE: if (!(allowed & allowEndOfEntity)) return tokenRecover(allowed, tok); tok = tokenEndOfEntity; return 1; case '(': if (!(allowed & allowOpenParen)) return tokenRecover(allowed, tok); tok = tokenOpenParen; return 1; case ')': if (!(allowed & allowCloseParen)) return tokenRecover(allowed, tok); tok = tokenCloseParen; return 1; case '\'': if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenQuote; return 1; case '`': if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenQuasiquote; return 1; case ',': c = in->tokenChar(*this); if (c == '@') { if (!(allowed & allowUnquoteSplicing)) return tokenRecover(allowed, tok); tok = tokenUnquoteSplicing; } else { if (!(allowed & allowUnquote)) return tokenRecover(allowed, tok); tok = tokenUnquote; in->endToken(1); } return 1; case ' ': case '\r': case '\n': case '\t': case '\f': // whitespace break; case '#': c = in->tokenChar(*this); switch (c) { case 't': if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenTrue; return 1; case 'f': if (!(allowed & allowFalse)) return tokenRecover(allowed, tok); tok = tokenFalse; return 1; case '\\': { c = in->tokenChar(*this); if (c == InputSource::eE) { message(InterpreterMessages::unexpectedEof); if (allowed & allowEndOfEntity) { tok = tokenEndOfEntity; return 1; } return 0; } if (!(allowed & allowOtherExpr)) { extendToken(); return tokenRecover(allowed, tok); } in->discardInitial(); extendToken(); tok = tokenChar; if (in->currentTokenLength() == 1) { currentToken_.assign(in->currentTokenStart(), 1); } else { StringC tem(in->currentTokenStart(), in->currentTokenLength()); currentToken_.resize(1); if (!interp_->convertCharName(tem, currentToken_[0])) { message(InterpreterMessages::unknownCharName, StringMessageArg(tem)); currentToken_[0] = defaultChar; } } return 1; } case '!': { extendToken(); StringC tem(in->currentTokenStart() + 2, in->currentTokenLength() - 2); if (tem == Interpreter::makeStringC("optional")) { if (!(allowed & allowHashOptional)) return tokenRecover(allowed, tok); tok = tokenHashOptional; return 1; } if (tem == Interpreter::makeStringC("key")) { if (!(allowed & allowHashKey)) return tokenRecover(allowed, tok); tok = tokenHashKey; return 1; } if (tem == Interpreter::makeStringC("rest")) { if (!(allowed & allowHashRest)) return tokenRecover(allowed, tok); tok = tokenHashRest; return 1; } if (tem == Interpreter::makeStringC("contents")) { if (!(allowed & allowHashContents)) return tokenRecover(allowed, tok); tok = tokenHashContents; return 1; } message(InterpreterMessages::unknownNamedConstant, StringMessageArg(tem)); break; } case 'b': case 'o': case 'x': case 'd': extendToken(); if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenNumber; currentToken_.assign(in->currentTokenStart(), in->currentTokenLength()); return 1; case 'A': extendToken(); if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenGlyphId; currentToken_.assign(in->currentTokenStart() + 2, in->currentTokenLength() - 2); if (!interp_->style()) { setNextLocation(loc); message(InterpreterMessages::styleLanguage); } return 1; case InputSource::eE: message(InterpreterMessages::unexpectedEof); if (allowed & allowEndOfEntity) { tok = tokenEndOfEntity; return 1; } return 0; case 'v': if (dsssl2()) { if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenVoid; return 1; } // fall through case '(': if (dsssl2()) { if (!(allowed & allowVector)) return tokenRecover(allowed, tok); tok = tokenVector; return 1; } //fall through default: message(InterpreterMessages::unknownHash); break; } break; case '"': if (!(allowed & allowString)) return tokenRecover(allowed, tok); return scanString(allowed, tok); case ';': skipComment(); break; case '.': extendToken(); switch (in->currentTokenLength()) { case 1: if (!(allowed & allowPeriod)) return tokenRecover(allowed, tok); tok = tokenPeriod; return 1; case 3: if (in_->currentTokenStart()[1] == '.' && in_->currentTokenStart()[2] == '.') return handleIdentifier(allowed, tok); break; } return handleNumber(allowed, tok); default: switch (interp_->lexCategory(c)) { case Interpreter::lexAddWhiteSpace: break; case Interpreter::lexOtherNumberStart: extendToken(); // handle + and - as identifiers if (in->currentTokenLength() == 1) return handleIdentifier(allowed, tok); return handleNumber(allowed, tok); case Interpreter::lexDigit: extendToken(); return handleNumber(allowed, tok); case Interpreter::lexOther: if (c < ' ') { // ignore control characters message(InterpreterMessages::invalidChar); break; } in->ungetToken(); // fall through default: { bool invalid = 0; size_t length = in->currentTokenLength(); for (;;) { Interpreter::LexCategory lc = interp_->lexCategory(in->tokenChar(*this)); if (lc > Interpreter::lexOther) break; if (lc == Interpreter::lexOther) invalid = 1; length++; } in->endToken(length); if (in->currentTokenEnd()[-1] == ':' && in->currentTokenLength() > 1) { if (!(allowed & allowKeyword)) return tokenRecover(allowed, tok); currentToken_.assign(in->currentTokenStart(), in->currentTokenLength() - 1); tok = tokenKeyword; if (invalid || (currentToken_.size() > 1 && currentToken_[currentToken_.size() - 1] == ':')) message(InterpreterMessages::invalidIdentifier, StringMessageArg(currentToken_)); return 1; } if (invalid) message(InterpreterMessages::invalidIdentifier, StringMessageArg(StringC(in->currentTokenStart(), in->currentTokenLength()))); return handleIdentifier(allowed, tok); } } } } } bool SchemeParser::handleNumber(unsigned allowed, Token &tok) { if (!(allowed & allowOtherExpr)) return tokenRecover(allowed, tok); tok = tokenNumber; currentToken_.assign(in_->currentTokenStart(), in_->currentTokenLength()); return 1; } bool SchemeParser::handleIdentifier(unsigned allowed, Token &tok) { if (!(allowed & allowIdentifier)) return tokenRecover(allowed, tok); currentToken_.assign(in_->currentTokenStart(), in_->currentTokenLength()); tok = tokenIdentifier; return 1; } bool SchemeParser::tokenRecover(unsigned allowed, Token &tok) { if (allowed == allowCloseParen) { in_->ungetToken(); tok = tokenCloseParen; message(InterpreterMessages::missingCloseParen); return 1; } if (in_->currentTokenLength() == 0) message(InterpreterMessages::unexpectedEof); else message(InterpreterMessages::unexpectedToken, StringMessageArg(StringC(in_->currentTokenStart(), in_->currentTokenLength()))); return 0; } void SchemeParser::extendToken() { // extend to a delimiter InputSource *in = in_.pointer(); size_t length = in->currentTokenLength(); while (interp_->lexCategory(in->tokenChar(*this)) <= Interpreter::lexOther) length++; in->endToken(length); } bool SchemeParser::scanString(unsigned allowed, Token &tok) { InputSource *in = in_.pointer(); currentToken_.resize(0); for (;;) { Xchar c = in->tokenChar(*this); switch (c) { case InputSource::eE: message(InterpreterMessages::unterminatedString); in->endToken(1); return 0; case '"': tok = tokenString; return 1; case '\\': c = in->tokenChar(*this); if (c == '\\' || c == '"') currentToken_ += c; else if (c == InputSource::eE) break; else { StringC name; name += c; while (interp_->lexCategory(c = in->tokenChar(*this)) < Interpreter::lexDelimiter) name += c; if (c != ';') in->endToken(in->currentTokenLength() - 1); Char ch; if (interp_->convertCharName(name, ch)) currentToken_ += ch; else message(InterpreterMessages::unknownCharName, StringMessageArg(name)); } break; default: currentToken_ += c; break; } } return 0; // not reached } void SchemeParser::skipComment() { for (;;) { Xchar c = in_->get(*this); if (c == InputSource::eE || c == '\r') break; } } ELObj *SchemeParser::convertAfiiGlyphId(const StringC &str) { unsigned long n = 0; for (size_t i = 0; i < str.size(); i++) { if (str[i] < '0' || str[i] > '9') { n = 0; break; } // FIXME check for overflow n = n*10 + (str[i] - '0'); } if (n == 0) { message(InterpreterMessages::invalidAfiiGlyphId, StringMessageArg(str)); return 0; } return new (*interp_) GlyphIdObj(FOTBuilder::GlyphId(afiiPublicId_, n)); } void SchemeParser::dispatchMessage(Message &msg) { interp_->dispatchMessage(msg); } void SchemeParser::dispatchMessage(const Message &msg) { interp_->dispatchMessage(msg); } void SchemeParser::initMessage(Message &msg) { if (in_) msg.loc = in_->currentLocation(); } bool SchemeParser::doDeclareDefaultLanguage() { Location loc(in_->currentLocation()); Owner expr; Token tok; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if(interp_->defaultLanguageSet(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if(defPart == interp_->currentPartIndex()) { interp_->setNextLocation(loc); message(InterpreterMessages::duplicateDefLangDecl, defLoc); } } else interp_->setDefaultLanguage(expr, interp_->currentPartIndex(), loc); return 1; } bool SchemeParser::doDefineLanguage() { Location loc(in_->currentLocation()); Token tok; if (!getToken(allowIdentifier, tok)) return 0; Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (ident->syntacticKey(key) && (key <= int(Identifier::lastSyntacticKey))) message(InterpreterMessages::syntacticKeywordAsVariable, StringMessageArg(currentToken_)); Location defLoc; unsigned defPart; if (ident->defined(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { message(InterpreterMessages::duplicateDefinition, StringMessageArg(ident->name()), defLoc); return 0; } } lang_ = new (*interp_) LangObj; bool hadCollate = 0; bool hadToupper = 0; bool hadTolower = 0; for (;;) { if (!getToken(allowOpenParen|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowIdentifier, tok)) return 0; const Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) return 0; else { switch (key) { case Identifier::keyCollate: if (hadCollate || !doCollate()) return 0; hadCollate = 1; break; case Identifier::keyToupper: if (hadToupper || !doToupper()) return 0; hadToupper = 1; break; case Identifier::keyTolower: if (hadTolower || !doTolower()) return 0; hadTolower = 1; break; default: return 0; } } } if (!lang_->compile()) return 0; interp_->makePermanent(lang_); Owner expr; expr = new ConstantExpression(lang_, in_->currentLocation()); lang_ = 0; ident->setDefinition(expr, interp_->currentPartIndex(), loc); return 1; } bool SchemeParser::doCollate() { Token tok; for (;;) { if (!getToken(allowOpenParen|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowIdentifier, tok)) return 0; const Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) { return 0; } else { switch (key) { case Identifier::keyElement: if (!doMultiCollatingElement()) return 0; break; case Identifier::keySymbol: if (!doCollatingSymbol()) return 0; break; case Identifier::keyOrder: if (!doCollatingOrder()) return 0; break; default: return 0; } } } return 1; } bool SchemeParser::doMultiCollatingElement() { Token tok; if (!getToken(allowIdentifier, tok)) return 0; StringC sym(currentToken_); if (!getToken(allowString, tok)) return 0; StringC str(currentToken_); if (!getToken(allowCloseParen, tok)) return 0; lang_->addMultiCollatingElement(sym, str); return 1; } bool SchemeParser::doCollatingSymbol() { Token tok; if (!getToken(allowIdentifier, tok)) return 0; StringC sym(currentToken_); if (!getToken(allowCloseParen, tok)) return 0; lang_->addCollatingSymbol(sym); return 1; } bool SchemeParser::doCollatingOrder() { Token tok; if (!getToken(allowOpenParen, tok)) return 0; int nested = 0; LangObj::LevelSort sort = { 0, 0, 0}; for (;;) { if (!getToken(((nested == 0) ? allowOpenParen : 0)| allowCloseParen|allowIdentifier, tok)) return 0; if (tok == tokenOpenParen) nested++; else if (tok == tokenCloseParen) nested--; else { const Identifier *ident = lookup(currentToken_); Identifier::SyntacticKey key; if (!ident->syntacticKey(key)) return 0; switch (key) { case Identifier::keyForward: if (sort.backward) return 0; sort.forward = 1; break; case Identifier::keyBackward: if (sort.forward) return 0; sort.backward = 1; break; case Identifier::keyPosition: sort.position = 1; break; default: return 0; } } if (nested < 0) break; if (nested == 0) { if (!sort.backward) sort.forward = 1; lang_->addLevel(sort); } } for (;;) { if (!getToken(allowOpenParen| allowCloseParen| allowIdentifier| allowOtherExpr, tok)) return 0; if (tok == tokenCloseParen) break; StringC empty; switch (tok) { case tokenTrue: lang_->addDefaultPos(); for(Char i = 0; i < lang_->levels(); i++) lang_->addLevelWeight(i, empty); break; case tokenIdentifier: case tokenChar: if (!lang_->addCollatingPos(currentToken_)) return 0; for (unsigned i = 0; i < lang_->levels(); i++) lang_->addLevelWeight(i, currentToken_); break; case tokenOpenParen: if (!doWeights()) return 0; break; default: return 0; } } return 1; } bool SchemeParser::doWeights() { Token tok; if (!getToken(allowIdentifier|allowOtherExpr, tok)) return 0; StringC sym(currentToken_); if (!lang_->addCollatingPos(sym)) return 0; int nested = 0; unsigned l = 0; for (;;) { if (!getToken((nested ? 0 : allowOpenParen)| allowCloseParen| allowIdentifier| allowOtherExpr| allowString, tok)) return 0; if (tok == tokenOpenParen) nested++; else if (tok == tokenCloseParen) nested--; else { switch (tok) { case tokenString: for (size_t i = 0; i < currentToken_.size(); i++) { StringC ctok(&(currentToken_[i]), 1); if (!lang_->addLevelWeight(l, ctok)) return 0; } break; case tokenIdentifier: case tokenChar: if (!lang_->addLevelWeight(l, currentToken_)) return 0; break; default: return 0; } } if (nested < 0) break; if (nested == 0) l++; } return 1; } bool SchemeParser::doToupper() { Token tok; for (;;) { if (!getToken(allowOpenParen|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowOtherExpr, tok) || (tok != tokenChar)) return 0; Char lc = currentToken_[0]; if (!getToken(allowOtherExpr, tok) || (tok != tokenChar)) return 0; Char uc = currentToken_[0]; if (!getToken(allowCloseParen, tok)) return 0; lang_->addToupper(lc, uc); } return 1; } bool SchemeParser::doTolower() { Token tok; for (;;) { if (!getToken(allowOpenParen|allowCloseParen, tok)) return 0; if (tok == tokenCloseParen) break; if (!getToken(allowOtherExpr, tok) || (tok != tokenChar)) return 0; Char uc = currentToken_[0]; if (!getToken(allowOtherExpr, tok) || (tok != tokenChar)) return 0; Char lc = currentToken_[0]; if (!getToken(allowCloseParen, tok)) return 0; lang_->addTolower(uc, lc); } return 1; } bool SchemeParser::parseSpecialQuery(Owner &rexp, const char *query) { Location loc(in_->currentLocation()); interp_->requireFeature(Interpreter::query, loc); Token tok; if (!getToken(allowIdentifier, tok)) return 0; Vector vars; vars.push_back(lookup(currentToken_)); Identifier::SyntacticKey key; if (vars.back()->syntacticKey(key) && key <= int(Identifier::lastSyntacticKey)) message(InterpreterMessages::syntacticKeywordAsVariable, StringMessageArg(currentToken_)); Owner op(new ConstantExpression( interp_->lookup(interp_->makeStringC(query))->computeBuiltinValue(1, *interp_), loc)); NCVector > inits, args(2); Owner expr; if (!parseExpression(0, args[1], key, tok) || !parseExpression(0, expr, key, tok) || !getToken(allowCloseParen, tok)) return 0; args[0] = new LambdaExpression(vars, inits, 0, 0, 0, expr, loc); rexp = new CallExpression(op, args, loc); return 1; } bool SchemeParser::doDeclareCharProperty() { Location loc(in_->currentLocation()); Token tok; if (!getToken(allowIdentifier, tok)) return 0; CharProp *cp = interp_->lookupCharProperty (currentToken_); Owner expr; Identifier::SyntacticKey key; if (!parseExpression(0, expr, key, tok)) return 0; if (!getToken(allowCloseParen, tok)) return 0; Location defLoc; unsigned defPart; if (cp->declared(defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) message(InterpreterMessages::duplicateCharPropertyDecl, StringMessageArg(cp->name()), defLoc); } cp->declare(expr, interp_->currentPartIndex(), loc); return 1; } bool SchemeParser::doAddCharProperties() { Location loc (in_->currentLocation()); NCVector > exprs; Vector cps; Token tok; for (;;) { if (!getToken(allowKeyword|allowOtherExpr, tok)) return 0; if (tok != tokenKeyword) break; cps.push_back(interp_->lookupCharProperty(currentToken_)); exprs.resize(exprs.size() + 1); Identifier::SyntacticKey key; if (!parseExpression(0, exprs.back(), key, tok)) return 0; } StringC chars; for (;;) { if (tok != tokenChar) { message(InterpreterMessages::badAddCharProperty); return 0; } // FIXME: Check duplicates in same decl. Silently remove them or signal // errors? chars += currentToken_[0]; if (!getToken(allowOtherExpr|allowCloseParen, tok)) return 0; if (tok==tokenCloseParen) break; } unsigned defPart; Location defLoc; for (size_t i = 0; i < cps.size(); i++) { StringC chars2; for (size_t j = 0; j < chars.size(); j++) { if (cps[i]->hasAddedValue (chars[j], defPart, defLoc) && defPart <= interp_->currentPartIndex()) { if (defPart == interp_->currentPartIndex()) { message(InterpreterMessages::duplicateAddCharProperty, StringMessageArg(cps[i]->name()), defLoc); } } else chars2 += chars[j]; } if (chars2.size() > 0) cps[i]->setValue(chars2, exprs[i], interp_->currentPartIndex(), loc); } return 1; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/SchemeParser.h0000644000021000000240000001340207067706660013433 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef SchemeParser_INCLUDED #define SchemeParser_INCLUDED 1 #include "Interpreter.h" #include "Expression.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class LangObj; class SchemeParser : public Messenger { public: SchemeParser(Interpreter &, Owner &); void parse(); void parseStandardChars(); void parseMapSdataEntity(const StringC &name, const StringC &text); void parseNameChars(); void parseSeparatorChars(); void parseFeatures(); void parseGrovePlan(); bool parseExpression(Owner &); private: SchemeParser(const SchemeParser &); // undefined void operator=(const SchemeParser &); // undefined enum { allowEndOfEntity = 01, allowFalse = 02, allowKeyword = 04, allowOpenParen = 010, allowCloseParen = 020, allowIdentifier = 040, allowPeriod = 0100, allowOtherExpr = 0200, // number, character, glyph-id, quote, backquote allowExpressionKey = 0400, allowKeyDefine = 01000, allowKeyElse = 02000, allowKeyArrow = 04000, // => allowString = 010000, allowHashOptional = 020000, allowHashKey = 040000, allowHashRest = 0100000, allowUnquote = 0200000, allowUnquoteSplicing = 0400000, allowQuasiquoteKey = 01000000, allowVector = 02000000, allowHashContents = 04000000, allowExpr = (allowFalse|allowKeyword|allowOpenParen|allowIdentifier |allowString|allowHashOptional|allowHashKey|allowHashRest |allowOtherExpr) }; enum Token { tokenEndOfEntity, tokenTrue, tokenFalse, tokenString, tokenIdentifier, tokenKeyword, tokenChar, tokenNumber, tokenGlyphId, tokenOpenParen, tokenCloseParen, tokenPeriod, tokenVector, tokenQuote, tokenQuasiquote, tokenUnquote, tokenUnquoteSplicing, tokenHashRest, tokenHashOptional, tokenHashKey, tokenHashContents, tokenVoid }; bool doDefine(); bool doDefineUnit(); bool doQuery(); bool doElement(); bool doOrElement(); bool doDefault(); bool doId(); bool doRoot(); bool doMode(); bool doDeclareInitialValue(); bool doDeclareCharacteristic(); bool doDeclareCharCharacteristicAndProperty(); bool doDeclareFlowObjectClass(); bool doDeclareClassAttribute(); bool doDeclareIdAttribute(); bool doDeclareFlowObjectMacro(); bool doDeclareDefaultLanguage(); bool doDefineLanguage(); bool doCollate(); bool doMultiCollatingElement(); bool doCollatingSymbol(); bool doCollatingOrder(); bool doWeights(); bool doToupper(); bool doTolower(); bool doDeclareCharProperty(); bool doAddCharProperties(); bool doAssociation(); bool skipForm(); bool parseDefine(Identifier *&, Owner &); bool parseSpecialQuery(Owner &expr, const char *query); bool parseExpression(unsigned allowed, Owner &, Identifier::SyntacticKey &, Token &); bool parseBegin(Owner &expr); bool parseBody(Owner &expr); bool parseSet(Owner &expr); bool parseLambda(Owner &); bool parseLet(Owner &); bool parseLetStar(Owner &); bool parseLetrec(Owner &); bool parseBindingsAndBody(Vector &vars, NCVector > &inits, Owner &body); bool parseBindingsAndBody1(Vector &vars, NCVector > &inits, Owner &body); bool parseQuote(Owner &); bool parseIf(Owner &); bool parseCond(Owner &, bool opt = 0); bool parseCase(Owner &); bool parseOr(Owner &); bool parseAnd(Owner &, bool opt = 0); bool parseMake(Owner &); bool parseStyle(Owner &); bool parseWithMode(Owner &); bool parseFormals(Vector &, NCVector > &, int &, bool &, int &); bool parseDatum(unsigned otherAllowed, ELObj *&, Location &, Token &); bool parseSelfEvaluating(unsigned otherAllowed, ELObj *&, Token &); bool parseAbbreviation(const char *, ELObj *&); bool parseQuasiquote(Owner &); bool parseQuasiquoteTemplate(unsigned level, unsigned allowed, Owner &, Identifier::SyntacticKey &, Token &, bool &spliced); void createQuasiquoteAbbreviation(const char *, Owner &); bool parseRuleBody(Owner &, ProcessingMode::RuleType &); bool parseRuleBody(Owner &, Owner &, ProcessingMode::RuleType &, bool); bool getToken(unsigned, Token &); bool handleNumber(unsigned, Token &); bool handleIdentifier(unsigned, Token &); void extendToken(); bool scanString(); void skipComment(); void skipIntertokenSpace(); bool peekDefine(); bool tokenRecover(unsigned, Token &); bool scanString(unsigned, Token &); ELObj *convertAfiiGlyphId(const StringC &); Identifier *lookup(const StringC &str); ProcessingMode *lookupProcessingMode(const StringC &); void dispatchMessage(Message &); void dispatchMessage(const Message &); void initMessage(Message &msg); bool dsssl2() const; Interpreter *interp_; Owner in_; StringC currentToken_; ProcessingMode *defMode_; const char *afiiPublicId_; bool dsssl2_; LangObj *lang_; }; inline Identifier *SchemeParser::lookup(const StringC &str) { return interp_->lookup(str); } inline ProcessingMode *SchemeParser::lookupProcessingMode(const StringC &name) { return interp_->lookupProcessingMode(name); } inline bool SchemeParser::dsssl2() const { return dsssl2_; } #ifdef DSSSL_NAMESPACE } #endif #endif /* not SchemeParser_INCLUDED */ OpenJade-1.4devel/style/Style.cxx0000644000021000000240000006657007025631172012530 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "Style.h" #include "VM.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "SosofoObj.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif StyleStack::StyleStack() : level_(0) { } void StyleStack::pushContinue(StyleObj *style, const ProcessingMode::Rule *rule, const NodePtr &nodePtr, Messenger *mgr) { StyleObjIter iter; style->appendIter(iter); for (;;) { const VarStyleObj *varStyle; ConstPtr spec(iter.next(varStyle)); if (spec.isNull()) break; size_t ind = spec->index(); if (ind >= inheritedCInfo_.size()) inheritedCInfo_.resize(ind + 1); Ptr &info = inheritedCInfo_[ind]; if (!info.isNull() && info->valLevel == level_) { if (rule) { ASSERT(info->rule != 0); if (rule->compareSpecificity(*info->rule) == 0) { mgr->setNextLocation(info->rule->location()); mgr->message(InterpreterMessages::ambiguousStyle, StringMessageArg(info->spec->identifier()->name()), rule->location()); } } } else { popList_->list.push_back(ind); info = new InheritedCInfo(spec, varStyle, level_, level_, rule, info); } } } void StyleStack::pushEnd(VM &vm, FOTBuilder &fotb) { const PopList *oldPopList = popList_->prev.pointer(); if (oldPopList) { for (size_t i = 0; i < oldPopList->dependingList.size(); i++) { size_t d = oldPopList->dependingList[i]; // d is the index of a characteristic that depends on the actual // value of another characteritistic if (inheritedCInfo_[d]->valLevel != level_) { const Vector &dependencies = inheritedCInfo_[d]->dependencies; bool changed = 0; for (size_t j = 0; j < dependencies.size(); j++) { const InheritedCInfo *p = inheritedCInfo_[dependencies[j]].pointer(); if (p && p->valLevel == level_) { inheritedCInfo_[d] = new InheritedCInfo(inheritedCInfo_[d]->spec, inheritedCInfo_[d]->style, level_, inheritedCInfo_[d]->specLevel, inheritedCInfo_[d]->rule, inheritedCInfo_[d]); popList_->list.push_back(d); changed = 1; break; } } // If it changed, then doing set() on the new value will add // it to the dependingList for this level. if (!changed) popList_->dependingList.push_back(d); } } } vm.styleStack = this; for (size_t i = 0; i < popList_->list.size(); i++) { InheritedCInfo &info = *inheritedCInfo_[popList_->list[i]]; vm.specLevel = info.specLevel; info.spec->set(vm, info.style, fotb, info.cachedValue, info.dependencies); if (info.dependencies.size()) popList_->dependingList.push_back(popList_->list[i]); } vm.styleStack = 0; } void StyleStack::pop() { for (size_t i = 0; i < popList_->list.size(); i++) { size_t ind = popList_->list[i]; ASSERT(inheritedCInfo_[ind]->valLevel == level_); Ptr tem(inheritedCInfo_[ind]->prev); inheritedCInfo_[ind] = tem; } level_--; Ptr tem(popList_->prev); popList_ = tem; } ELObj *StyleStack::inherited(const ConstPtr &ic, unsigned specLevel, Interpreter &interp, Vector &dependencies) { ASSERT(specLevel != unsigned(-1)); size_t ind = ic->index(); ConstPtr spec; const VarStyleObj *style = 0; unsigned newSpecLevel = unsigned(-1); if (ind >= inheritedCInfo_.size()) spec = ic; else { const InheritedCInfo *p = inheritedCInfo_[ind].pointer(); while (p != 0) { if (p->specLevel < specLevel) break; p = p->prev.pointer(); } if (!p) spec = ic; else { if (p->cachedValue) { // We can only use the cached value if none of the values // we depended on changed since we computed it. bool cacheOk = 1; for (size_t i = 0; i < p->dependencies.size(); i++) { size_t d = p->dependencies[i]; if (d < inheritedCInfo_.size() && inheritedCInfo_[d]->valLevel > p->valLevel) { cacheOk = 0; break; } } if (cacheOk) return p->cachedValue; } style = p->style; spec = p->spec; newSpecLevel = p->specLevel; } } VM vm(interp); vm.styleStack = this; vm.specLevel = newSpecLevel; return spec->value(vm, style, dependencies); } ELObj *StyleStack::actual(const ConstPtr &ic, const Location &loc, Interpreter &interp, Vector &dependencies) { size_t ind = ic->index(); for (size_t i = 0; i < dependencies.size(); i++) { if (dependencies[i] == ind) { interp.setNextLocation(loc); interp.message(InterpreterMessages::actualLoop, StringMessageArg(ic->identifier()->name())); return interp.makeError(); } } dependencies.push_back(ind); ConstPtr spec; const VarStyleObj *style = 0; if (ind >= inheritedCInfo_.size()) spec = ic; else { const InheritedCInfo *p = inheritedCInfo_[ind].pointer(); if (!p) spec = ic; else if (p->cachedValue) { const Vector &dep = p->dependencies; for (size_t i = 0; i < dep.size(); i++) dependencies.push_back(dep[i]); return p->cachedValue; } else { style = p->style; spec = p->spec; } } VM vm(interp); vm.styleStack = this; vm.specLevel = level_; return spec->value(vm, style, dependencies); } void StyleStack::trace(Collector &c) const { for (size_t i = 0; i < inheritedCInfo_.size(); i++) { for (const InheritedCInfo *p = inheritedCInfo_[i].pointer(); p; p = p->prev.pointer()) { c.trace(p->style); c.trace(p->cachedValue); } } } InheritedCInfo::InheritedCInfo(const ConstPtr &sp, const VarStyleObj *so, unsigned vl, unsigned sl, const ProcessingMode::Rule *r, const Ptr &p) : spec(sp), style(so), valLevel(vl), specLevel(sl), rule(r), prev(p), cachedValue(0) { } StyleObj *StyleObj::asStyle() { return this; } VarStyleObj::VarStyleObj(const ConstPtr &styleSpec, StyleObj *use, ELObj **display, const NodePtr &node) : styleSpec_(styleSpec), use_(use), display_(display), node_(node) { hasSubObjects_ = 1; } VarStyleObj::~VarStyleObj() { delete [] display_; } void VarStyleObj::traceSubObjects(Collector &c) const { c.trace(use_); if (display_) for (ELObj **pp = display_; *pp; pp++) c.trace(*pp); } void VarStyleObj::appendIterForce(StyleObjIter &iter) const { if (styleSpec_->forceSpecs.size()) iter.append(&styleSpec_->forceSpecs, this); } void VarStyleObj::appendIterNormal(StyleObjIter &iter) const { if (styleSpec_->specs.size()) iter.append(&styleSpec_->specs, this); if (use_) use_->appendIter(iter); } void VarStyleObj::appendIter(StyleObjIter &iter) const { VarStyleObj::appendIterForce(iter); VarStyleObj::appendIterNormal(iter); } OverriddenStyleObj::OverriddenStyleObj(BasicStyleObj *basic, StyleObj *override) : basic_(basic), override_(override) { hasSubObjects_ = 1; } void OverriddenStyleObj::traceSubObjects(Collector &c) const { c.trace(basic_); c.trace(override_); } void OverriddenStyleObj::appendIter(StyleObjIter &iter) const { basic_->appendIterForce(iter); override_->appendIter(iter); basic_->appendIterNormal(iter); } MergeStyleObj::MergeStyleObj() { hasSubObjects_ = 1; } void MergeStyleObj::append(StyleObj *obj) { styles_.push_back(obj); } void MergeStyleObj::appendIter(StyleObjIter &iter) const { for (size_t i = 0; i < styles_.size(); i++) styles_[i]->appendIter(iter); } void MergeStyleObj::traceSubObjects(Collector &c) const { for (size_t i = 0; i < styles_.size(); i++) c.trace(styles_[i]); } ColorObj *ColorObj::asColor() { return this; } DeviceRGBColorObj::DeviceRGBColorObj(unsigned char red, unsigned char green, unsigned char blue) { color_.red = red; color_.green = green; color_.blue = blue; } void DeviceRGBColorObj::set(FOTBuilder &fotb) const { fotb.setColor(color_); } void DeviceRGBColorObj::setBackground(FOTBuilder &fotb) const { fotb.setBackgroundColor(color_); } ColorSpaceObj *ColorSpaceObj::asColorSpace() { return this; } // invert a 3x3 matrix A. result is returned in B // both must be arrays of length 9. static void invert(double *A, double *B) { B[0] = (A[4]*A[8] - A[5]*A[7]); B[3] = - (A[3]*A[8] - A[5]*A[6]); B[6] = (A[3]*A[7] - A[4]*A[6]); B[1] = - (A[1]*A[8] - A[2]*A[7]); B[4] = (A[0]*A[8] - A[2]*A[6]); B[7] = - (A[0]*A[7] - A[1]*A[6]); B[2] = (A[1]*A[5] - A[2]*A[4]); B[5] = - (A[0]*A[5] - A[2]*A[3]); B[8] = (A[0]*A[4] - A[1]*A[3]); double det = A[0]*B[0] + A[1]*B[3] + A[2]*B[6]; if (det < 0.0001) { //FIXME message } B[0] /= det; B[1] /= det; B[2] /= det; B[3] /= det; B[4] /= det; B[5] /= det; B[6] /= det; B[7] /= det; B[8] /= det; } /* FIXME make color handling more flexible: * pass different color types to backends * move the conversion code to a separate class ColorConverter, which could then be used by backends to do the needed conversions. * make phosphors settable * make highlight color for KX settable * whitepoint correction, making the device whitepoint/blackpoint settable for the formulas used here, see: * Computer Graphics, Principles and Practice, Second Edition, Foley, van Damme, Hughes, Addison-Wesley, 1987 * Principles of Color Technology, Second Edition, Fred W. Billmeyer, Jr. and Max Saltzman, John Wiley & Sons, Inc., 1981 * The color faq */ CIEXYZColorSpaceObj::CIEXYZColorSpaceObj(const double *wp, const double *bp) { xyzData_ = new XYZData; for (int i = 0; i < 3; i++) xyzData_->white_[i] = wp[i]; double tmp = wp[0] + 15*wp[1] + 3*wp[2]; xyzData_->white_u = 4*wp[0]/tmp; xyzData_->white_v = 9*wp[1]/tmp; // from the color faq double xr = .64; double yr = .33; double xg = .30; double yg = .60; double xb = .15; double yb = .06; double U[9]; U[0] = xr; U[1] = xg; U[2] = xb; U[3] = yr; U[4] = yg; U[5] = yb; U[6] = 1.0 - xr - yr; U[7] = 1.0 - xg - yg; U[8] = 1.0 - xb - yb; double Uinv[9]; invert(U, Uinv); double C[3]; for (int i = 0; i < 3; i++) C[i] = Uinv[3*i]*wp[0] + Uinv[3*i+1]*wp[1] + Uinv[3*i+2]*wp[2]; double Minv[9]; Minv[0] = U[0]*C[0]; Minv[1] = U[1]*C[1]; Minv[2] = U[2]*C[2]; Minv[3] = U[3]*C[0]; Minv[4] = U[4]*C[1]; Minv[5] = U[5]*C[2]; Minv[6] = U[6]*C[0]; Minv[7] = U[7]*C[1]; Minv[8] = U[8]*C[2]; invert(Minv, xyzData_->M_); } CIEXYZColorSpaceObj::~CIEXYZColorSpaceObj() { delete xyzData_; } ELObj *CIEXYZColorSpaceObj::makeColor (const double *h, Interpreter &interp) { unsigned char c[3]; for (int i = 0; i < 3; i++) c[i] = (unsigned char) ((xyzData_->M_[3*i]*h[0] + xyzData_->M_[3*i+1]*h[1] + xyzData_->M_[3*i+2]*h[2])*255.0 + .5); return new (interp) DeviceRGBColorObj(c[0], c[1], c[2]); } CIELUVColorSpaceObj::CIELUVColorSpaceObj(const double *wp, const double *bp, const double *r) : CIEXYZColorSpaceObj(wp, bp) { luvData_ = new LUVData; for (int i = 0; i < 6; i++) luvData_->range_[i] = r ? r[i] : ((i % 2) ? 1.0 : .0); } CIELUVColorSpaceObj::~CIELUVColorSpaceObj() { delete luvData_; } ELObj *CIELUVColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 3) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("CIE LUV"))); return interp.makeError(); } double d[3]; for (int i = 0; i < 3; i++) { if (!argv[i]->realValue(d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("CIE LUV"))); return interp.makeError(); } if (d[i] < luvData_->range_[2*i] || d[i] > luvData_->range_[2*i+1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE LUV"))); return interp.makeError(); } } double h[3]; if (d[0] == 0.0) { h[0] = h[1] = h[2] = 0.0; } else { if (d[0] <= 7.996968) h[1] = d[0] / 903.0; else { h[1] = (d[0] + 16.0) / 116.0; h[1] = h[1] * h[1] * h[1]; } double uu = d[1] / (13.0 * d[0]) + xyzData_->white_u; double vv = d[2] / (13.0 * d[0]) + xyzData_->white_v; double tmp = 9.0 * h[1] / vv; h[0] = uu * tmp / 4.0; h[2] = (tmp - 15.0 * h[1] - h[0]) / 3.0; } return CIEXYZColorSpaceObj::makeColor(h, interp); } CIELABColorSpaceObj::CIELABColorSpaceObj(const double *wp, const double *bp, const double *r) : CIEXYZColorSpaceObj(wp, bp) { labData_ = new LABData; if (r) for (int i = 0; i < 6; i++) labData_->range_[i] = r[i]; else { labData_->range_[0] = .0; labData_->range_[1] = 100.0; labData_->range_[2] = .0; labData_->range_[3] = 1.0; labData_->range_[4] = .0; labData_->range_[5] = 1.0; } } CIELABColorSpaceObj::~CIELABColorSpaceObj() { delete labData_; } ELObj *CIELABColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 3) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("CIE LAB"))); return interp.makeError(); } double d[3]; for (int i = 0; i < 3; i++) { if (!argv[i]->realValue(d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("CIE LAB"))); return interp.makeError(); } if (d[i] < labData_->range_[2*i] || d[i] > labData_->range_[2*i+1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE LAB"))); return interp.makeError(); } } d[0] /= 100.0; double h[3]; double tmp = (d[0] + 16.0) / 116.0; h[1] = tmp * tmp * tmp; if (h[1] < 0.008856) { tmp = d[0] / 9.03292; h[0] = xyzData_->white_[0] * ((d[1] / 3893.5) + tmp); h[1] = tmp; h[2] = xyzData_->white_[2] * (tmp - (d[2] / 1557.4)); } else { double tmp2 = tmp + (d[1] / 5.0); h[0] = xyzData_->white_[0] * tmp2 * tmp2 * tmp2; tmp2 = tmp - (d[2] / 2.0); h[2] = xyzData_->white_[2] * tmp2 * tmp2 * tmp2; } return CIEXYZColorSpaceObj::makeColor(h, interp); } CIEABCColorSpaceObj::CIEABCColorSpaceObj(const double *wp, const double *bp, const double *rabc, FunctionObj **dabc, const double *mabc, const double *rlmn, FunctionObj **dlmn, const double *mlmn) : CIEXYZColorSpaceObj(wp, bp) { abcData_ = new ABCData; int i; for (i = 0; i < 6; i++) abcData_->rangeAbc_[i] = rabc ? rabc[i] : ((i % 2) ? 1.0 : 0.0); for (i = 0; i < 3; i++) abcData_->decodeAbc_[i] = dabc ? dabc[i] : 0; for (i = 0; i < 9; i++) abcData_->matrixAbc_[i] = mabc ? mabc[i] : ((i % 4) ? 0.0 : 1.0); for (i = 0; i < 6; i++) abcData_->rangeLmn_[i] = rlmn ? rlmn[i] : ((i % 2) ? 1.0 : 0.0); for (i = 0; i < 3; i++) abcData_->decodeLmn_[i] = dlmn ? dlmn[i] : 0; for (i = 0; i < 9; i++) abcData_->matrixLmn_[i] = mlmn ? mlmn[i] : ((i % 4) ? 0.0 : 1.0); } CIEABCColorSpaceObj::~CIEABCColorSpaceObj() { delete abcData_; } void CIEABCColorSpaceObj::traceSubObjects(Collector &c) const { for (int i = 0; i < 3; i++) if (abcData_->decodeAbc_[i]) c.trace(abcData_->decodeAbc_[i]); for (int i = 0; i < 3; i++) if (abcData_->decodeLmn_[i]) c.trace(abcData_->decodeLmn_[i]); } static bool applyFunc(Interpreter &interp, FunctionObj *f, double &d) { InsnPtr insns[2]; insns[1] = f->makeCallInsn(1, interp, Location(), InsnPtr()); insns[0] = InsnPtr(new ConstantInsn(new (interp) RealObj(d),insns[1])); VM vm(interp); ELObj *res = vm.eval(insns[0].pointer()); if (!res || !res->realValue(d)) return 0; return 1; } ELObj *CIEABCColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 3) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } double d[3]; for (int i = 0; i < 3; i++) { if (!argv[i]->realValue(d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } if (d[i] < abcData_->rangeAbc_[2*i] || d[i] > abcData_->rangeAbc_[2*i+1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } if (abcData_->decodeAbc_[i] && !applyFunc(interp, abcData_->decodeAbc_[i], d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorProcResType, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } } double l[3]; for (int i = 0; i < 3; i++) { l[i] = abcData_->matrixAbc_[i]*d[0] + abcData_->matrixAbc_[3+i]*d[1] + abcData_->matrixAbc_[6+i]*d[2]; if (l[i] < abcData_->rangeLmn_[2*i] || l[i] > abcData_->rangeLmn_[2*i+1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } if (abcData_->decodeLmn_[i] && !applyFunc(interp, abcData_->decodeLmn_[i], l[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorProcResType, StringMessageArg(interp.makeStringC("CIE Based ABC"))); return interp.makeError(); } } double h[3]; for (int i = 0; i < 3; i++) h[i] = abcData_->matrixLmn_[i]*l[0] + abcData_->matrixLmn_[3+i]*l[1] + abcData_->matrixLmn_[6+i]*l[2]; return CIEXYZColorSpaceObj::makeColor(h, interp); } CIEAColorSpaceObj::CIEAColorSpaceObj(const double *wp, const double *bp, const double *ra, FunctionObj *da, const double *ma, const double *rlmn, FunctionObj **dlmn, const double *mlmn) : CIEXYZColorSpaceObj(wp, bp) { aData_ = new AData; int i; for (i = 0; i < 2; i++) aData_->rangeA_[i] = ra ? ra[i] : ((i % 2) ? 1.0 : 0.0); aData_->decodeA_ = da ? da : 0; for (i = 0; i < 3; i++) aData_->matrixA_[i] = ma ? ma[i] : 1.0; for (i = 0; i < 6; i++) aData_->rangeLmn_[i] = rlmn ? rlmn[i] : ((i % 2) ? 1.0 : 0.0); for (i = 0; i < 3; i++) aData_->decodeLmn_[i] = dlmn ? dlmn[i] : 0; for (i = 0; i < 9; i++) aData_->matrixLmn_[i] = mlmn ? mlmn[i] : ((i % 4) ? 0.0 : 1.0); } CIEAColorSpaceObj::~CIEAColorSpaceObj() { delete aData_; } void CIEAColorSpaceObj::traceSubObjects(Collector &c) const { if (aData_->decodeA_) c.trace(aData_->decodeA_); for (int i = 0; i < 3; i++) if (aData_->decodeLmn_[i]) c.trace(aData_->decodeLmn_[i]); } ELObj *CIEAColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } double d; if (!argv[0]->realValue(d)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } if (d < aData_->rangeA_[0] || d > aData_->rangeA_[1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } if (aData_->decodeA_ && !applyFunc(interp, aData_->decodeA_, d)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorProcResType, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } double l[3]; for (int i = 0; i < 3; i++) { l[i] = aData_->matrixA_[i]*d; if (l[i] < aData_->rangeLmn_[2*i] || l[i] > aData_->rangeLmn_[2*i+1]) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } if (aData_->decodeLmn_[i] && !applyFunc(interp, aData_->decodeLmn_[i], l[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorProcResType, StringMessageArg(interp.makeStringC("CIE Based A"))); return interp.makeError(); } } double h[3]; for (int i = 0; i < 3; i++) { h[i] = aData_->matrixLmn_[i]*l[0] + aData_->matrixLmn_[3+i]*l[1] + aData_->matrixLmn_[6+i]*l[2]; } return CIEXYZColorSpaceObj::makeColor(h, interp); } ELObj *DeviceRGBColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 3) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("Device RGB"))); return interp.makeError(); } unsigned char c[3]; for (int i = 0; i < 3; i++) { double d; if (!argv[i]->realValue(d)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("Device RGB"))); return interp.makeError(); } if (d < 0.0 || d > 1.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("Device RGB"))); return interp.makeError(); } c[i] = (unsigned char)(d*255.0 + .5); } return new (interp) DeviceRGBColorObj(c[0], c[1], c[2]); } ELObj *DeviceGrayColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("Device Gray"))); return interp.makeError(); } unsigned char c; double d; if (!argv[0]->realValue(d)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("Device Gray"))); return interp.makeError(); } if (d < 0.0 || d > 1.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("Device Gray"))); return interp.makeError(); } c = (unsigned char)(d*255.0 + .5); return new (interp) DeviceRGBColorObj(c, c, c); } #define MIN(x,y) (((x) < (y)) ? (x) : (y)) ELObj *DeviceCMYKColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 4) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("Device CMYK"))); return interp.makeError(); } double d[4]; for (int i = 0; i < 4; i++) { if (!argv[i]->realValue(d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("Device CMYK"))); return interp.makeError(); } if (d[i] < 0.0 || d[i] > 1.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("Device CMYK"))); return interp.makeError(); } } unsigned char c[3]; for (int i = 0; i < 3; i++) c[i] = (unsigned char)((1 - MIN(1, d[i] + d[3]))*255.0 + .5); return new (interp) DeviceRGBColorObj(c[0], c[1], c[2]); } ELObj *DeviceKXColorSpaceObj::makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &loc) { if (argc == 0) return new (interp) DeviceRGBColorObj(0, 0, 0); if (argc != 2) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgCount, StringMessageArg(interp.makeStringC("Device KX"))); return interp.makeError(); } double d[2]; for (int i = 0; i < 2; i++) { if (!argv[i]->realValue(d[i])) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgType, StringMessageArg(interp.makeStringC("Device KX"))); return interp.makeError(); } if (d[i] < 0.0 || d[i] > 1.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorArgRange, StringMessageArg(interp.makeStringC("Device KX"))); return interp.makeError(); } } unsigned char c; c = (unsigned char)((1 - MIN(1, d[0] + d[1]))*255.0 + .5); return new (interp) DeviceRGBColorObj(c, c, c); } VarInheritedC::VarInheritedC(const ConstPtr &ic, const InsnPtr &code, const Location &loc) : InheritedC(ic->identifier(), ic->index()), inheritedC_(ic), code_(code), loc_(loc) { } void VarInheritedC::set(VM &vm, const VarStyleObj *style, FOTBuilder &fotb, ELObj *&cacheObj, Vector &dependencies) const { if (!cacheObj) { EvalContext::CurrentNodeSetter cns(style->node(), 0, vm); vm.actualDependencies = &dependencies; cacheObj = vm.eval(code_.pointer(), style->display()); ASSERT(cacheObj != 0); vm.actualDependencies = 0; } if (!vm.interp->isError(cacheObj)) { ConstPtr c(inheritedC_->make(cacheObj, loc_, *vm.interp)); if (!c.isNull()) c->set(vm, 0, fotb, cacheObj, dependencies); } } ConstPtr VarInheritedC::make(ELObj *obj, const Location &loc, Interpreter &interp) const { return inheritedC_->make(obj, loc, interp); } ELObj *VarInheritedC::value(VM &vm, const VarStyleObj *style, Vector &dependencies) const { EvalContext::CurrentNodeSetter cns(style->node(), 0, vm); vm.actualDependencies = &dependencies; return vm.eval(code_.pointer(), style->display()); } StyleObjIter::StyleObjIter() : i_(0), vi_(0) { } void StyleObjIter::append(const Vector > *v, const VarStyleObj *obj) { styleVec_.push_back(obj); vecs_.push_back(v); } ConstPtr StyleObjIter::next(const VarStyleObj *&style) { for (; vi_ < vecs_.size(); vi_++, i_ = 0) { if (i_ < vecs_[vi_]->size()) { style = styleVec_[vi_]; return (*vecs_[vi_])[i_++]; } } return ConstPtr(); } StyleSpec::StyleSpec(Vector > &fs, Vector > &s) { fs.swap(forceSpecs); s.swap(specs); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/Style.h0000644000021000000240000002442707025631172012150 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef Style_INCLUDED #define Style_INCLUDED 1 #include #include #include #include #include "ELObj.h" #include #include #include #include #include "Insn.h" #include "FOTBuilder.h" #include #include "Node.h" #include #include "ProcessingMode.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class StyleStack; class Interpreter; class VarStyleObj; // InheritedC represents the specification of a value // of an inherited characteristic. // It is also used as a prototype for other specifications of // values for that characteristic: // the identifier for an inherited characteristic contains the // InheritedC that specifies its initial value. class InheritedC : public Resource { public: InheritedC(const Identifier *ident, unsigned index); virtual ~InheritedC(); virtual void set(VM &vm, const VarStyleObj *, FOTBuilder &, ELObj *&, Vector &dependencies) const = 0; virtual ELObj *value(VM &, const VarStyleObj *, Vector &) const = 0; virtual ConstPtr make(ELObj *, const Location &, Interpreter &) const = 0; unsigned index() const; const Identifier *identifier() const; void setIdentifier(const Identifier *); protected: void invalidValue(const Location &, Interpreter &) const; private: const Identifier *ident_; // The index of the inherited characteristic (not the specification). unsigned index_; }; class VarInheritedC : public InheritedC { public: VarInheritedC(const ConstPtr &, const InsnPtr &code, const Location &); void set(VM &, const VarStyleObj *, FOTBuilder &, ELObj *&value, Vector &dependencies) const; ELObj *value(VM &, const VarStyleObj *, Vector &) const; virtual ConstPtr make(ELObj *, const Location &, Interpreter &) const; private: ConstPtr inheritedC_; InsnPtr code_; Location loc_; }; class StyleObjIter { public: StyleObjIter(); void append(const Vector > *, const VarStyleObj *); ConstPtr next(const VarStyleObj *&); private: size_t i_; size_t vi_; Vector styleVec_; Vector > *> vecs_; }; class StyleObj : public ELObj { public: StyleObj *asStyle(); virtual void appendIter(StyleObjIter &) const = 0; }; struct StyleSpec : public Resource { StyleSpec(Vector > &, Vector > &); Vector > forceSpecs; Vector > specs; }; class BasicStyleObj : public StyleObj { public: virtual void appendIterForce(StyleObjIter &) const = 0; virtual void appendIterNormal(StyleObjIter &) const = 0; }; class VarStyleObj : public BasicStyleObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } VarStyleObj(const ConstPtr &, StyleObj *use, ELObj **display, const NodePtr &node); ~VarStyleObj(); void appendIter(StyleObjIter &) const; void appendIterForce(StyleObjIter &) const; void appendIterNormal(StyleObjIter &) const; const NodePtr &node() const; ELObj **display() const; void traceSubObjects(Collector &) const; private: ConstPtr styleSpec_; StyleObj *use_; ELObj **display_; NodePtr node_; }; class OverriddenStyleObj : public StyleObj { public: OverriddenStyleObj(BasicStyleObj *basic, StyleObj *override); void appendIter(StyleObjIter &) const; void traceSubObjects(Collector &) const; private: BasicStyleObj *basic_; StyleObj *override_; }; class MergeStyleObj : public StyleObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } MergeStyleObj(); void append(StyleObj *); void appendIter(StyleObjIter &) const; void traceSubObjects(Collector &) const; private: Vector styles_; }; class ColorObj : public ELObj { public: ColorObj *asColor(); virtual void set(FOTBuilder &) const = 0; virtual void setBackground(FOTBuilder &) const = 0; }; class DeviceRGBColorObj : public ColorObj { public: DeviceRGBColorObj(unsigned char, unsigned char, unsigned char); void set(FOTBuilder &) const; void setBackground(FOTBuilder &) const; private: FOTBuilder::DeviceRGBColor color_; }; class ColorSpaceObj : public ELObj { public: ColorSpaceObj *asColorSpace(); virtual ELObj *makeColor(int argc, ELObj **argv, Interpreter &, const Location &) = 0; }; class DeviceRGBColorSpaceObj : public ColorSpaceObj { public: ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); }; class DeviceGrayColorSpaceObj : public ColorSpaceObj { public: ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); }; class DeviceCMYKColorSpaceObj : public ColorSpaceObj { public: ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); }; class DeviceKXColorSpaceObj : public ColorSpaceObj { public: ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); }; class CIEXYZColorSpaceObj : public ColorSpaceObj { public: CIEXYZColorSpaceObj(const double *, const double *); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ~CIEXYZColorSpaceObj(); ELObj *makeColor(const double *, Interpreter &); protected: struct XYZData { double white_[3]; double white_u; double white_v; double M_[9]; }; XYZData *xyzData_; }; class CIELUVColorSpaceObj : public CIEXYZColorSpaceObj { public: CIELUVColorSpaceObj(const double *, const double *, const double *); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ~CIELUVColorSpaceObj(); ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); private: struct LUVData { double range_[6]; }; LUVData *luvData_; }; class CIELABColorSpaceObj : public CIEXYZColorSpaceObj { public: CIELABColorSpaceObj(const double *, const double *, const double *); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ~CIELABColorSpaceObj(); ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); private: struct LABData { double range_[6]; }; LABData *labData_; }; class CIEABCColorSpaceObj : public CIEXYZColorSpaceObj { public: CIEABCColorSpaceObj(const double *, const double *, const double *, FunctionObj **, const double *, const double *, FunctionObj **, const double *); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ~CIEABCColorSpaceObj(); void traceSubObjects(Collector &) const; ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); private: struct ABCData { double rangeAbc_[6]; FunctionObj *decodeAbc_[3]; double matrixAbc_[9]; double rangeLmn_[6]; FunctionObj *decodeLmn_[3]; double matrixLmn_[9]; }; ABCData *abcData_; }; class CIEAColorSpaceObj : public CIEXYZColorSpaceObj { public: CIEAColorSpaceObj(const double *, const double *, const double *, FunctionObj *, const double *, const double *, FunctionObj **, const double *); void *operator new(size_t, Collector &c) { return c.allocateObject(1); } ~CIEAColorSpaceObj(); void traceSubObjects(Collector &) const; ELObj *makeColor(int argc, ELObj **argv, Interpreter &interp, const Location &); private: struct AData { double rangeA_[2]; FunctionObj *decodeA_; double matrixA_[3]; double rangeLmn_[6]; FunctionObj *decodeLmn_[3]; double matrixLmn_[9]; }; AData *aData_; }; struct InheritedCInfo : public Resource { InheritedCInfo(const ConstPtr &, const VarStyleObj *, unsigned valLevel, unsigned specLevel, const ProcessingMode::Rule *, const Ptr &); ConstPtr spec; Ptr prev; unsigned valLevel; unsigned specLevel; const ProcessingMode::Rule *rule; // If there are dependencies, then the cached value can only // be used only when the "value" flow object is at this level. ELObj *cachedValue; const VarStyleObj *style; // Includes both direct and indirect dependencies. Vector dependencies; }; struct PopList : public Resource { PopList(const Ptr &); Vector list; // List of the indices of those ICs that have dependencies // (ie that use actual-*) directly or indirectly. Vector dependingList; Ptr prev; }; class StyleStack { public: StyleStack(); // These append on to dependencies. ELObj *actual(const ConstPtr &, const Location &, Interpreter &, Vector &dependencies); ELObj *actual(const ConstPtr &, Interpreter &, Vector &dependencies); ELObj *inherited(const ConstPtr &, unsigned specLevel, Interpreter &, Vector &dependencies); void push(StyleObj *, VM &, FOTBuilder &); void pushStart(); void pushContinue(StyleObj *, const ProcessingMode::Rule *, const NodePtr &, Messenger *); void pushEnd(VM &, FOTBuilder &); void pop(); void pushEmpty() { level_++; } void popEmpty() { level_--; } unsigned level() const { return level_; } void trace(Collector &) const; private: Vector > inheritedCInfo_; unsigned level_; Ptr popList_; }; inline PopList::PopList(const Ptr &p) : prev(p) { } inline const Identifier *InheritedC::identifier() const { return ident_; } inline void InheritedC::setIdentifier(const Identifier *ident) { ident_ = ident; } inline unsigned InheritedC::index() const { return index_; } inline ELObj **VarStyleObj::display() const { return display_; } inline const NodePtr &VarStyleObj::node() const { return node_; } inline void StyleStack::pushStart() { level_++; popList_ = new PopList(popList_); } inline void StyleStack::push(StyleObj *style, VM &vm, FOTBuilder &fotb) { pushStart(); pushContinue(style, 0, NodePtr(), 0); pushEnd(vm, fotb); } inline ELObj *StyleStack::actual(const ConstPtr &ic, Interpreter &interp, Vector &dep) { return actual(ic, Location(), interp, dep); } #ifdef DSSSL_NAMESPACE } #endif #endif /* not Style_INCLUDED */ OpenJade-1.4devel/style/StyleEngine.cxx0000644000021000000240000001457107067706664013667 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #include "StyleEngine.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "SchemeParser.h" #include "FOTBuilder.h" #include "DssslSpecEventHandler.h" #include #include "ProcessContext.h" #include #include #include #include #include "DocumentGenerator.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif StyleEngine::StyleEngine(Messenger &mgr, GroveManager &groveManager, int unitsPerInch, bool debugMode, bool dsssl2, bool strictMode, const FOTBuilder::Description &fotbDescr, const CodingSystem *out) : interpreter_(0), mgr_(&mgr), groveManager_(&groveManager), unitsPerInch_(unitsPerInch), debugMode_(debugMode), dsssl2_(dsssl2), strictMode_(strictMode), fotbDescr_(&fotbDescr), outputCodingSystem_(out) { // FIXME: this is super-ugly. We can't construct the Interpreter // right away, since we don't know if its a SL/TL context until // we have parsed the spec. Thus we have to store all constructor // args until then. } void StyleEngine::defineVariable(const StringC &str, StringC &cmdline) { // Dk: Interpret "name=value" as a string variable Setting. if (str[0] == '(') { cmdline += str; } else { int i; for (i = 0; (i < str.size()) && (str[i] != '='); i++) ; // Dk: Not name=value? if (!i || (i >= (str.size()))) { cmdline += interpreter_->makeStringC("(define "); cmdline += str; cmdline += interpreter_->makeStringC(" #t)"); } else { // Dk: name=value. cmdline += interpreter_->makeStringC("(define "); cmdline += StringC(str.begin(), i); cmdline += interpreter_->makeStringC(" \""); if (str.size() - (i + 1) > 0); cmdline += StringC(str.begin() + i + 1, str.size() - (i + 1)); cmdline += interpreter_->makeStringC("\")"); } } } void StyleEngine::parseSpec(SgmlParser &specParser, const CharsetInfo &charset, const StringC &id, Messenger &mgr, const Vector &defVars) { DssslSpecEventHandler specHandler(mgr); Vector parts; specHandler.load(specParser, charset, id, parts); interpreter_ = new Interpreter(groveManager_, mgr_, unitsPerInch_, debugMode_, dsssl2_, parts.size() > 0 ? parts[0]->style() : 1, strictMode_, *fotbDescr_); for (int phase = 0; phase < 3; phase++) { for (size_t i = 0; i < parts.size(); i++) { DssslSpecEventHandler::Part::DIter diter(parts[i]->doc()->diter()); bool local = 0; do { if (local) diter = parts[i]->diter(); local = !local; for (; !diter.done(); diter.next()) { // parse in three phases: // 1. features // 2. char-repertoire, standard-chars, other-chars // 3. the rest if (diter.cur()->type() == DssslSpecEventHandler::DeclarationElement::features ? phase == 0 : ((diter.cur()->type() == DssslSpecEventHandler::DeclarationElement::charRepertoire || diter.cur()->type() == DssslSpecEventHandler::DeclarationElement::standardChars) ? phase == 1 : phase == 2)) { if (diter.cur()->type() == DssslSpecEventHandler::DeclarationElement::sgmlGrovePlan) { Owner in(new InternalInputSource( diter.cur()->modadd(), InputSourceOrigin::make())); SchemeParser scm(*interpreter_, in); scm.parseGrovePlan(); } else { Owner in; diter.cur()->makeInputSource(specHandler, in); SchemeParser scm(*interpreter_, in); switch (diter.cur()->type()) { case DssslSpecEventHandler::DeclarationElement::charRepertoire: interpreter_->setCharRepertoire(diter.cur()->name()); break; case DssslSpecEventHandler::DeclarationElement::standardChars: scm.parseStandardChars(); break; case DssslSpecEventHandler::DeclarationElement::mapSdataEntity: scm.parseMapSdataEntity(diter.cur()->name(), diter.cur()->text()); break; case DssslSpecEventHandler::DeclarationElement::addNameChars: scm.parseNameChars(); break; case DssslSpecEventHandler::DeclarationElement::addSeparatorChars: scm.parseSeparatorChars(); break; case DssslSpecEventHandler::DeclarationElement::features: scm.parseFeatures(); break; default: interpreter_->message( InterpreterMessages::unsupportedDeclaration); break; } } } } } while (local); interpreter_->dEndPart(); } } if (defVars.size() > 0) { StringC cmdline; for (size_t i = 0; i < defVars.size(); i++) defineVariable(defVars[i], cmdline); Owner in(new InternalInputSource(cmdline, InputSourceOrigin::make())); SchemeParser scm(*interpreter_, in); scm.parse(); interpreter_->endPart(); } for (size_t i = 0; i < parts.size(); i++) { for (DssslSpecEventHandler::Part::Iter iter(parts[i]->iter()); !iter.done(); iter.next()) { Owner in; iter.cur()->makeInputSource(specHandler, in); if (in) { SchemeParser scm(*interpreter_, in); scm.parse(); } } interpreter_->endPart(); } } StyleEngine::~StyleEngine() { delete interpreter_; } void StyleEngine::process(const NodePtr &node, FOTBuilder &fotb) { interpreter_->compile(node); if (interpreter_->style()) { ProcessContext context(*interpreter_, fotb); context.process(node); } else { FileOutputByteStream outputFile_; if (outputFile_.open("jade-grove.out")) { DocumentGenerator docgen(interpreter_, new RecordOutputCharStream( new EncodeOutputCharStream(&outputFile_, outputCodingSystem_))); docgen.emit(node); } } } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/StyleEngine.h0000644000021000000240000000264707025631172013276 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef StyleEngine_INCLUDED #define StyleEngine_INCLUDED 1 #include #include "Node.h" #include #include #include "FOTBuilder.h" #include "GroveManager.h" #include "dsssl_ns.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class CodingSystem; #ifdef SP_NAMESPACE } #endif #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Interpreter; class STYLE_API StyleEngine { public: StyleEngine(Messenger &, GroveManager &, int unitsPerInch, bool debugMode, bool dsssl2, bool strictMode, const FOTBuilder::Description &, const CodingSystem *); void parseSpec(SgmlParser &specParser, const CharsetInfo &charset, const StringC &id, Messenger &mgr, const Vector &defVars); void process(const NodePtr &, FOTBuilder &); ~StyleEngine(); private: void defineVariable(const StringC &, StringC &); StyleEngine(const StyleEngine &); // undefined void operator=(const StyleEngine &); // undefined Interpreter *interpreter_; Messenger *mgr_; GroveManager *groveManager_; int unitsPerInch_; bool debugMode_; bool dsssl2_; bool strictMode_; const FOTBuilder::Description *fotbDescr_; const CodingSystem *outputCodingSystem_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not StyleEngine_INCLUDED */ OpenJade-1.4devel/style/VM.h0000644000021000000240000000271307025631172011364 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef VM_INCLUDED #define VM_INCLUDED 1 #include "Collector.h" #include "EvalContext.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class ELObj; class ContinuationObj; class Interpreter; class Insn; class VM : public EvalContext, private Collector::DynamicRoot { public: VM(Interpreter &); VM(EvalContext &, Interpreter &); virtual ~VM(); ELObj **sp; Interpreter *interp; ELObj **closure; ELObj *protectClosure; ELObj **frame; int nActualArgs; Location closureLoc; ELObj *eval(const Insn *, ELObj **display = 0, ELObj *arg = 0); void initStack(); void needStack(int); void pushFrame(const Insn *next, int argsPushed); const Insn *popFrame(); void setClosureArgToCC(); void trace(Collector &) const; Vector modeStack; private: void growStack(int); void init(); void stackTrace(); ELObj **slim; ELObj **sbase; struct ControlStackEntry { int frameSize; // before pushing args ELObj **closure; ELObj *protectClosure; Location closureLoc; ContinuationObj *continuation; const Insn *next; }; ControlStackEntry *csp; ControlStackEntry *csbase; ControlStackEntry *cslim; friend class ContinuationObj; }; inline void VM::needStack(int n) { if (slim - sp < n) growStack(n); } #ifdef DSSSL_NAMESPACE } #endif #endif /* not VM_INCLUDED */ OpenJade-1.4devel/style/charNames.h0000644000021000000240000011042607025631172012744 // Unicode code, character name { 0x000a, "line-feed" }, { 0x000d, "carriage-return" }, { 0x0020, "space" }, { 0x0021, "exclamation-mark" }, { 0x0022, "quotation-mark" }, { 0x0023, "number-sign" }, { 0x0024, "dollar-sign" }, { 0x0025, "percent-sign" }, { 0x0026, "ampersand" }, { 0x0027, "apostrophe" }, { 0x0028, "left-parenthesis" }, { 0x0029, "right-parenthesis" }, { 0x002a, "asterisk" }, { 0x002b, "plus-sign" }, { 0x002c, "comma" }, { 0x002d, "hyphen-minus" }, { 0x002e, "full-stop" }, { 0x002f, "solidus" }, { 0x0030, "digit-zero" }, { 0x0031, "digit-one" }, { 0x0032, "digit-two" }, { 0x0033, "digit-three" }, { 0x0034, "digit-four" }, { 0x0035, "digit-five" }, { 0x0036, "digit-six" }, { 0x0037, "digit-seven" }, { 0x0038, "digit-eight" }, { 0x0039, "digit-nine" }, { 0x003a, "colon" }, { 0x003b, "semicolon" }, { 0x003c, "less-than-sign" }, { 0x003d, "equals-sign" }, { 0x003e, "greater-than-sign" }, { 0x003f, "question-mark" }, { 0x0040, "commercial-at" }, { 0x0041, "latin-capital-letter-a" }, { 0x0042, "latin-capital-letter-b" }, { 0x0043, "latin-capital-letter-c" }, { 0x0044, "latin-capital-letter-d" }, { 0x0045, "latin-capital-letter-e" }, { 0x0046, "latin-capital-letter-f" }, { 0x0047, "latin-capital-letter-g" }, { 0x0048, "latin-capital-letter-h" }, { 0x0049, "latin-capital-letter-i" }, { 0x004a, "latin-capital-letter-j" }, { 0x004b, "latin-capital-letter-k" }, { 0x004c, "latin-capital-letter-l" }, { 0x004d, "latin-capital-letter-m" }, { 0x004e, "latin-capital-letter-n" }, { 0x004f, "latin-capital-letter-o" }, { 0x0050, "latin-capital-letter-p" }, { 0x0051, "latin-capital-letter-q" }, { 0x0052, "latin-capital-letter-r" }, { 0x0053, "latin-capital-letter-s" }, { 0x0054, "latin-capital-letter-t" }, { 0x0055, "latin-capital-letter-u" }, { 0x0056, "latin-capital-letter-v" }, { 0x0057, "latin-capital-letter-w" }, { 0x0058, "latin-capital-letter-x" }, { 0x0059, "latin-capital-letter-y" }, { 0x005a, "latin-capital-letter-z" }, { 0x005b, "left-square-bracket" }, { 0x005c, "reverse-solidus" }, { 0x005d, "right-square-bracket" }, { 0x005e, "circumflex-accent" }, { 0x005f, "low-line" }, { 0x0060, "grave-accent" }, { 0x0061, "latin-small-letter-a" }, { 0x0062, "latin-small-letter-b" }, { 0x0063, "latin-small-letter-c" }, { 0x0064, "latin-small-letter-d" }, { 0x0065, "latin-small-letter-e" }, { 0x0066, "latin-small-letter-f" }, { 0x0067, "latin-small-letter-g" }, { 0x0068, "latin-small-letter-h" }, { 0x0069, "latin-small-letter-i" }, { 0x006a, "latin-small-letter-j" }, { 0x006b, "latin-small-letter-k" }, { 0x006c, "latin-small-letter-l" }, { 0x006d, "latin-small-letter-m" }, { 0x006e, "latin-small-letter-n" }, { 0x006f, "latin-small-letter-o" }, { 0x0070, "latin-small-letter-p" }, { 0x0071, "latin-small-letter-q" }, { 0x0072, "latin-small-letter-r" }, { 0x0073, "latin-small-letter-s" }, { 0x0074, "latin-small-letter-t" }, { 0x0075, "latin-small-letter-u" }, { 0x0076, "latin-small-letter-v" }, { 0x0077, "latin-small-letter-w" }, { 0x0078, "latin-small-letter-x" }, { 0x0079, "latin-small-letter-y" }, { 0x007a, "latin-small-letter-z" }, { 0x007b, "left-curly-bracket" }, { 0x007c, "vertical-line" }, { 0x007d, "right-curly-bracket" }, { 0x007e, "tilde" }, { 0x00a0, "no-break-space" }, { 0x00a1, "inverted-exclamation-mark" }, { 0x00a2, "cent-sign" }, { 0x00a3, "pound-sign" }, { 0x00a4, "currency-sign" }, { 0x00a5, "yen-sign" }, { 0x00a6, "broken-bar" }, { 0x00a7, "section-sign" }, { 0x00a8, "diaeresis" }, { 0x00a9, "copyright-sign" }, { 0x00aa, "feminine-ordinal-indicator" }, { 0x00ab, "left-pointing-double-angle-quotation-mark" }, { 0x00ac, "not-sign" }, { 0x00ad, "soft-hyphen" }, { 0x00ae, "registered-sign" }, { 0x00af, "macron" }, { 0x00b0, "degree-sign" }, { 0x00b1, "plus-minus-sign" }, { 0x00b2, "superscript-two" }, { 0x00b3, "superscript-three" }, { 0x00b4, "acute-accent" }, { 0x00b5, "micro-sign" }, { 0x00b6, "pilcrow-sign" }, { 0x00b7, "middle-dot" }, { 0x00b8, "cedilla" }, { 0x00b9, "superscript-one" }, { 0x00ba, "masculine-ordinal-indicator" }, { 0x00bb, "right-pointing-double-angle-quotation-mark" }, { 0x00bc, "vulgar-fraction-one-quarter" }, { 0x00bd, "vulgar-fraction-one-half" }, { 0x00be, "vulgar-fraction-three-quarters" }, { 0x00bf, "inverted-question-mark" }, { 0x00c0, "latin-capital-letter-a-with-grave" }, { 0x00c1, "latin-capital-letter-a-with-acute" }, { 0x00c2, "latin-capital-letter-a-with-circumflex" }, { 0x00c3, "latin-capital-letter-a-with-tilde" }, { 0x00c4, "latin-capital-letter-a-with-diaeresis" }, { 0x00c5, "latin-capital-letter-a-with-ring-above" }, { 0x00c6, "latin-capital-letter-ae" }, { 0x00c7, "latin-capital-letter-c-with-cedilla" }, { 0x00c8, "latin-capital-letter-e-with-grave" }, { 0x00c9, "latin-capital-letter-e-with-acute" }, { 0x00ca, "latin-capital-letter-e-with-circumflex" }, { 0x00cb, "latin-capital-letter-e-with-diaeresis" }, { 0x00cc, "latin-capital-letter-i-with-grave" }, { 0x00cd, "latin-capital-letter-i-with-acute" }, { 0x00ce, "latin-capital-letter-i-with-circumflex" }, { 0x00cf, "latin-capital-letter-i-with-diaeresis" }, { 0x00d0, "latin-capital-letter-eth" }, { 0x00d1, "latin-capital-letter-n-with-tilde" }, { 0x00d2, "latin-capital-letter-o-with-grave" }, { 0x00d3, "latin-capital-letter-o-with-acute" }, { 0x00d4, "latin-capital-letter-o-with-circumflex" }, { 0x00d5, "latin-capital-letter-o-with-tilde" }, { 0x00d6, "latin-capital-letter-o-with-diaeresis" }, { 0x00d7, "multiplication-sign" }, { 0x00d8, "latin-capital-letter-o-with-stroke" }, { 0x00d9, "latin-capital-letter-u-with-grave" }, { 0x00da, "latin-capital-letter-u-with-acute" }, { 0x00db, "latin-capital-letter-u-with-circumflex" }, { 0x00dc, "latin-capital-letter-u-with-diaeresis" }, { 0x00dd, "latin-capital-letter-y-with-acute" }, { 0x00de, "latin-capital-letter-thorn" }, { 0x00df, "latin-small-letter-sharp-s" }, { 0x00e0, "latin-small-letter-a-with-grave" }, { 0x00e1, "latin-small-letter-a-with-acute" }, { 0x00e2, "latin-small-letter-a-with-circumflex" }, { 0x00e3, "latin-small-letter-a-with-tilde" }, { 0x00e4, "latin-small-letter-a-with-diaeresis" }, { 0x00e5, "latin-small-letter-a-with-ring-above" }, { 0x00e6, "latin-small-letter-ae" }, { 0x00e7, "latin-small-letter-c-with-cedilla" }, { 0x00e8, "latin-small-letter-e-with-grave" }, { 0x00e9, "latin-small-letter-e-with-acute" }, { 0x00ea, "latin-small-letter-e-with-circumflex" }, { 0x00eb, "latin-small-letter-e-with-diaeresis" }, { 0x00ec, "latin-small-letter-i-with-grave" }, { 0x00ed, "latin-small-letter-i-with-acute" }, { 0x00ee, "latin-small-letter-i-with-circumflex" }, { 0x00ef, "latin-small-letter-i-with-diaeresis" }, { 0x00f0, "latin-small-letter-eth" }, { 0x00f1, "latin-small-letter-n-with-tilde" }, { 0x00f2, "latin-small-letter-o-with-grave" }, { 0x00f3, "latin-small-letter-o-with-acute" }, { 0x00f4, "latin-small-letter-o-with-circumflex" }, { 0x00f5, "latin-small-letter-o-with-tilde" }, { 0x00f6, "latin-small-letter-o-with-diaeresis" }, { 0x00f7, "division-sign" }, { 0x00f8, "latin-small-letter-o-with-stroke" }, { 0x00f9, "latin-small-letter-u-with-grave" }, { 0x00fa, "latin-small-letter-u-with-acute" }, { 0x00fb, "latin-small-letter-u-with-circumflex" }, { 0x00fc, "latin-small-letter-u-with-diaeresis" }, { 0x00fd, "latin-small-letter-y-with-acute" }, { 0x00fe, "latin-small-letter-thorn" }, { 0x00ff, "latin-small-letter-y-with-diaeresis" }, { 0x0100, "latin-capital-letter-a-with-macron" }, { 0x0101, "latin-small-letter-a-with-macron" }, { 0x0102, "latin-capital-letter-a-with-breve" }, { 0x0103, "latin-small-letter-a-with-breve" }, { 0x0104, "latin-capital-letter-a-with-ogonek" }, { 0x0105, "latin-small-letter-a-with-ogonek" }, { 0x0106, "latin-capital-letter-c-with-acute" }, { 0x0107, "latin-small-letter-c-with-acute" }, { 0x0108, "latin-capital-letter-c-with-circumflex" }, { 0x0109, "latin-small-letter-c-with-circumflex" }, { 0x010a, "latin-capital-letter-c-with-dot-above" }, { 0x010b, "latin-small-letter-c-with-dot-above" }, { 0x010c, "latin-capital-letter-c-with-caron" }, { 0x010d, "latin-small-letter-c-with-caron" }, { 0x010e, "latin-capital-letter-d-with-caron" }, { 0x010f, "latin-small-letter-d-with-caron" }, { 0x0110, "latin-capital-letter-d-with-stroke" }, { 0x0111, "latin-small-letter-d-with-stroke" }, { 0x0112, "latin-capital-letter-e-with-macron" }, { 0x0113, "latin-small-letter-e-with-macron" }, { 0x0114, "latin-capital-letter-e-with-breve" }, { 0x0115, "latin-small-letter-e-with-breve" }, { 0x0116, "latin-capital-letter-e-with-dot-above" }, { 0x0117, "latin-small-letter-e-with-dot-above" }, { 0x0118, "latin-capital-letter-e-with-ogonek" }, { 0x0119, "latin-small-letter-e-with-ogonek" }, { 0x011a, "latin-capital-letter-e-with-caron" }, { 0x011b, "latin-small-letter-e-with-caron" }, { 0x011c, "latin-capital-letter-g-with-circumflex" }, { 0x011d, "latin-small-letter-g-with-circumflex" }, { 0x011e, "latin-capital-letter-g-with-breve" }, { 0x011f, "latin-small-letter-g-with-breve" }, { 0x0120, "latin-capital-letter-g-with-dot-above" }, { 0x0121, "latin-small-letter-g-with-dot-above" }, { 0x0122, "latin-capital-letter-g-with-cedilla" }, { 0x0123, "latin-small-letter-g-with-cedilla" }, { 0x0124, "latin-capital-letter-h-with-circumflex" }, { 0x0125, "latin-small-letter-h-with-circumflex" }, { 0x0126, "latin-capital-letter-h-with-stroke" }, { 0x0127, "latin-small-letter-h-with-stroke" }, { 0x0128, "latin-capital-letter-i-with-tilde" }, { 0x0129, "latin-small-letter-i-with-tilde" }, { 0x012a, "latin-capital-letter-i-with-macron" }, { 0x012b, "latin-small-letter-i-with-macron" }, { 0x012c, "latin-capital-letter-i-with-breve" }, { 0x012d, "latin-small-letter-i-with-breve" }, { 0x012e, "latin-capital-letter-i-with-ogonek" }, { 0x012f, "latin-small-letter-i-with-ogonek" }, { 0x0130, "latin-capital-letter-i-with-dot-above" }, { 0x0131, "latin-small-letter-dotless-i" }, { 0x0132, "latin-capital-ligature-ij" }, { 0x0133, "latin-small-ligature-ij" }, { 0x0134, "latin-capital-letter-j-with-circumflex" }, { 0x0135, "latin-small-letter-j-with-circumflex" }, { 0x0136, "latin-capital-letter-k-with-cedilla" }, { 0x0137, "latin-small-letter-k-with-cedilla" }, { 0x0138, "latin-small-letter-kra" }, { 0x0139, "latin-capital-letter-l-with-acute" }, { 0x013a, "latin-small-letter-l-with-acute" }, { 0x013b, "latin-capital-letter-l-with-cedilla" }, { 0x013c, "latin-small-letter-l-with-cedilla" }, { 0x013d, "latin-capital-letter-l-with-caron" }, { 0x013e, "latin-small-letter-l-with-caron" }, { 0x013f, "latin-capital-letter-l-with-middle-dot" }, { 0x0140, "latin-small-letter-l-with-middle-dot" }, { 0x0141, "latin-capital-letter-l-with-stroke" }, { 0x0142, "latin-small-letter-l-with-stroke" }, { 0x0143, "latin-capital-letter-n-with-acute" }, { 0x0144, "latin-small-letter-n-with-acute" }, { 0x0145, "latin-capital-letter-n-with-cedilla" }, { 0x0146, "latin-small-letter-n-with-cedilla" }, { 0x0147, "latin-capital-letter-n-with-caron" }, { 0x0148, "latin-small-letter-n-with-caron" }, { 0x0149, "latin-small-letter-n-preceded-by-apostrophe" }, { 0x014a, "latin-capital-letter-eng" }, { 0x014b, "latin-small-letter-eng" }, { 0x014c, "latin-capital-letter-o-with-macron" }, { 0x014d, "latin-small-letter-o-with-macron" }, { 0x014e, "latin-capital-letter-o-with-breve" }, { 0x014f, "latin-small-letter-o-with-breve" }, { 0x0150, "latin-capital-letter-o-with-double-acute" }, { 0x0151, "latin-small-letter-o-with-double-acute" }, { 0x0152, "latin-capital-ligature-oe" }, { 0x0153, "latin-small-ligature-oe" }, { 0x0154, "latin-capital-letter-r-with-acute" }, { 0x0155, "latin-small-letter-r-with-acute" }, { 0x0156, "latin-capital-letter-r-with-cedilla" }, { 0x0157, "latin-small-letter-r-with-cedilla" }, { 0x0158, "latin-capital-letter-r-with-caron" }, { 0x0159, "latin-small-letter-r-with-caron" }, { 0x015a, "latin-capital-letter-s-with-acute" }, { 0x015b, "latin-small-letter-s-with-acute" }, { 0x015c, "latin-capital-letter-s-with-circumflex" }, { 0x015d, "latin-small-letter-s-with-circumflex" }, { 0x015e, "latin-capital-letter-s-with-cedilla" }, { 0x015f, "latin-small-letter-s-with-cedilla" }, { 0x0160, "latin-capital-letter-s-with-caron" }, { 0x0161, "latin-small-letter-s-with-caron" }, { 0x0162, "latin-capital-letter-t-with-cedilla" }, { 0x0163, "latin-small-letter-t-with-cedilla" }, { 0x0164, "latin-capital-letter-t-with-caron" }, { 0x0165, "latin-small-letter-t-with-caron" }, { 0x0166, "latin-capital-letter-t-with-stroke" }, { 0x0167, "latin-small-letter-t-with-stroke" }, { 0x0168, "latin-capital-letter-u-with-tilde" }, { 0x0169, "latin-small-letter-u-with-tilde" }, { 0x016a, "latin-capital-letter-u-with-macron" }, { 0x016b, "latin-small-letter-u-with-macron" }, { 0x016c, "latin-capital-letter-u-with-breve" }, { 0x016d, "latin-small-letter-u-with-breve" }, { 0x016e, "latin-capital-letter-u-with-ring-above" }, { 0x016f, "latin-small-letter-u-with-ring-above" }, { 0x0170, "latin-capital-letter-u-with-double-acute" }, { 0x0171, "latin-small-letter-u-with-double-acute" }, { 0x0172, "latin-capital-letter-u-with-ogonek" }, { 0x0173, "latin-small-letter-u-with-ogonek" }, { 0x0174, "latin-capital-letter-w-with-circumflex" }, { 0x0175, "latin-small-letter-w-with-circumflex" }, { 0x0176, "latin-capital-letter-y-with-circumflex" }, { 0x0177, "latin-small-letter-y-with-circumflex" }, { 0x0178, "latin-capital-letter-y-with-diaeresis" }, { 0x0179, "latin-capital-letter-z-with-acute" }, { 0x017a, "latin-small-letter-z-with-acute" }, { 0x017b, "latin-capital-letter-z-with-dot-above" }, { 0x017c, "latin-small-letter-z-with-dot-above" }, { 0x017d, "latin-capital-letter-z-with-caron" }, { 0x017e, "latin-small-letter-z-with-caron" }, { 0x017f, "latin-small-letter-long-s" }, { 0x0192, "latin-small-letter-f-with-hook" }, { 0x01fa, "latin-capital-letter-a-with-ring-above-and-acute" }, { 0x01fb, "latin-small-letter-a-with-ring-above-and-acute" }, { 0x01fc, "latin-capital-letter-ae-with-acute" }, { 0x01fd, "latin-small-letter-ae-with-acute" }, { 0x01fe, "latin-capital-letter-o-with-stroke-and-acute" }, { 0x01ff, "latin-small-letter-o-with-stroke-and-acute" }, { 0x02c6, "modifier-letter-circumflex-accent" }, { 0x02c7, "caron" }, { 0x02c9, "modifier-letter-macron" }, { 0x02d8, "breve" }, { 0x02d9, "dot-above" }, { 0x02da, "ring-above" }, { 0x02db, "ogonek" }, { 0x02dc, "small-tilde" }, { 0x02dd, "double-acute-accent" }, { 0x0384, "greek-tonos" }, { 0x0385, "greek-dialytika-tonos" }, { 0x0386, "greek-capital-letter-alpha-with-tonos" }, { 0x0387, "greek-ano-teleia" }, { 0x0388, "greek-capital-letter-epsilon-with-tonos" }, { 0x0389, "greek-capital-letter-eta-with-tonos" }, { 0x038a, "greek-capital-letter-iota-with-tonos" }, { 0x038c, "greek-capital-letter-omicron-with-tonos" }, { 0x038e, "greek-capital-letter-upsilon-with-tonos" }, { 0x038f, "greek-capital-letter-omega-with-tonos" }, { 0x0390, "greek-small-letter-iota-with-dialytika-and-tonos" }, { 0x0391, "greek-capital-letter-alpha" }, { 0x0392, "greek-capital-letter-beta" }, { 0x0393, "greek-capital-letter-gamma" }, { 0x0394, "greek-capital-letter-delta" }, { 0x0395, "greek-capital-letter-epsilon" }, { 0x0396, "greek-capital-letter-zeta" }, { 0x0397, "greek-capital-letter-eta" }, { 0x0398, "greek-capital-letter-theta" }, { 0x0399, "greek-capital-letter-iota" }, { 0x039a, "greek-capital-letter-kappa" }, { 0x039b, "greek-capital-letter-lamda" }, { 0x039c, "greek-capital-letter-mu" }, { 0x039d, "greek-capital-letter-nu" }, { 0x039e, "greek-capital-letter-xi" }, { 0x039f, "greek-capital-letter-omicron" }, { 0x03a0, "greek-capital-letter-pi" }, { 0x03a1, "greek-capital-letter-rho" }, { 0x03a3, "greek-capital-letter-sigma" }, { 0x03a4, "greek-capital-letter-tau" }, { 0x03a5, "greek-capital-letter-upsilon" }, { 0x03a6, "greek-capital-letter-phi" }, { 0x03a7, "greek-capital-letter-chi" }, { 0x03a8, "greek-capital-letter-psi" }, { 0x03a9, "greek-capital-letter-omega" }, { 0x03aa, "greek-capital-letter-iota-with-dialytika" }, { 0x03ab, "greek-capital-letter-upsilon-with-dialytika" }, { 0x03ac, "greek-small-letter-alpha-with-tonos" }, { 0x03ad, "greek-small-letter-epsilon-with-tonos" }, { 0x03ae, "greek-small-letter-eta-with-tonos" }, { 0x03af, "greek-small-letter-iota-with-tonos" }, { 0x03b0, "greek-small-letter-upsilon-with-dialytika-and-tonos" }, { 0x03b1, "greek-small-letter-alpha" }, { 0x03b2, "greek-small-letter-beta" }, { 0x03b3, "greek-small-letter-gamma" }, { 0x03b4, "greek-small-letter-delta" }, { 0x03b5, "greek-small-letter-epsilon" }, { 0x03b6, "greek-small-letter-zeta" }, { 0x03b7, "greek-small-letter-eta" }, { 0x03b8, "greek-small-letter-theta" }, { 0x03b9, "greek-small-letter-iota" }, { 0x03ba, "greek-small-letter-kappa" }, { 0x03bb, "greek-small-letter-lamda" }, { 0x03bc, "greek-small-letter-mu" }, { 0x03bd, "greek-small-letter-nu" }, { 0x03be, "greek-small-letter-xi" }, { 0x03bf, "greek-small-letter-omicron" }, { 0x03c0, "greek-small-letter-pi" }, { 0x03c1, "greek-small-letter-rho" }, { 0x03c2, "greek-small-letter-final-sigma" }, { 0x03c3, "greek-small-letter-sigma" }, { 0x03c4, "greek-small-letter-tau" }, { 0x03c5, "greek-small-letter-upsilon" }, { 0x03c6, "greek-small-letter-phi" }, { 0x03c7, "greek-small-letter-chi" }, { 0x03c8, "greek-small-letter-psi" }, { 0x03c9, "greek-small-letter-omega" }, { 0x03ca, "greek-small-letter-iota-with-dialytika" }, { 0x03cb, "greek-small-letter-upsilon-with-dialytika" }, { 0x03cc, "greek-small-letter-omicron-with-tonos" }, { 0x03cd, "greek-small-letter-upsilon-with-tonos" }, { 0x03ce, "greek-small-letter-omega-with-tonos" }, { 0x03d1, "greek-theta-symbol" }, { 0x03d2, "greek-upsilon-with-hook-symbol" }, { 0x03d5, "greek-phi-symbol" }, { 0x03d6, "greek-pi-symbol" }, { 0x0401, "cyrillic-capital-letter-io" }, { 0x0402, "cyrillic-capital-letter-dje" }, { 0x0403, "cyrillic-capital-letter-gje" }, { 0x0404, "cyrillic-capital-letter-ukrainian-ie" }, { 0x0405, "cyrillic-capital-letter-dze" }, { 0x0406, "cyrillic-capital-letter-byelorussian-ukrainian-i" }, { 0x0407, "cyrillic-capital-letter-yi" }, { 0x0408, "cyrillic-capital-letter-je" }, { 0x0409, "cyrillic-capital-letter-lje" }, { 0x040a, "cyrillic-capital-letter-nje" }, { 0x040b, "cyrillic-capital-letter-tshe" }, { 0x040c, "cyrillic-capital-letter-kje" }, { 0x040e, "cyrillic-capital-letter-short-u" }, { 0x040f, "cyrillic-capital-letter-dzhe" }, { 0x0410, "cyrillic-capital-letter-a" }, { 0x0411, "cyrillic-capital-letter-be" }, { 0x0412, "cyrillic-capital-letter-ve" }, { 0x0413, "cyrillic-capital-letter-ghe" }, { 0x0414, "cyrillic-capital-letter-de" }, { 0x0415, "cyrillic-capital-letter-ie" }, { 0x0416, "cyrillic-capital-letter-zhe" }, { 0x0417, "cyrillic-capital-letter-ze" }, { 0x0418, "cyrillic-capital-letter-i" }, { 0x0419, "cyrillic-capital-letter-short-i" }, { 0x041a, "cyrillic-capital-letter-ka" }, { 0x041b, "cyrillic-capital-letter-el" }, { 0x041c, "cyrillic-capital-letter-em" }, { 0x041d, "cyrillic-capital-letter-en" }, { 0x041e, "cyrillic-capital-letter-o" }, { 0x041f, "cyrillic-capital-letter-pe" }, { 0x0420, "cyrillic-capital-letter-er" }, { 0x0421, "cyrillic-capital-letter-es" }, { 0x0422, "cyrillic-capital-letter-te" }, { 0x0423, "cyrillic-capital-letter-u" }, { 0x0424, "cyrillic-capital-letter-ef" }, { 0x0425, "cyrillic-capital-letter-ha" }, { 0x0426, "cyrillic-capital-letter-tse" }, { 0x0427, "cyrillic-capital-letter-che" }, { 0x0428, "cyrillic-capital-letter-sha" }, { 0x0429, "cyrillic-capital-letter-shcha" }, { 0x042a, "cyrillic-capital-letter-hard-sign" }, { 0x042b, "cyrillic-capital-letter-yeru" }, { 0x042c, "cyrillic-capital-letter-soft-sign" }, { 0x042d, "cyrillic-capital-letter-e" }, { 0x042e, "cyrillic-capital-letter-yu" }, { 0x042f, "cyrillic-capital-letter-ya" }, { 0x0430, "cyrillic-small-letter-a" }, { 0x0431, "cyrillic-small-letter-be" }, { 0x0432, "cyrillic-small-letter-ve" }, { 0x0433, "cyrillic-small-letter-ghe" }, { 0x0434, "cyrillic-small-letter-de" }, { 0x0435, "cyrillic-small-letter-ie" }, { 0x0436, "cyrillic-small-letter-zhe" }, { 0x0437, "cyrillic-small-letter-ze" }, { 0x0438, "cyrillic-small-letter-i" }, { 0x0439, "cyrillic-small-letter-short-i" }, { 0x043a, "cyrillic-small-letter-ka" }, { 0x043b, "cyrillic-small-letter-el" }, { 0x043c, "cyrillic-small-letter-em" }, { 0x043d, "cyrillic-small-letter-en" }, { 0x043e, "cyrillic-small-letter-o" }, { 0x043f, "cyrillic-small-letter-pe" }, { 0x0440, "cyrillic-small-letter-er" }, { 0x0441, "cyrillic-small-letter-es" }, { 0x0442, "cyrillic-small-letter-te" }, { 0x0443, "cyrillic-small-letter-u" }, { 0x0444, "cyrillic-small-letter-ef" }, { 0x0445, "cyrillic-small-letter-ha" }, { 0x0446, "cyrillic-small-letter-tse" }, { 0x0447, "cyrillic-small-letter-che" }, { 0x0448, "cyrillic-small-letter-sha" }, { 0x0449, "cyrillic-small-letter-shcha" }, { 0x044a, "cyrillic-small-letter-hard-sign" }, { 0x044b, "cyrillic-small-letter-yeru" }, { 0x044c, "cyrillic-small-letter-soft-sign" }, { 0x044d, "cyrillic-small-letter-e" }, { 0x044e, "cyrillic-small-letter-yu" }, { 0x044f, "cyrillic-small-letter-ya" }, { 0x0451, "cyrillic-small-letter-io" }, { 0x0452, "cyrillic-small-letter-dje" }, { 0x0453, "cyrillic-small-letter-gje" }, { 0x0454, "cyrillic-small-letter-ukrainian-ie" }, { 0x0455, "cyrillic-small-letter-dze" }, { 0x0456, "cyrillic-small-letter-byelorussian-ukrainian-i" }, { 0x0457, "cyrillic-small-letter-yi" }, { 0x0458, "cyrillic-small-letter-je" }, { 0x0459, "cyrillic-small-letter-lje" }, { 0x045a, "cyrillic-small-letter-nje" }, { 0x045b, "cyrillic-small-letter-tshe" }, { 0x045c, "cyrillic-small-letter-kje" }, { 0x045e, "cyrillic-small-letter-short-u" }, { 0x045f, "cyrillic-small-letter-dzhe" }, { 0x0490, "cyrillic-capital-letter-ghe-with-upturn" }, { 0x0491, "cyrillic-small-letter-ghe-with-upturn" }, { 0x0950, "devanagari-om" }, { 0x1e80, "latin-capital-letter-w-with-grave" }, { 0x1e81, "latin-small-letter-w-with-grave" }, { 0x1e82, "latin-capital-letter-w-with-acute" }, { 0x1e83, "latin-small-letter-w-with-acute" }, { 0x1e84, "latin-capital-letter-w-with-diaeresis" }, { 0x1e85, "latin-small-letter-w-with-diaeresis" }, { 0x1ef2, "latin-capital-letter-y-with-grave" }, { 0x1ef3, "latin-small-letter-y-with-grave" }, { 0x2013, "en-dash" }, { 0x2014, "em-dash" }, { 0x2015, "horizontal-bar" }, { 0x2017, "double-low-line" }, { 0x2018, "left-single-quotation-mark" }, { 0x2019, "right-single-quotation-mark" }, { 0x201a, "single-low-9-quotation-mark" }, { 0x201b, "single-high-reversed-9-quotation-mark" }, { 0x201c, "left-double-quotation-mark" }, { 0x201d, "right-double-quotation-mark" }, { 0x201e, "double-low-9-quotation-mark" }, { 0x2020, "dagger" }, { 0x2021, "double-dagger" }, { 0x2022, "bullet" }, { 0x2026, "horizontal-ellipsis" }, { 0x2030, "per-mille-sign" }, { 0x2032, "prime" }, { 0x2033, "double-prime" }, { 0x2039, "single-left-pointing-angle-quotation-mark" }, { 0x203a, "single-right-pointing-angle-quotation-mark" }, { 0x203c, "double-exclamation-mark" }, { 0x203e, "overline" }, { 0x2044, "fraction-slash" }, { 0x207f, "superscript-latin-small-letter-n" }, { 0x20a3, "french-franc-sign" }, { 0x20a4, "lira-sign" }, { 0x20a7, "peseta-sign" }, { 0x2105, "care-of" }, { 0x2111, "black-letter-capital-i" }, { 0x2113, "script-small-l" }, { 0x2116, "numero-sign" }, { 0x2118, "script-capital-p" }, { 0x211c, "black-letter-capital-r" }, { 0x2122, "trade-mark-sign" }, { 0x2126, "ohm-sign" }, { 0x212e, "estimated-symbol" }, { 0x2135, "alef-symbol" }, { 0x215b, "vulgar-fraction-one-eighth" }, { 0x215c, "vulgar-fraction-three-eighths" }, { 0x215d, "vulgar-fraction-five-eighths" }, { 0x215e, "vulgar-fraction-seven-eighths" }, { 0x2190, "leftwards-arrow" }, { 0x2191, "upwards-arrow" }, { 0x2192, "rightwards-arrow" }, { 0x2193, "downwards-arrow" }, { 0x2194, "left-right-arrow" }, { 0x2195, "up-down-arrow" }, { 0x21a8, "up-down-arrow-with-base" }, { 0x21b5, "downwards-arrow-with-corner-leftwards" }, { 0x21d0, "leftwards-double-arrow" }, { 0x21d1, "upwards-double-arrow" }, { 0x21d2, "rightwards-double-arrow" }, { 0x21d3, "downwards-double-arrow" }, { 0x21d4, "left-right-double-arrow" }, { 0x2200, "for-all" }, { 0x2202, "partial-differential" }, { 0x2203, "there-exists" }, { 0x2205, "empty-set" }, { 0x2206, "increment" }, { 0x2207, "nabla" }, { 0x2208, "element-of" }, { 0x2209, "not-an-element-of" }, { 0x220b, "contains-as-member" }, { 0x220f, "n-ary-product" }, { 0x2211, "n-ary-summation" }, { 0x2212, "minus-sign" }, { 0x2215, "division-slash" }, { 0x2217, "asterisk-operator" }, { 0x2219, "bullet-operator" }, { 0x221a, "square-root" }, { 0x221d, "proportional-to" }, { 0x221e, "infinity" }, { 0x221f, "right-angle" }, { 0x2220, "angle" }, { 0x2227, "logical-and" }, { 0x2228, "logical-or" }, { 0x2229, "intersection" }, { 0x222a, "union" }, { 0x222b, "integral" }, { 0x2234, "therefore" }, { 0x223c, "tilde-operator" }, { 0x2245, "approximately-equal-to" }, { 0x2248, "almost-equal-to" }, { 0x2260, "not-equal-to" }, { 0x2261, "identical-to" }, { 0x2264, "less-than-or-equal-to" }, { 0x2265, "greater-than-or-equal-to" }, { 0x2282, "subset-of" }, { 0x2283, "superset-of" }, { 0x2284, "not-a-subset-of" }, { 0x2286, "subset-of-or-equal-to" }, { 0x2287, "superset-of-or-equal-to" }, { 0x2295, "circled-plus" }, { 0x2297, "circled-times" }, { 0x22a5, "up-tack" }, { 0x22c5, "dot-operator" }, { 0x2302, "house" }, { 0x2310, "reversed-not-sign" }, { 0x2320, "top-half-integral" }, { 0x2321, "bottom-half-integral" }, { 0x2326, "erase-to-the-right" }, { 0x2328, "keyboard" }, { 0x2329, "left-pointing-angle-bracket" }, { 0x232a, "right-pointing-angle-bracket" }, { 0x232b, "erase-to-the-left" }, { 0x2460, "circled-digit-one" }, { 0x2461, "circled-digit-two" }, { 0x2462, "circled-digit-three" }, { 0x2463, "circled-digit-four" }, { 0x2464, "circled-digit-five" }, { 0x2465, "circled-digit-six" }, { 0x2466, "circled-digit-seven" }, { 0x2467, "circled-digit-eight" }, { 0x2468, "circled-digit-nine" }, { 0x2469, "circled-number-ten" }, { 0x2500, "box-drawings-light-horizontal" }, { 0x2502, "box-drawings-light-vertical" }, { 0x250c, "box-drawings-light-down-and-right" }, { 0x2510, "box-drawings-light-down-and-left" }, { 0x2514, "box-drawings-light-up-and-right" }, { 0x2518, "box-drawings-light-up-and-left" }, { 0x251c, "box-drawings-light-vertical-and-right" }, { 0x2524, "box-drawings-light-vertical-and-left" }, { 0x252c, "box-drawings-light-down-and-horizontal" }, { 0x2534, "box-drawings-light-up-and-horizontal" }, { 0x253c, "box-drawings-light-vertical-and-horizontal" }, { 0x2550, "box-drawings-double-horizontal" }, { 0x2551, "box-drawings-double-vertical" }, { 0x2552, "box-drawings-down-single-and-right-double" }, { 0x2553, "box-drawings-down-double-and-right-single" }, { 0x2554, "box-drawings-double-down-and-right" }, { 0x2555, "box-drawings-down-single-and-left-double" }, { 0x2556, "box-drawings-down-double-and-left-single" }, { 0x2557, "box-drawings-double-down-and-left" }, { 0x2558, "box-drawings-up-single-and-right-double" }, { 0x2559, "box-drawings-up-double-and-right-single" }, { 0x255a, "box-drawings-double-up-and-right" }, { 0x255b, "box-drawings-up-single-and-left-double" }, { 0x255c, "box-drawings-up-double-and-left-single" }, { 0x255d, "box-drawings-double-up-and-left" }, { 0x255e, "box-drawings-vertical-single-and-right-double" }, { 0x255f, "box-drawings-vertical-double-and-right-single" }, { 0x2560, "box-drawings-double-vertical-and-right" }, { 0x2561, "box-drawings-vertical-single-and-left-double" }, { 0x2562, "box-drawings-vertical-double-and-left-single" }, { 0x2563, "box-drawings-double-vertical-and-left" }, { 0x2564, "box-drawings-down-single-and-horizontal-double" }, { 0x2565, "box-drawings-down-double-and-horizontal-single" }, { 0x2566, "box-drawings-double-down-and-horizontal" }, { 0x2567, "box-drawings-up-single-and-horizontal-double" }, { 0x2568, "box-drawings-up-double-and-horizontal-single" }, { 0x2569, "box-drawings-double-up-and-horizontal" }, { 0x256a, "box-drawings-vertical-single-and-horizontal-double" }, { 0x256b, "box-drawings-vertical-double-and-horizontal-single" }, { 0x256c, "box-drawings-double-vertical-and-horizontal" }, { 0x2580, "upper-half-block" }, { 0x2584, "lower-half-block" }, { 0x2588, "full-block" }, { 0x258c, "left-half-block" }, { 0x2590, "right-half-block" }, { 0x2591, "light-shade" }, { 0x2592, "medium-shade" }, { 0x2593, "dark-shade" }, { 0x25a0, "black-square" }, { 0x25a1, "white-square" }, { 0x25aa, "black-small-square" }, { 0x25ab, "white-small-square" }, { 0x25ac, "black-rectangle" }, { 0x25b2, "black-up-pointing-triangle" }, { 0x25ba, "black-right-pointing-pointer" }, { 0x25bc, "black-down-pointing-triangle" }, { 0x25c4, "black-left-pointing-pointer" }, { 0x25c6, "black-diamond" }, { 0x25ca, "lozenge" }, { 0x25cb, "white-circle" }, { 0x25cf, "black-circle" }, { 0x25d8, "inverse-bullet" }, { 0x25d9, "inverse-white-circle" }, { 0x25e6, "white-bullet" }, { 0x2605, "black-star" }, { 0x260e, "black-telephone" }, { 0x2611, "ballot-box-with-check" }, { 0x2612, "ballot-box-with-x" }, { 0x261b, "black-right-pointing-index" }, { 0x261c, "white-left-pointing-index" }, { 0x261d, "white-up-pointing-index" }, { 0x261e, "white-right-pointing-index" }, { 0x261f, "white-down-pointing-index" }, { 0x2620, "skull-and-crossbones" }, { 0x262a, "star-and-crescent" }, { 0x262f, "yin-yang" }, { 0x2638, "wheel-of-dharma" }, { 0x2639, "white-frowning-face" }, { 0x263a, "white-smiling-face" }, { 0x263b, "black-smiling-face" }, { 0x263c, "white-sun-with-rays" }, { 0x2640, "female-sign" }, { 0x2642, "male-sign" }, { 0x2648, "aries" }, { 0x2649, "taurus" }, { 0x264a, "gemini" }, { 0x264b, "cancer" }, { 0x264c, "leo" }, { 0x264d, "virgo" }, { 0x264e, "libra" }, { 0x264f, "scorpius" }, { 0x2650, "sagittarius" }, { 0x2651, "capricorn" }, { 0x2652, "aquarius" }, { 0x2653, "pisces" }, { 0x2660, "black-spade-suit" }, { 0x2663, "black-club-suit" }, { 0x2665, "black-heart-suit" }, { 0x2666, "black-diamond-suit" }, { 0x266a, "eighth-note" }, { 0x266b, "beamed-eighth-notes" }, { 0x2701, "upper-blade-scissors" }, { 0x2702, "black-scissors" }, { 0x2703, "lower-blade-scissors" }, { 0x2704, "white-scissors" }, { 0x2706, "telephone-location-sign" }, { 0x2707, "tape-drive" }, { 0x2708, "airplane" }, { 0x2709, "envelope" }, { 0x270c, "victory-hand" }, { 0x270d, "writing-hand" }, { 0x270e, "lower-right-pencil" }, { 0x270f, "pencil" }, { 0x2710, "upper-right-pencil" }, { 0x2711, "white-nib" }, { 0x2712, "black-nib" }, { 0x2713, "check-mark" }, { 0x2714, "heavy-check-mark" }, { 0x2715, "multiplication-x" }, { 0x2716, "heavy-multiplication-x" }, { 0x2717, "ballot-x" }, { 0x2718, "heavy-ballot-x" }, { 0x2719, "outlined-greek-cross" }, { 0x271a, "heavy-greek-cross" }, { 0x271b, "open-centre-cross" }, { 0x271c, "heavy-open-centre-cross" }, { 0x271d, "latin-cross" }, { 0x271e, "shadowed-white-latin-cross" }, { 0x271f, "outlined-latin-cross" }, { 0x2720, "maltese-cross" }, { 0x2721, "star-of-david" }, { 0x2722, "four-teardrop-spoked-asterisk" }, { 0x2723, "four-balloon-spoked-asterisk" }, { 0x2724, "heavy-four-balloon-spoked-asterisk" }, { 0x2725, "four-club-spoked-asterisk" }, { 0x2726, "black-four-pointed-star" }, { 0x2727, "white-four-pointed-star" }, { 0x2729, "stress-outlined-white-star" }, { 0x272a, "circled-white-star" }, { 0x272b, "open-centre-black-star" }, { 0x272c, "black-centre-white-star" }, { 0x272d, "outlined-black-star" }, { 0x272e, "heavy-outlined-black-star" }, { 0x272f, "pinwheel-star" }, { 0x2730, "shadowed-white-star" }, { 0x2731, "heavy-asterisk" }, { 0x2732, "open-centre-asterisk" }, { 0x2733, "eight-spoked-asterisk" }, { 0x2734, "eight-pointed-black-star" }, { 0x2735, "eight-pointed-pinwheel-star" }, { 0x2736, "six-pointed-black-star" }, { 0x2737, "eight-pointed-rectilinear-black-star" }, { 0x2738, "heavy-eight-pointed-rectilinear-black-star" }, { 0x2739, "twelve-pointed-black-star" }, { 0x273a, "sixteen-pointed-asterisk" }, { 0x273b, "teardrop-spoked-asterisk" }, { 0x273c, "open-centre-teardrop-spoked-asterisk" }, { 0x273d, "heavy-teardrop-spoked-asterisk" }, { 0x273e, "six-petalled-black-and-white-florette" }, { 0x273f, "black-florette" }, { 0x2740, "white-florette" }, { 0x2741, "eight-petalled-outlined-black-florette" }, { 0x2742, "circled-open-centre-eight-pointed-star" }, { 0x2743, "heavy-teardrop-spoked-pinwheel-asterisk" }, { 0x2744, "snowflake" }, { 0x2745, "tight-trifoliate-snowflake" }, { 0x2746, "heavy-chevron-snowflake" }, { 0x2747, "sparkle" }, { 0x2748, "heavy-sparkle" }, { 0x2749, "balloon-spoked-asterisk" }, { 0x274a, "eight-teardrop-spoked-propeller-asterisk" }, { 0x274b, "heavy-eight-teardrop-spoked-propeller-asterisk" }, { 0x274d, "shadowed-white-circle" }, { 0x274f, "lower-right-drop-shadowed-white-square" }, { 0x2750, "upper-right-drop-shadowed-white-square" }, { 0x2751, "lower-right-shadowed-white-square" }, { 0x2752, "upper-right-shadowed-white-square" }, { 0x2756, "black-diamond-minus-white-x" }, { 0x2758, "light-vertical-bar" }, { 0x2759, "medium-vertical-bar" }, { 0x275a, "heavy-vertical-bar" }, { 0x275b, "heavy-single-turned-comma-quotation-mark-ornament" }, { 0x275c, "heavy-single-comma-quotation-mark-ornament" }, { 0x275d, "heavy-double-turned-comma-quotation-mark-ornament" }, { 0x275e, "heavy-double-comma-quotation-mark-ornament" }, { 0x2761, "curved-stem-paragraph-sign-ornament" }, { 0x2762, "heavy-exclamation-mark-ornament" }, { 0x2763, "heavy-heart-exclamation-mark-ornament" }, { 0x2764, "heavy-black-heart" }, { 0x2765, "rotated-heavy-black-heart-bullet" }, { 0x2766, "floral-heart" }, { 0x2767, "rotated-floral-heart-bullet" }, { 0x2776, "dingbat-negative-circled-digit-one" }, { 0x2777, "dingbat-negative-circled-digit-two" }, { 0x2778, "dingbat-negative-circled-digit-three" }, { 0x2779, "dingbat-negative-circled-digit-four" }, { 0x277a, "dingbat-negative-circled-digit-five" }, { 0x277b, "dingbat-negative-circled-digit-six" }, { 0x277c, "dingbat-negative-circled-digit-seven" }, { 0x277d, "dingbat-negative-circled-digit-eight" }, { 0x277e, "dingbat-negative-circled-digit-nine" }, { 0x277f, "dingbat-negative-circled-number-ten" }, { 0x2780, "dingbat-circled-sans-serif-digit-one" }, { 0x2781, "dingbat-circled-sans-serif-digit-two" }, { 0x2782, "dingbat-circled-sans-serif-digit-three" }, { 0x2783, "dingbat-circled-sans-serif-digit-four" }, { 0x2784, "dingbat-circled-sans-serif-digit-five" }, { 0x2785, "dingbat-circled-sans-serif-digit-six" }, { 0x2786, "dingbat-circled-sans-serif-digit-seven" }, { 0x2787, "dingbat-circled-sans-serif-digit-eight" }, { 0x2788, "dingbat-circled-sans-serif-digit-nine" }, { 0x2789, "dingbat-circled-sans-serif-number-ten" }, { 0x278a, "dingbat-negative-circled-sans-serif-digit-one" }, { 0x278b, "dingbat-negative-circled-sans-serif-digit-two" }, { 0x278c, "dingbat-negative-circled-sans-serif-digit-three" }, { 0x278d, "dingbat-negative-circled-sans-serif-digit-four" }, { 0x278e, "dingbat-negative-circled-sans-serif-digit-five" }, { 0x278f, "dingbat-negative-circled-sans-serif-digit-six" }, { 0x2790, "dingbat-negative-circled-sans-serif-digit-seven" }, { 0x2791, "dingbat-negative-circled-sans-serif-digit-eight" }, { 0x2792, "dingbat-negative-circled-sans-serif-digit-nine" }, { 0x2793, "dingbat-negative-circled-sans-serif-number-ten" }, { 0x2794, "heavy-wide-headed-rightwards-arrow" }, { 0x2798, "heavy-south-east-arrow" }, { 0x2799, "heavy-rightwards-arrow" }, { 0x279a, "heavy-north-east-arrow" }, { 0x279b, "drafting-point-rightwards-arrow" }, { 0x279c, "heavy-round-tipped-rightwards-arrow" }, { 0x279d, "triangle-headed-rightwards-arrow" }, { 0x279e, "heavy-triangle-headed-rightwards-arrow" }, { 0x279f, "dashed-triangle-headed-rightwards-arrow" }, { 0x27a0, "heavy-dashed-triangle-headed-rightwards-arrow" }, { 0x27a1, "black-rightwards-arrow" }, { 0x27a2, "three-d-top-lighted-rightwards-arrowhead" }, { 0x27a3, "three-d-bottom-lighted-rightwards-arrowhead" }, { 0x27a4, "black-rightwards-arrowhead" }, { 0x27a5, "heavy-black-curved-downwards-and-rightwards-arrow" }, { 0x27a6, "heavy-black-curved-upwards-and-rightwards-arrow" }, { 0x27a7, "squat-black-rightwards-arrow" }, { 0x27a8, "heavy-concave-pointed-black-rightwards-arrow" }, { 0x27a9, "right-shaded-white-rightwards-arrow" }, { 0x27aa, "left-shaded-white-rightwards-arrow" }, { 0x27ab, "back-tilted-shadowed-white-rightwards-arrow" }, { 0x27ac, "front-tilted-shadowed-white-rightwards-arrow" }, { 0x27ad, "heavy-lower-right-shadowed-white-rightwards-arrow" }, { 0x27ae, "heavy-upper-right-shadowed-white-rightwards-arrow" }, { 0x27af, "notched-lower-right-shadowed-white-rightwards-arrow" }, { 0x27b1, "notched-upper-right-shadowed-white-rightwards-arrow" }, { 0x27b2, "circled-heavy-white-rightwards-arrow" }, { 0x27b3, "white-feathered-rightwards-arrow" }, { 0x27b4, "black-feathered-south-east-arrow" }, { 0x27b5, "black-feathered-rightwards-arrow" }, { 0x27b6, "black-feathered-north-east-arrow" }, { 0x27b7, "heavy-black-feathered-south-east-arrow" }, { 0x27b8, "heavy-black-feathered-rightwards-arrow" }, { 0x27b9, "heavy-black-feathered-north-east-arrow" }, { 0x27ba, "teardrop-barbed-rightwards-arrow" }, { 0x27bb, "heavy-teardrop-shanked-rightwards-arrow" }, { 0x27bc, "wedge-tailed-rightwards-arrow" }, { 0x27bd, "heavy-wedge-tailed-rightwards-arrow" }, { 0x27be, "open-outlined-rightwards-arrow" }, { 0xfb01, "latin-small-ligature-fi" }, { 0xfb02, "latin-small-ligature-fl" }, OpenJade-1.4devel/style/charProps.h0000644000021000000240000003122707025631172013005 #ifdef SPACE { 0x0020, 1 }, { 0x00a0, 1 }, { 0x2000, 12 }, { 0x3000, 1 }, #endif #ifdef RECORD_END { 0x000D, 1 }, #endif #ifdef BLANK { 0x0000, 32 }, { 0x007f, 33 }, { 0x200e, 2 }, { 0x202a, 5 }, { 0x200c, 2 }, { 0x206a, 6 }, #endif #ifdef INPUT_TAB { 0x0009, 1 }, #endif #ifdef INPUT_WHITESPACE { 0x0009, 5 }, { 0x0020, 1 }, { 0x00a0, 1 }, { 0x2000, 12 }, { 0x2028, 2 }, { 0x3000, 1 }, #endif #ifdef PUNCT { 0x0021, 1 }, { 0x002c, 1 }, { 0x002e, 1 }, { 0x003a, 2 }, { 0x003f, 1 }, { 0x037e, 1 }, { 0x0387, 1 }, { 0x0589, 1 }, { 0x060c, 1 }, { 0x061b, 1 }, { 0x061f, 1 }, { 0x06d4, 1 }, { 0x0964, 2 }, { 0x0e5a, 2 }, { 0x203c, 2 }, { 0x3001, 2 }, { 0xfe50, 3 }, { 0xfe54, 4 }, { 0xff01, 1 }, { 0xff0c, 1 }, { 0xff0e, 1 }, { 0xff1a, 2 }, { 0xff1f, 1 }, { 0xff61, 1 }, { 0xff64, 1 }, #endif #ifdef SCRIPT { 0x0000, 0x007f, "Latin" }, { 0x0080, 0x00ff, "Latin" }, { 0x0100, 0x017f, "Latin" }, { 0x0180, 0x024f, "Latin" }, { 0x0370, 0x03ff, "Greek" }, { 0x0400, 0x04ff, "Cyrillic" }, { 0x0530, 0x058f, "Armenian" }, { 0x0590, 0x05ff, "Hebrew" }, { 0x0600, 0x06ff, "Arabic" }, { 0x0900, 0x097f, "Devanagari" }, { 0x0980, 0x09ff, "Bengali" }, { 0x0a00, 0x0a7f, "Gurmukhi" }, { 0x0a80, 0x0aff, "Gujarati" }, { 0x0b00, 0x0b7f, "Oriya" }, { 0x0b80, 0x0bff, "Tamil" }, { 0x0c00, 0x0c7f, "Telugu" }, { 0x0c80, 0x0cff, "Kannada" }, { 0x0d00, 0x0d7f, "Malayalam" }, { 0x0d80, 0x0dff, "Sinhala" }, { 0x0e00, 0x0e7f, "Thai" }, { 0x0e80, 0x0eff, "Lao" }, { 0x0f00, 0x0fbf, "Tibetan" }, { 0x10a0, 0x10ff, "Georgian" }, { 0x1100, 0x11ff, "Hangul" }, { 0x1200, 0x137f, "Ethiopian" }, { 0x1780, 0x17ff, "Khmer" }, { 0x1800, 0x18af, "Mongolian" }, { 0x1e00, 0x1eff, "Latin" }, { 0x1f00, 0x1fff, "Greek" }, { 0x2000, 0x206f, "Punctuation" }, { 0x20a0, 0x20cf, "Symbol" }, { 0x2100, 0x214f, "Symbol" }, { 0x2600, 0x26ff, "Symbol" }, { 0x3040, 0x309f, "Hiragana" }, { 0x30a0, 0x30ff, "Katakana" }, { 0x3100, 0x312f, "Bopomofo" }, { 0x3130, 0x318f, "Hangul" }, { 0xac00, 0xd7a3, "Hangul" }, #endif #ifdef BREAK_PRIORITIES // These are automatically generated by ../unicode/genbreakprios.pl. { 0x0009, 2, 2, 3 }, { 0x000d, 1, 2, 3 }, { 0x0020, 1, 2, 3 }, { 0x0021, 4, 1, 1 }, { 0x0025, 1, 3, 1 }, { 0x0026, 2, 1, 1 }, { 0x0028, 1, 1, 3 }, { 0x0029, 1, 3, 1 }, { 0x002a, 3, 1, 1 }, { 0x002d, 1, 3, 2 }, { 0x002e, 1, 1, 1 }, { 0x002f, 1, 1, 2 }, { 0x0030, 43, 1, 1 }, { 0x005b, 1, 1, 3 }, { 0x005c, 1, 1, 1 }, { 0x005d, 1, 3, 1 }, { 0x005e, 29, 1, 1 }, { 0x007b, 1, 1, 3 }, { 0x007c, 1, 1, 2 }, { 0x007d, 1, 3, 1 }, { 0x007e, 1, 1, 1 }, { 0x00a0, 2, 1, 1 }, { 0x00a2, 1, 3, 1 }, { 0x00a3, 10, 1, 1 }, { 0x00ad, 1, 1, 2 }, { 0x00ae, 2, 1, 1 }, { 0x00b0, 1, 3, 1 }, { 0x00b1, 3, 1, 1 }, { 0x00b4, 1, 1, 2 }, { 0x00b5, 363, 1, 1 }, { 0x0222, 18, 1, 1 }, { 0x0250, 94, 1, 1 }, { 0x02b0, 24, 1, 1 }, { 0x02c8, 1, 2, 3 }, { 0x02c9, 3, 1, 1 }, { 0x02cc, 1, 2, 3 }, { 0x02cd, 34, 1, 1 }, { 0x0300, 79, 1, 1 }, { 0x0360, 3, 1, 1 }, { 0x0374, 2, 1, 1 }, { 0x037a, 1, 1, 1 }, { 0x037e, 1, 1, 1 }, { 0x0384, 7, 1, 1 }, { 0x038c, 1, 1, 1 }, { 0x038e, 20, 1, 1 }, { 0x03a3, 44, 1, 1 }, { 0x03d0, 8, 1, 1 }, { 0x03da, 26, 1, 1 }, { 0x0400, 135, 1, 1 }, { 0x0488, 2, 1, 1 }, { 0x048e, 55, 1, 1 }, { 0x04c7, 2, 1, 1 }, { 0x04cb, 2, 1, 1 }, { 0x04d0, 38, 1, 1 }, { 0x04f8, 2, 1, 1 }, { 0x0531, 38, 1, 1 }, { 0x0559, 7, 1, 1 }, { 0x0561, 39, 1, 1 }, { 0x0589, 1, 1, 1 }, { 0x058a, 1, 1, 2 }, { 0x0591, 17, 1, 1 }, { 0x05a3, 23, 1, 1 }, { 0x05bb, 10, 1, 1 }, { 0x05d0, 27, 1, 1 }, { 0x05f0, 5, 1, 1 }, { 0x060c, 1, 1, 1 }, { 0x061b, 1, 1, 1 }, { 0x061f, 1, 1, 1 }, { 0x0621, 26, 1, 1 }, { 0x0640, 22, 1, 1 }, { 0x0660, 14, 1, 1 }, { 0x0670, 126, 1, 1 }, { 0x06f0, 15, 1, 1 }, { 0x0700, 14, 1, 1 }, { 0x070f, 30, 1, 1 }, { 0x0730, 27, 1, 1 }, { 0x0780, 49, 1, 1 }, { 0x0901, 3, 1, 1 }, { 0x0905, 53, 1, 1 }, { 0x093c, 18, 1, 1 }, { 0x0950, 5, 1, 1 }, { 0x0958, 25, 1, 1 }, { 0x0981, 3, 1, 1 }, { 0x0985, 8, 1, 1 }, { 0x098f, 2, 1, 1 }, { 0x0993, 22, 1, 1 }, { 0x09aa, 7, 1, 1 }, { 0x09b2, 1, 1, 1 }, { 0x09b6, 4, 1, 1 }, { 0x09bc, 1, 1, 1 }, { 0x09be, 7, 1, 1 }, { 0x09c7, 2, 1, 1 }, { 0x09cb, 3, 1, 1 }, { 0x09d7, 1, 1, 1 }, { 0x09dc, 2, 1, 1 }, { 0x09df, 5, 1, 1 }, { 0x09e6, 21, 1, 1 }, { 0x0a02, 1, 1, 1 }, { 0x0a05, 6, 1, 1 }, { 0x0a0f, 2, 1, 1 }, { 0x0a13, 22, 1, 1 }, { 0x0a2a, 7, 1, 1 }, { 0x0a32, 2, 1, 1 }, { 0x0a35, 2, 1, 1 }, { 0x0a38, 2, 1, 1 }, { 0x0a3c, 1, 1, 1 }, { 0x0a3e, 5, 1, 1 }, { 0x0a47, 2, 1, 1 }, { 0x0a4b, 3, 1, 1 }, { 0x0a59, 4, 1, 1 }, { 0x0a5e, 1, 1, 1 }, { 0x0a66, 15, 1, 1 }, { 0x0a81, 3, 1, 1 }, { 0x0a85, 7, 1, 1 }, { 0x0a8d, 1, 1, 1 }, { 0x0a8f, 3, 1, 1 }, { 0x0a93, 22, 1, 1 }, { 0x0aaa, 7, 1, 1 }, { 0x0ab2, 2, 1, 1 }, { 0x0ab5, 5, 1, 1 }, { 0x0abc, 10, 1, 1 }, { 0x0ac7, 3, 1, 1 }, { 0x0acb, 3, 1, 1 }, { 0x0ad0, 1, 1, 1 }, { 0x0ae0, 1, 1, 1 }, { 0x0ae6, 10, 1, 1 }, { 0x0b01, 3, 1, 1 }, { 0x0b05, 8, 1, 1 }, { 0x0b0f, 2, 1, 1 }, { 0x0b13, 22, 1, 1 }, { 0x0b2a, 7, 1, 1 }, { 0x0b32, 2, 1, 1 }, { 0x0b36, 4, 1, 1 }, { 0x0b3c, 8, 1, 1 }, { 0x0b47, 2, 1, 1 }, { 0x0b4b, 3, 1, 1 }, { 0x0b56, 2, 1, 1 }, { 0x0b5c, 2, 1, 1 }, { 0x0b5f, 3, 1, 1 }, { 0x0b66, 11, 1, 1 }, { 0x0b82, 2, 1, 1 }, { 0x0b85, 6, 1, 1 }, { 0x0b8e, 3, 1, 1 }, { 0x0b92, 4, 1, 1 }, { 0x0b99, 2, 1, 1 }, { 0x0b9c, 1, 1, 1 }, { 0x0b9e, 2, 1, 1 }, { 0x0ba3, 2, 1, 1 }, { 0x0ba8, 3, 1, 1 }, { 0x0bae, 8, 1, 1 }, { 0x0bb7, 3, 1, 1 }, { 0x0bbe, 5, 1, 1 }, { 0x0bc6, 3, 1, 1 }, { 0x0bca, 4, 1, 1 }, { 0x0bd7, 1, 1, 1 }, { 0x0be7, 12, 1, 1 }, { 0x0c01, 3, 1, 1 }, { 0x0c05, 8, 1, 1 }, { 0x0c0e, 3, 1, 1 }, { 0x0c12, 23, 1, 1 }, { 0x0c2a, 10, 1, 1 }, { 0x0c35, 5, 1, 1 }, { 0x0c3e, 7, 1, 1 }, { 0x0c46, 3, 1, 1 }, { 0x0c4a, 4, 1, 1 }, { 0x0c55, 2, 1, 1 }, { 0x0c60, 2, 1, 1 }, { 0x0c66, 10, 1, 1 }, { 0x0c82, 2, 1, 1 }, { 0x0c85, 8, 1, 1 }, { 0x0c8e, 3, 1, 1 }, { 0x0c92, 23, 1, 1 }, { 0x0caa, 10, 1, 1 }, { 0x0cb5, 5, 1, 1 }, { 0x0cbe, 7, 1, 1 }, { 0x0cc6, 3, 1, 1 }, { 0x0cca, 4, 1, 1 }, { 0x0cd5, 2, 1, 1 }, { 0x0cde, 1, 1, 1 }, { 0x0ce0, 2, 1, 1 }, { 0x0ce6, 10, 1, 1 }, { 0x0d02, 2, 1, 1 }, { 0x0d05, 8, 1, 1 }, { 0x0d0e, 3, 1, 1 }, { 0x0d12, 23, 1, 1 }, { 0x0d2a, 16, 1, 1 }, { 0x0d3e, 6, 1, 1 }, { 0x0d46, 3, 1, 1 }, { 0x0d4a, 4, 1, 1 }, { 0x0d57, 1, 1, 1 }, { 0x0d60, 2, 1, 1 }, { 0x0d66, 10, 1, 1 }, { 0x0d82, 2, 1, 1 }, { 0x0d85, 18, 1, 1 }, { 0x0d9a, 24, 1, 1 }, { 0x0db3, 9, 1, 1 }, { 0x0dbd, 1, 1, 1 }, { 0x0dc0, 7, 1, 1 }, { 0x0dca, 1, 1, 1 }, { 0x0dcf, 6, 1, 1 }, { 0x0dd6, 1, 1, 1 }, { 0x0dd8, 8, 1, 1 }, { 0x0df2, 3, 1, 1 }, { 0x0e01, 58, 1, 1 }, { 0x0e3f, 27, 1, 1 }, { 0x0e5a, 2, 5, 1 }, { 0x0e81, 2, 1, 1 }, { 0x0e84, 1, 1, 1 }, { 0x0e87, 2, 1, 1 }, { 0x0e8a, 1, 1, 1 }, { 0x0e8d, 1, 1, 1 }, { 0x0e94, 4, 1, 1 }, { 0x0e99, 7, 1, 1 }, { 0x0ea1, 3, 1, 1 }, { 0x0ea5, 1, 1, 1 }, { 0x0ea7, 1, 1, 1 }, { 0x0eaa, 2, 1, 1 }, { 0x0ead, 13, 1, 1 }, { 0x0ebb, 3, 1, 1 }, { 0x0ec0, 5, 1, 1 }, { 0x0ec6, 1, 1, 1 }, { 0x0ec8, 6, 1, 1 }, { 0x0ed0, 10, 1, 1 }, { 0x0edc, 2, 1, 1 }, { 0x0f00, 11, 1, 1 }, { 0x0f0b, 1, 1, 2 }, { 0x0f0c, 46, 1, 1 }, { 0x0f3a, 1, 1, 3 }, { 0x0f3b, 1, 3, 1 }, { 0x0f3c, 1, 1, 3 }, { 0x0f3d, 1, 3, 1 }, { 0x0f3e, 10, 1, 1 }, { 0x0f49, 34, 1, 1 }, { 0x0f71, 27, 1, 1 }, { 0x0f90, 8, 1, 1 }, { 0x0f99, 36, 1, 1 }, { 0x0fbe, 15, 1, 1 }, { 0x0fcf, 1, 1, 1 }, { 0x1000, 34, 1, 1 }, { 0x1023, 5, 1, 1 }, { 0x1029, 2, 1, 1 }, { 0x102c, 7, 1, 1 }, { 0x1036, 4, 1, 1 }, { 0x1040, 26, 1, 1 }, { 0x10a0, 38, 1, 1 }, { 0x10d0, 39, 1, 1 }, { 0x10fb, 1, 1, 1 }, { 0x1160, 67, 1, 1 }, { 0x11a8, 82, 1, 1 }, { 0x1200, 7, 1, 1 }, { 0x1208, 63, 1, 1 }, { 0x1248, 1, 1, 1 }, { 0x124a, 4, 1, 1 }, { 0x1250, 7, 1, 1 }, { 0x1258, 1, 1, 1 }, { 0x125a, 4, 1, 1 }, { 0x1260, 39, 1, 1 }, { 0x1288, 1, 1, 1 }, { 0x128a, 4, 1, 1 }, { 0x1290, 31, 1, 1 }, { 0x12b0, 1, 1, 1 }, { 0x12b2, 4, 1, 1 }, { 0x12b8, 7, 1, 1 }, { 0x12c0, 1, 1, 1 }, { 0x12c2, 4, 1, 1 }, { 0x12c8, 7, 1, 1 }, { 0x12d0, 7, 1, 1 }, { 0x12d8, 23, 1, 1 }, { 0x12f0, 31, 1, 1 }, { 0x1310, 1, 1, 1 }, { 0x1312, 4, 1, 1 }, { 0x1318, 7, 1, 1 }, { 0x1320, 39, 1, 1 }, { 0x1348, 19, 1, 1 }, { 0x1361, 1, 1, 2 }, { 0x1362, 27, 1, 1 }, { 0x13a0, 85, 1, 1 }, { 0x1401, 630, 1, 1 }, { 0x1680, 1, 1, 2 }, { 0x1681, 28, 1, 1 }, { 0x16a0, 81, 1, 1 }, { 0x1780, 84, 1, 1 }, { 0x17d4, 1, 5, 1 }, { 0x17d5, 1, 1, 2 }, { 0x17d6, 5, 5, 1 }, { 0x17db, 2, 1, 1 }, { 0x17e0, 10, 1, 1 }, { 0x1800, 6, 1, 1 }, { 0x1806, 1, 2, 3 }, { 0x1807, 8, 1, 1 }, { 0x1810, 10, 1, 1 }, { 0x1820, 88, 1, 1 }, { 0x1880, 42, 1, 1 }, { 0x1e00, 156, 1, 1 }, { 0x1ea0, 90, 1, 1 }, { 0x1f00, 22, 1, 1 }, { 0x1f18, 6, 1, 1 }, { 0x1f20, 38, 1, 1 }, { 0x1f48, 6, 1, 1 }, { 0x1f50, 8, 1, 1 }, { 0x1f59, 1, 1, 1 }, { 0x1f5b, 1, 1, 1 }, { 0x1f5d, 1, 1, 1 }, { 0x1f5f, 31, 1, 1 }, { 0x1f80, 53, 1, 1 }, { 0x1fb6, 15, 1, 1 }, { 0x1fc6, 14, 1, 1 }, { 0x1fd6, 6, 1, 1 }, { 0x1fdd, 19, 1, 1 }, { 0x1ff2, 3, 1, 1 }, { 0x1ff6, 9, 1, 1 }, { 0x2000, 7, 1, 2 }, { 0x2007, 1, 1, 1 }, { 0x2008, 4, 1, 2 }, { 0x200c, 4, 1, 1 }, { 0x2010, 1, 1, 2 }, { 0x2011, 1, 1, 1 }, { 0x2012, 2, 1, 2 }, { 0x2014, 1, 3, 2 }, { 0x2015, 5, 1, 1 }, { 0x201a, 1, 1, 3 }, { 0x201b, 3, 1, 1 }, { 0x201e, 1, 1, 3 }, { 0x201f, 8, 1, 1 }, { 0x2027, 1, 1, 2 }, { 0x202a, 6, 1, 1 }, { 0x2030, 8, 3, 1 }, { 0x2038, 4, 1, 1 }, { 0x203c, 1, 5, 1 }, { 0x203d, 7, 1, 1 }, { 0x2044, 1, 5, 1 }, { 0x2045, 1, 1, 3 }, { 0x2046, 1, 3, 1 }, { 0x2048, 6, 1, 1 }, { 0x206a, 7, 1, 1 }, { 0x2074, 9, 1, 1 }, { 0x207d, 1, 1, 3 }, { 0x207e, 1, 3, 1 }, { 0x207f, 14, 1, 1 }, { 0x208d, 1, 1, 3 }, { 0x208e, 1, 3, 1 }, { 0x20a0, 7, 1, 1 }, { 0x20a7, 1, 3, 1 }, { 0x20a8, 7, 1, 1 }, { 0x20d0, 20, 1, 1 }, { 0x2100, 3, 1, 1 }, { 0x2103, 1, 3, 1 }, { 0x2104, 5, 1, 1 }, { 0x2109, 1, 3, 1 }, { 0x210a, 28, 1, 1 }, { 0x2126, 1, 3, 1 }, { 0x2127, 20, 1, 1 }, { 0x2153, 49, 1, 1 }, { 0x2190, 100, 1, 1 }, { 0x2200, 242, 1, 1 }, { 0x2300, 41, 1, 1 }, { 0x2329, 1, 1, 3 }, { 0x232a, 1, 3, 1 }, { 0x232b, 81, 1, 1 }, { 0x237d, 30, 1, 1 }, { 0x2400, 39, 1, 1 }, { 0x2440, 11, 1, 1 }, { 0x2460, 139, 1, 1 }, { 0x2500, 150, 1, 1 }, { 0x25a0, 88, 1, 1 }, { 0x2600, 20, 1, 1 }, { 0x2619, 89, 1, 1 }, { 0x2701, 4, 1, 1 }, { 0x2706, 4, 1, 1 }, { 0x270c, 28, 1, 1 }, { 0x2729, 35, 1, 1 }, { 0x274d, 1, 1, 1 }, { 0x274f, 4, 1, 1 }, { 0x2756, 1, 1, 1 }, { 0x2758, 7, 1, 1 }, { 0x2761, 7, 1, 1 }, { 0x2776, 31, 1, 1 }, { 0x2798, 24, 1, 1 }, { 0x27b1, 14, 1, 1 }, { 0x2800, 256, 1, 1 }, { 0x3001, 2, 3, 1 }, { 0x3005, 1, 5, 1 }, { 0x3008, 1, 1, 3 }, { 0x3009, 1, 3, 1 }, { 0x300a, 1, 1, 3 }, { 0x300b, 1, 3, 1 }, { 0x300c, 1, 1, 3 }, { 0x300d, 1, 3, 1 }, { 0x300e, 1, 1, 3 }, { 0x300f, 1, 3, 1 }, { 0x3010, 1, 1, 3 }, { 0x3011, 1, 3, 1 }, { 0x3014, 1, 1, 3 }, { 0x3015, 1, 3, 1 }, { 0x3016, 1, 1, 3 }, { 0x3017, 1, 3, 1 }, { 0x3018, 1, 1, 3 }, { 0x3019, 1, 3, 1 }, { 0x301a, 1, 1, 3 }, { 0x301b, 1, 3, 1 }, { 0x301c, 1, 5, 1 }, { 0x301d, 1, 1, 3 }, { 0x301e, 2, 3, 1 }, { 0x3041, 1, 5, 1 }, { 0x3043, 1, 5, 1 }, { 0x3045, 1, 5, 1 }, { 0x3047, 1, 5, 1 }, { 0x3049, 1, 5, 1 }, { 0x3063, 1, 5, 1 }, { 0x3083, 1, 5, 1 }, { 0x3085, 1, 5, 1 }, { 0x3087, 1, 5, 1 }, { 0x308e, 1, 5, 1 }, { 0x309b, 4, 5, 1 }, { 0x30a1, 1, 5, 1 }, { 0x30a3, 1, 5, 1 }, { 0x30a5, 1, 5, 1 }, { 0x30a7, 1, 5, 1 }, { 0x30a9, 1, 5, 1 }, { 0x30c3, 1, 5, 1 }, { 0x30e3, 1, 5, 1 }, { 0x30e5, 1, 5, 1 }, { 0x30e7, 1, 5, 1 }, { 0x30ee, 1, 5, 1 }, { 0x30f5, 2, 5, 1 }, { 0x30fb, 1, 5, 1 }, { 0x30fd, 1, 5, 1 }, { 0xe000, 1, 1, 1 }, { 0xf8ff, 1, 1, 1 }, { 0xfb00, 7, 1, 1 }, { 0xfb13, 5, 1, 1 }, { 0xfb1d, 26, 1, 1 }, { 0xfb38, 5, 1, 1 }, { 0xfb3e, 1, 1, 1 }, { 0xfb40, 2, 1, 1 }, { 0xfb43, 2, 1, 1 }, { 0xfb46, 108, 1, 1 }, { 0xfbd3, 363, 1, 1 }, { 0xfd3e, 1, 1, 3 }, { 0xfd3f, 1, 3, 1 }, { 0xfd50, 64, 1, 1 }, { 0xfd92, 54, 1, 1 }, { 0xfdf0, 12, 1, 1 }, { 0xfe20, 4, 1, 1 }, { 0xfe35, 1, 1, 3 }, { 0xfe36, 1, 3, 1 }, { 0xfe37, 1, 1, 3 }, { 0xfe38, 1, 3, 1 }, { 0xfe39, 1, 1, 3 }, { 0xfe3a, 1, 3, 1 }, { 0xfe3b, 1, 1, 3 }, { 0xfe3c, 1, 3, 1 }, { 0xfe3d, 1, 1, 3 }, { 0xfe3e, 1, 3, 1 }, { 0xfe3f, 1, 1, 3 }, { 0xfe40, 1, 3, 1 }, { 0xfe41, 1, 1, 3 }, { 0xfe42, 1, 3, 1 }, { 0xfe43, 1, 1, 3 }, { 0xfe44, 1, 3, 1 }, { 0xfe50, 1, 3, 1 }, { 0xfe52, 1, 3, 1 }, { 0xfe54, 2, 5, 1 }, { 0xfe56, 2, 1, 1 }, { 0xfe59, 1, 1, 3 }, { 0xfe5a, 1, 3, 1 }, { 0xfe5b, 1, 1, 3 }, { 0xfe5c, 1, 3, 1 }, { 0xfe5d, 1, 1, 3 }, { 0xfe5e, 1, 3, 1 }, { 0xfe69, 1, 1, 1 }, { 0xfe6a, 1, 3, 1 }, { 0xfe6b, 1, 1, 1 }, { 0xfe70, 3, 1, 1 }, { 0xfe74, 1, 1, 1 }, { 0xfe76, 135, 1, 1 }, { 0xfeff, 1, 1, 1 }, { 0xff01, 1, 1, 1 }, { 0xff04, 1, 1, 1 }, { 0xff05, 1, 3, 1 }, { 0xff08, 1, 1, 3 }, { 0xff09, 1, 3, 1 }, { 0xff0c, 1, 3, 1 }, { 0xff0e, 1, 3, 1 }, { 0xff1a, 2, 5, 1 }, { 0xff1f, 1, 1, 1 }, { 0xff3b, 1, 1, 3 }, { 0xff3d, 1, 3, 1 }, { 0xff5b, 1, 1, 3 }, { 0xff5d, 1, 3, 1 }, { 0xff61, 1, 3, 1 }, { 0xff62, 1, 1, 3 }, { 0xff63, 2, 3, 1 }, { 0xff65, 1, 5, 1 }, { 0xff66, 1, 1, 1 }, { 0xff67, 10, 5, 1 }, { 0xff71, 45, 1, 1 }, { 0xff9e, 2, 5, 1 }, { 0xffa0, 31, 1, 1 }, { 0xffc2, 6, 1, 1 }, { 0xffca, 6, 1, 1 }, { 0xffd2, 6, 1, 1 }, { 0xffda, 3, 1, 1 }, { 0xffe0, 1, 3, 1 }, { 0xffe1, 1, 1, 1 }, { 0xffe5, 2, 1, 1 }, { 0xffe8, 7, 1, 1 }, { 0xfff9, 3, 1, 1 }, { 0xfffc, 1, 2, 1 }, #endif OpenJade-1.4devel/style/dsssl_ns.h0000644000021000000240000000155407025631172012674 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef dsssl_ns_INCLUDED #define dsssl_ns_INCLUDED 1 #ifdef DSSSL_NAMESPACE #ifdef SP_NAMESPACE namespace SP_NAMESPACE { } #endif #ifdef GROVE_NAMESPACE namespace GROVE_NAMESPACE { } #endif namespace DSSSL_NAMESPACE { #ifdef SP_NAMESPACE using namespace SP_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #if _MSC_VER >= 1100 /* This works around a bug with using directives in Visual C++ 6.0. I don't know if it also works in 5.0 */ const int work_around_bug_in_visual_c_6 = 0; } namespace DSSSL_NAMESPACE { #ifdef SP_NAMESPACE using namespace SP_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #endif /* _MSC_VER >= 1100 */ } #endif /* DSSSL_NAMESPACE */ #endif /* not dsssl_ns_INCLUDED */ OpenJade-1.4devel/style/primitive.cxx0000644000021000000240000053164507067706750013453 // Copyright (c) 1996 James Clark, 2000 Peter Nilsson // See the file copying.txt for copying permission. #include "stylelib.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "EvalContext.h" #include "SosofoObj.h" #include "Style.h" #include "Insn.h" #include #include "ELObjMessageArg.h" #include "LocNode.h" #include "VM.h" #include "Pattern.h" #include "ELObjPropVal.h" #include #include #include #include #include "LangObj.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class TreeNodeListObj : public NodeListObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } TreeNodeListObj(const NodePtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &); protected: virtual void advance(EvalContext &, Interpreter &) = 0; virtual void chunkAdvance(EvalContext &, Interpreter &) = 0; virtual TreeNodeListObj *copy(Interpreter &) = 0; NodePtr root_; // nodes in node list are strictly after this node NodePtr start_; }; class SubtreeNodeListObj : public TreeNodeListObj { public: SubtreeNodeListObj(const NodePtr &); bool contains(EvalContext &, Interpreter &, const NodePtr &); protected: void advance(EvalContext &, Interpreter &); void chunkAdvance(EvalContext &, Interpreter &); SubtreeNodeListObj *copy(Interpreter &); unsigned depth_; }; class SubgroveNodeListObj : public TreeNodeListObj { public: SubgroveNodeListObj(const NodePtr &); bool contains(EvalContext &, Interpreter &, const NodePtr &); protected: void advance(EvalContext &, Interpreter &); void chunkAdvance(EvalContext &, Interpreter &); SubgroveNodeListObj *copy(Interpreter &); unsigned depth_; }; class DescendantsNodeListObj : public SubtreeNodeListObj { public: DescendantsNodeListObj(const NodePtr &, Interpreter &); bool contains(EvalContext &, Interpreter &, const NodePtr &); protected: DescendantsNodeListObj *copy(Interpreter &); }; class SiblingNodeListObj : public NodeListObj { public: void *operator new(size_t, Collector &c) { return c.allocateObject(1); } SiblingNodeListObj(const NodePtr &first, const NodePtr &end); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &); bool contains(EvalContext &, Interpreter &, const NodePtr &); private: NodePtr first_; NodePtr end_; }; class SelectByClassNodeListObj : public NodeListObj { public: SelectByClassNodeListObj(NodeListObj *nl, ComponentName::Id); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); NodeListObj *nodeListChunkRest(EvalContext &, Interpreter &, bool &); void traceSubObjects(Collector &) const; bool contains(EvalContext &, Interpreter &, const NodePtr &); private: NodeListObj *nodeList_; ComponentName::Id cls_; }; class MapNodeListObj : public NodeListObj { public: class Context : public Resource { public: Context(const EvalContext &, const Location &); void set(EvalContext &) const; void traceSubObjects(Collector &) const; Location loc; private: NodePtr currentNode_; const ProcessingMode *processingMode_; StyleObj *overridingStyle_; bool haveStyleStack_; }; void *operator new(size_t, Collector &c) { return c.allocateObject(1); } MapNodeListObj(FunctionObj *func, NodeListObj *nl, const ConstPtr &, NodeListObj *mapped = 0); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); void traceSubObjects(Collector &) const; bool suppressError(); private: void mapNext(EvalContext &, Interpreter &); NodeListObj *mapped_; protected: FunctionObj *func_; NodeListObj *nl_; ConstPtr context_; }; class FilterNodeListObj : public MapNodeListObj { public: FilterNodeListObj(FunctionObj *func, NodeListObj *nl, const ConstPtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); bool contains(EvalContext &, Interpreter &, const NodePtr &); private: bool maybeIn(EvalContext &, Interpreter &, const NodePtr &); }; class SelectElementsNodeListObj : public NodeListObj { public: struct PatternSet : public Resource, public NCVector { }; void *operator new(size_t, Collector &c) { return c.allocateObject(1); } void traceSubObjects(Collector &c) const; SelectElementsNodeListObj(NodeListObj *, NCVector &); SelectElementsNodeListObj(NodeListObj *, const ConstPtr &); NodePtr nodeListFirst(EvalContext &, Interpreter &); NodeListObj *nodeListRest(EvalContext &, Interpreter &); bool contains(EvalContext &, Interpreter &, const NodePtr &); private: NodeListObj *nodeList_; ConstPtr patterns_; }; #define PRIMITIVE(name, string, nRequired, nOptional, rest, feature) \ class name ## PrimitiveObj : public PrimitiveObj { \ public: \ static const Signature signature_; \ name ## PrimitiveObj() : PrimitiveObj(&signature_) { } \ ELObj *primitiveCall(int, ELObj **, EvalContext &, Interpreter &, const Location &); \ }; \ const Signature name ## PrimitiveObj::signature_ \ = { nRequired, nOptional, rest }; #define SPRIMITIVE PRIMITIVE #define TPRIMITIVE PRIMITIVE #define XPRIMITIVE(name, string, nRequired, nOptional, rest) \ PRIMITIVE(name, string, nRequired, nOptional, rest, noFeature) #define XXPRIMITIVE XPRIMITIVE #define PRIMITIVE2 XPRIMITIVE #include "primitive.h" #undef PRIMITIVE #undef SPRIMITIVE #undef TPRIMITIVE #undef XPRIMITIVE #undef XXPRIMITIVE #undef PRIMITIVE2 #define DEFPRIMITIVE(name, argc, argv, context, interp, loc) \ ELObj *name ## PrimitiveObj \ ::primitiveCall(int argc, ELObj **argv, EvalContext &context, Interpreter &interp, \ const Location &loc) DEFPRIMITIVE(Cons, argc, argv, context, interp, loc) { return new (interp) PairObj(argv[0], argv[1]); } DEFPRIMITIVE(List, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeNil(); PairObj *head = new (interp) PairObj(argv[0], 0); ELObjDynamicRoot protect(interp, head); PairObj *tail = head; for (int i = 1; i < argc; i++) { PairObj *tem = new (interp) PairObj(argv[i], 0); tail->setCdr(tem); tail = tem; } tail->setCdr(interp.makeNil()); return head; } DEFPRIMITIVE(IsNull, argc, argv, context, interp, loc) { if (argv[0]->isNil()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsList, argc, argv, context, interp, loc) { ELObj *obj = argv[0]; for (;;) { PairObj *pair = obj->asPair(); if (pair) obj = pair->cdr(); else if (obj->isNil()) return interp.makeTrue(); else break; } return interp.makeFalse(); } DEFPRIMITIVE(IsEqual, argc, argv, context, interp, loc) { if (ELObj::equal(*argv[0], *argv[1])) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsEqv, argc, argv, context, interp, loc) { if (ELObj::eqv(*argv[0], *argv[1])) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(Car, argc, argv, context, interp, loc) { PairObj *pair = argv[0]->asPair(); if (!pair) return argError(interp, loc, InterpreterMessages::notAPair, 0, argv[0]); else return pair->car(); } DEFPRIMITIVE(Cdr, argc, argv, context, interp, loc) { PairObj *pair = argv[0]->asPair(); if (!pair) return argError(interp, loc, InterpreterMessages::notAPair, 0, argv[0]); else return pair->cdr(); } DEFPRIMITIVE(Append, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeNil(); PairObj *tail = interp.makePair(0, 0); PairObj *head = tail; ELObjDynamicRoot protect(interp, head); for (int i = 0; i < argc - 1; i++) { for (ELObj *p = argv[i]; !p->isNil();) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, i, p); PairObj *newTail = new (interp) PairObj(tem->car(), 0); tail->setCdr(newTail); tail = newTail; p = tem->cdr(); } } tail->setCdr(argv[argc - 1]); return head->cdr(); } DEFPRIMITIVE(Reverse, argc, argv, context, interp, loc) { ELObjDynamicRoot protect(interp, interp.makeNil()); ELObj *p = argv[0]; while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); protect = new (interp) PairObj(tem->car(), protect); p = tem->cdr(); } return protect; } DEFPRIMITIVE(ListTail, argc, argv, context, interp, loc) { long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (k < 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } ELObj *p = argv[0]; for (; k > 0; k--) { PairObj *tem = p->asPair(); if (!tem) { if (p->isNil()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } else return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); } p = tem->cdr(); } return p; } DEFPRIMITIVE(ListRef, argc, argv, context, interp, loc) { long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (k < 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } ELObj *p = argv[0]; for (;;) { PairObj *tem = p->asPair(); if (!tem) break; if (k == 0) return tem->car(); --k; p = tem->cdr(); } if (p->isNil()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } else return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); } DEFPRIMITIVE(Member, argc, argv, context, interp, loc) { ELObj *p = argv[1]; while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 1, argv[1]); if (ELObj::equal(*argv[0], *tem->car())) return p; p = tem->cdr(); } return interp.makeFalse(); } DEFPRIMITIVE(Memv, argc, argv, context, interp, loc) { ELObj *p = argv[1]; while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 1, argv[1]); if (ELObj::eqv(*argv[0], *tem->car())) return p; p = tem->cdr(); } return interp.makeFalse(); } DEFPRIMITIVE(Length, argc, argv, context, interp, loc) { ELObj *obj = argv[0]; long n = 0; for (;;) { PairObj *pair = obj->asPair(); if (pair) { n++; obj = pair->cdr(); } else if (obj->isNil()) break; else if (interp.isError(obj)) return obj; else return argError(interp, loc, InterpreterMessages::notAList, 0, obj); } return interp.makeInteger(n); } DEFPRIMITIVE(Not, argc, argv, context, interp, loc) { if (argv[0]->isTrue()) return interp.makeFalse(); else return interp.makeTrue(); } DEFPRIMITIVE(IsSymbol, argc, argv, context, interp, loc) { if (argv[0]->asSymbol()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsKeyword, argc, argv, context, interp, loc) { if (argv[0]->asKeyword()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsInteger, argc, argv, context, interp, loc) { long n; if (argv[0]->exactIntegerValue(n)) return interp.makeTrue(); double x; if (argv[0]->realValue(x) && modf(x, &x) == 0.0) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsReal, argc, argv, context, interp, loc) { double x; if (argv[0]->realValue(x)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsNumber, argc, argv, context, interp, loc) { double x; if (argv[0]->realValue(x)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsQuantity, argc, argv, context, interp, loc) { long n; double d; int dim; if (argv[0]->quantityValue(n, d, dim) != ELObj::noQuantity) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsPair, argc, argv, context, interp, loc) { if (argv[0]->asPair()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsProcedure, argc, argv, context, interp, loc) { if (argv[0]->asFunction()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsBoolean, argc, argv, context, interp, loc) { if (argv[0] == interp.makeTrue()) return argv[0]; else if (argv[0] == interp.makeFalse()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsChar, argc, argv, context, interp, loc) { Char c; if (argv[0]->charValue(c)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsCharEqual, argc, argv, context, interp, loc) { Char c1, c2; if (!argv[0]->charValue(c1)) return argError(interp, loc, InterpreterMessages::notAChar, 0, argv[0]); if (!argv[1]->charValue(c2)) return argError(interp, loc, InterpreterMessages::notAChar, 1, argv[1]); if (c1 == c2) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(String, argc, argv, context, interp, loc) { StringObj *obj = new (interp) StringObj; for (int i = 0; i < argc; i++) { Char c; if (!argv[i]->charValue(c)) return argError(interp, loc, InterpreterMessages::notAChar, i, argv[i]); *obj += c; } return obj; } DEFPRIMITIVE(SymbolToString, argc, argv, context, interp, loc) { SymbolObj *obj = argv[0]->asSymbol(); if (!obj) return argError(interp, loc, InterpreterMessages::notASymbol, 0, argv[0]); return obj->name(); } DEFPRIMITIVE(StringToSymbol, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return interp.makeSymbol(StringC(s, n)); } DEFPRIMITIVE(IsString, argc, argv, context, interp, loc) { const Char *s; size_t n; if (argv[0]->stringData(s, n)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(StringLength, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return interp.makeInteger(n); } DEFPRIMITIVE(IsStringEqual, argc, argv, context, interp, loc) { const Char *s1, *s2; size_t n1, n2; if (!argv[0]->stringData(s1, n1)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (!argv[1]->stringData(s2, n2)) return argError(interp, loc, InterpreterMessages::notAString, 1, argv[1]); if (n1 == n2 && (n1 == 0 || memcmp(s1, s2, n1*sizeof(Char)) == 0)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(StringAppend, argc, argv, context, interp, loc) { StringObj *result = new (interp) StringObj; for (int i = 0; i < argc; i++) { const Char *s; size_t n; if (!argv[i]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); result->append(s, n); } return result; } DEFPRIMITIVE(StringRef, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (k < 0 || (unsigned long)k >= n) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return interp.makeChar(s[size_t(k)]); } DEFPRIMITIVE(Substring, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); long start; if (!argv[1]->exactIntegerValue(start)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); long end; if (!argv[2]->exactIntegerValue(end)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 2, argv[2]); if (start < 0 || (unsigned long)end > n || start > end) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return new (interp) StringObj(s + size_t(start), size_t(end - start)); } DEFPRIMITIVE(Equal, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeTrue(); long lResult; double dResult; int dim; int i = 1; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: break; case ELObj::doubleQuantity: goto useDouble; break; default: CANNOT_HAPPEN(); } long lResult2; double dResult2; int dim2; for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (lResult2 != lResult || dim2 != dim) return interp.makeFalse(); break; case ELObj::doubleQuantity: dResult = lResult; if (dResult2 != dResult || dim2 != dim) return interp.makeFalse(); i++; goto useDouble; default: CANNOT_HAPPEN(); } } return interp.makeTrue(); useDouble: for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (lResult2 != dResult || dim2 != dim) return interp.makeFalse(); break; case ELObj::doubleQuantity: if (dResult2 != dResult || dim2 != dim) return interp.makeFalse(); break; } } return interp.makeTrue(); } DEFPRIMITIVE(Plus, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeInteger(0); long lResult; double dResult; bool usingD; bool spec = 0; int dim; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: dim = 1; spec = 1; break; case ELObj::longQuantity: usingD = 0; break; case ELObj::doubleQuantity: usingD = 1; break; default: CANNOT_HAPPEN(); } for (int i = 1; !spec && i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: // FIXME shouldn't quantityValue set dim to 1 for length-specs ? dim2 = 1; spec = 1; break; case ELObj::longQuantity: if (!usingD) { if (lResult2 < 0) { if (lResult >= LONG_MIN - lResult2) { lResult += lResult2; break; } } else { if (lResult <= LONG_MAX - lResult2) { lResult += lResult2; break; } } usingD = 1; dResult = double(lResult); } dResult += double(lResult2); break; case ELObj::doubleQuantity: if (!usingD) { dResult = lResult; usingD = 1; } dResult += dResult2; break; default: CANNOT_HAPPEN(); } if (dim2 != dim) { interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } } if (spec) { LengthSpec ls; for (int i = 0; i < argc; i++) { const LengthSpec *lsp = argv[i]->lengthSpec(); if (lsp) ls += *lsp; else { switch (argv[i]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantityOrLengthSpec, i, argv[i]); case ELObj::longQuantity: dResult = lResult; // fall through case ELObj::doubleQuantity: if (dim != 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } ls += dResult; break; } } } return new (interp) LengthSpecObj(ls); } if (!usingD) { if (dim == 0) return interp.makeInteger(lResult); else if (dim == 1) return new (interp) LengthObj(lResult); else dResult = lResult; } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); } DEFPRIMITIVE(Minus, argc, argv, context, interp, loc) { long lResult; double dResult; bool usingD; bool spec = 0; int dim; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: spec = 1; break; case ELObj::longQuantity: usingD = 0; break; case ELObj::doubleQuantity: usingD = 1; break; default: CANNOT_HAPPEN(); } if (argc == 1) { if (usingD) dResult = -dResult; else lResult = -lResult; } else { for (int i = 1; !spec && i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: dim2 = dim; spec = 1; break; case ELObj::longQuantity: if (!usingD) { if (lResult2 > 0) { if (lResult >= LONG_MIN + lResult2) { lResult -= lResult2; break; } } else { if (lResult <= LONG_MAX + lResult2) { lResult -= lResult2; break; } } usingD = 1; dResult = double(lResult); } dResult -= double(lResult2); break; case ELObj::doubleQuantity: if (!usingD) { dResult = lResult; usingD = 1; } dResult -= dResult2; break; default: CANNOT_HAPPEN(); } if (dim2 != dim) { interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } } } if (spec) { LengthSpec ls; for (int i = 0; i < argc; i++) { const LengthSpec *lsp = argv[i]->lengthSpec(); if (lsp) { if (i > 0 || argc == 1) ls -= *lsp; else ls += *lsp; } else { switch (argv[i]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantityOrLengthSpec, i, argv[i]); case ELObj::longQuantity: dResult = lResult; // fall through case ELObj::doubleQuantity: if (dim != 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } if (i > 0 || argc == 1) ls -= dResult; else ls += dResult; break; } } } return new (interp) LengthSpecObj(ls); } if (!usingD) { if (dim == 0) return interp.makeInteger(lResult); else if (dim == 1) return new (interp) LengthObj(lResult); else dResult = lResult; } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); } DEFPRIMITIVE(Multiply, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeInteger(1); long lResult; double dResult; int dim; int i = 1; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: { const LengthSpec *ls = argv[0]->lengthSpec(); if (ls) { LengthSpec result(*ls); double d; for (; i < argc; i++) { if (!argv[i]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 1, argv[1]); result *= d; } return new (interp) LengthSpecObj(result); } } return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: break; case ELObj::doubleQuantity: goto useDouble; default: CANNOT_HAPPEN(); } long lResult2; double dResult2; int dim2; for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: dim += dim2; if (dim > 1 || (lResult2 != 0 && (lResult2 < 0 ? (lResult > 0 ? lResult > -(unsigned)LONG_MIN / -(unsigned)lResult2 : -(unsigned)lResult > LONG_MAX / -(unsigned)lResult2) : (lResult > 0 ? lResult > LONG_MAX / lResult2 : -(unsigned)lResult > -(unsigned)LONG_MIN / lResult2)))) { dResult = double(lResult) * lResult2; i++; goto useDouble; } lResult *= lResult2; break; case ELObj::doubleQuantity: dim += dim2; dResult = lResult * dResult2; i++; goto useDouble; default: CANNOT_HAPPEN(); } } if (dim == 0) return interp.makeInteger(lResult); else return new (interp) LengthObj(lResult); useDouble: for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: dResult *= lResult2; break; case ELObj::doubleQuantity: dResult *= dResult2; break; } dim += dim2; } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); } DEFPRIMITIVE(Divide, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; if (argc == 1) { switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: if (lResult == 0) goto divide0; dResult = 1.0/lResult; break; case ELObj::doubleQuantity: if (dResult == 0.0) goto divide0; dResult = 1.0/dResult; break; default: CANNOT_HAPPEN(); } dim = -dim; } else { int i = 1; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: { const LengthSpec *ls = argv[0]->lengthSpec(); if (ls) { LengthSpec result(*ls); double d; for (; i < argc; i++) { if (!argv[i]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 1, argv[1]); if (d == 0.0) goto divide0; result /= d; } return new (interp) LengthSpecObj(result); } } return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: break; case ELObj::doubleQuantity: goto useDouble; default: CANNOT_HAPPEN(); } long lResult2; double dResult2; int dim2; for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: if (lResult2 == 0) goto divide0; dim -= dim2; // If dim and dim2 are both 1, must goto useDouble: // since lengths are inexact, result must be inexact. if (dim2 == 0 && lResult % lResult2 == 0) { lResult /= lResult2; break; } dResult = double(lResult)/lResult2; i++; goto useDouble; case ELObj::doubleQuantity: dim -= dim2; dResult = lResult; if (dResult2 == 0.0) goto divide0; dResult /= dResult2; i++; goto useDouble; default: CANNOT_HAPPEN(); } } if (dim == 0) return interp.makeInteger(lResult); else return new (interp) LengthObj(lResult); useDouble: for (; i < argc; i++) { switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (lResult2 == 0) goto divide0; dResult /= lResult2; break; case ELObj::doubleQuantity: dResult /= dResult2; if (dResult2 == 0.0) goto divide0; break; } dim -= dim2; } } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); divide0: interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } DEFPRIMITIVE(Quotient, argc, argv, context, interp, loc) { long n1; long n2; if (argv[0]->exactIntegerValue(n1) && argv[1]->exactIntegerValue(n2)) { if (n2 == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } // This isn't strictly portable. return interp.makeInteger(n1 / n2); } double d1; if (!argv[0]->realValue(d1) || modf(d1, &d1) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); double d2; if (!argv[1]->realValue(d2) || modf(d2, &d2) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (d2 == 0.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } return new (interp) RealObj((d1 - fmod(d1, d2))/d2); } DEFPRIMITIVE(Remainder, argc, argv, context, interp, loc) { long n1; long n2; if (argv[0]->exactIntegerValue(n1) && argv[1]->exactIntegerValue(n2)) { if (n2 == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } // This isn't strictly portable. return interp.makeInteger(n1 % n2); } double d1; if (!argv[0]->realValue(d1) || modf(d1, &d1) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); double d2; if (!argv[1]->realValue(d2) || modf(d2, &d2) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (d2 == 0.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } return new (interp) RealObj(fmod(d1, d2)); } DEFPRIMITIVE(Modulo, argc, argv, context, interp, loc) { long n1; long n2; if (argv[0]->exactIntegerValue(n1) && argv[1]->exactIntegerValue(n2)) { if (n2 == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } long r = n1 % n2; if (n2 > 0 ? r < 0 : r > 0) r += n2; return interp.makeInteger(r); } double d1; if (!argv[0]->realValue(d1) || modf(d1, &d1) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); double d2; if (!argv[1]->realValue(d2) || modf(d2, &d2) != 0.0) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (d2 == 0.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::divideBy0); return interp.makeError(); } double r = fmod(d1, d2); if (d2 > 0 ? r < 0 : r > 0) r += d2; return new (interp) RealObj(r); } #define DEFCOMPARE(NAME, OP) \ DEFPRIMITIVE(NAME, argc, argv, context, interp, loc) \ { \ if (argc == 0) \ return interp.makeTrue(); \ long lResult; \ double dResult; \ int dim; \ bool lastWasDouble; \ switch (argv[0]->quantityValue(lResult, dResult, dim)) { \ case ELObj::noQuantity: \ return argError(interp, loc, \ InterpreterMessages::notAQuantity, 0, argv[0]); \ case ELObj::longQuantity: \ lastWasDouble = 0; \ break; \ case ELObj::doubleQuantity: \ lastWasDouble = 1; \ break; \ default: \ CANNOT_HAPPEN(); \ } \ for (int i = 1; i < argc; i++) { \ long lResult2; \ double dResult2; \ int dim2; \ switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { \ case ELObj::noQuantity: \ return argError(interp, loc, \ InterpreterMessages::notAQuantity, i, argv[i]); \ case ELObj::longQuantity: \ if (dim2 != dim) \ goto badDim; \ if (!(lastWasDouble \ ? (dResult OP lResult2) \ : (lResult OP lResult2))) \ return interp.makeFalse(); \ lResult = lResult2; \ lastWasDouble = 0; \ break; \ case ELObj::doubleQuantity: \ if (dim != dim2) \ goto badDim; \ if (!(lastWasDouble \ ? (dResult OP dResult2) \ : (lResult OP dResult2))) \ return interp.makeFalse(); \ dResult = dResult2; \ lastWasDouble = 1; \ break; \ } \ } \ return interp.makeTrue(); \ badDim: \ interp.setNextLocation(loc); \ interp.message(InterpreterMessages::incompatibleDimensions); \ return interp.makeError(); \ } DEFCOMPARE(Less, <) DEFCOMPARE(Greater, >) DEFCOMPARE(LessEqual, <=) DEFCOMPARE(GreaterEqual, >=) DEFPRIMITIVE(Min, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; int i = 1; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: break; case ELObj::doubleQuantity: goto useDouble; default: CANNOT_HAPPEN(); } // Note that result is inexact if any of the arguments are for (; i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (dim2 != dim) goto badDim; if (lResult2 < lResult) lResult = lResult2; break; case ELObj::doubleQuantity: if (dim != dim2) goto badDim; if (dResult2 < lResult) dResult = dResult2; else if (dim) break; else dResult = lResult; i++; goto useDouble; } } if (dim == 0) return interp.makeInteger(lResult); else return new (interp) LengthObj(lResult); useDouble: for (; i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (dim2 != dim) goto badDim; if (lResult2 < dResult) dResult = lResult2; break; case ELObj::doubleQuantity: if (dim != dim2) goto badDim; if (dResult2 < dResult) dResult = dResult2; break; } } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); badDim: interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } DEFPRIMITIVE(Max, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; int i = 1; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: break; case ELObj::doubleQuantity: goto useDouble; default: CANNOT_HAPPEN(); } // Note that result is inexact if any of the arguments are for (; i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (dim2 != dim) goto badDim; if (lResult2 > lResult) lResult = lResult2; break; case ELObj::doubleQuantity: if (dim != dim2) goto badDim; if (dResult2 > lResult) dResult = dResult2; else if (dim) break; else dResult = lResult; i++; goto useDouble; } } if (dim == 0) return interp.makeInteger(lResult); else return new (interp) LengthObj(lResult); useDouble: for (; i < argc; i++) { long lResult2; double dResult2; int dim2; switch (argv[i]->quantityValue(lResult2, dResult2, dim2)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, i, argv[i]); case ELObj::longQuantity: if (dim2 != dim) goto badDim; if (lResult2 > dResult) dResult = lResult2; break; case ELObj::doubleQuantity: if (dim != dim2) goto badDim; if (dResult2 > dResult) dResult = dResult2; break; } } if (dim == 0) return new (interp) RealObj(dResult); else return new (interp) QuantityObj(dResult, dim); badDim: interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } DEFPRIMITIVE(Floor, argc, argv, context, interp, loc) { double d; if (argv[0]->inexactRealValue(d)) return new (interp) RealObj(floor(d)); long n; if (argv[0]->exactIntegerValue(n)) return argv[0]; return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); } DEFPRIMITIVE(Ceiling, argc, argv, context, interp, loc) { double d; if (argv[0]->inexactRealValue(d)) return new (interp) RealObj(ceil(d)); long n; if (argv[0]->exactIntegerValue(n)) return argv[0]; return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); } DEFPRIMITIVE(Round, argc, argv, context, interp, loc) { double d; if (argv[0]->inexactRealValue(d)) { double result = floor(d + .5); // That rounded it upwards. // Now figure out if that was different from round to // even. if (result - d == 0.5 && fmod(result, 2.0) != 0) result -= 1.0; return new (interp) RealObj(result); } long n; if (argv[0]->exactIntegerValue(n)) return argv[0]; return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); } DEFPRIMITIVE(Truncate, argc, argv, context, interp, loc) { double d; if (argv[0]->inexactRealValue(d)) { double iPart; modf(d, &iPart); return new (interp) RealObj(iPart); } long n; if (argv[0]->exactIntegerValue(n)) return argv[0]; return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); } DEFPRIMITIVE(Abs, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; switch (argv[0]->quantityValue(lResult, dResult, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: if (lResult != LONG_MIN) { if (lResult >= 0) return argv[0]; if (dim == 0) return interp.makeInteger(-lResult); else return new (interp) LengthObj(-lResult); } dResult = lResult; break; case ELObj::doubleQuantity: break; default: CANNOT_HAPPEN(); } if (dResult >= 0) return argv[0]; if (dim == 0) return new (interp) RealObj(-dResult); else return new (interp) QuantityObj(-dResult, dim); } DEFPRIMITIVE(Sqrt, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; ELObj::QuantityType type = argv[0]->quantityValue(lResult, dResult, dim); switch (type) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::longQuantity: dResult = lResult; break; case ELObj::doubleQuantity: break; default: CANNOT_HAPPEN(); } if ((dim & 1) || dResult < 0.0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } dim /= 2; dResult = sqrt(dResult); if (type == ELObj::longQuantity && dim == 0) { long n = long(dResult); if (n*n == lResult) return interp.makeInteger(n); } return new (interp) QuantityObj(dResult, dim); } DEFPRIMITIVE(Time, argc, argv, context, interp, loc) { // This assumes a Posix compatible time(). time_t t = time(0); return interp.makeInteger(long(t)); } DEFPRIMITIVE(TimeToString, argc, argv, context, interp, loc) { long k; if (!argv[0]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); time_t t = time_t(k); const struct tm *p; if (argc > 1 && argv[1] != interp.makeFalse()) p = gmtime(&t); else p = localtime(&t); char buf[64]; sprintf(buf, "%04d-%02d-%02dT%02d:%02d:%02d", p->tm_year + 1900, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); return new (interp) StringObj(interp.makeStringC(buf)); } DEFPRIMITIVE(CharProperty, argc, argv, context, interp, loc) { SymbolObj *sym = argv[0]->asSymbol(); if (!sym) return argError(interp, loc, InterpreterMessages::notASymbol, 0, argv[0]); StringObj *prop = argv[0]->asSymbol()->convertToString(); Char c; if (!argv[1]->charValue(c)) return argError(interp, loc, InterpreterMessages::notAChar, 1, argv[1]); return interp.lookupCharProperty(*prop)-> value(c, (argc > 2) ? argv[2] : 0, loc, interp); } DEFPRIMITIVE(Literal, argc, argv, context, interp, loc) { if (argc == 0) return new (interp) EmptySosofoObj; const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (argc == 1) return new (interp) LiteralSosofoObj(argv[0], loc); StringObj *strObj = new (interp) StringObj(s, n); for (int i = 1; i < argc; i++) { if (!argv[i]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); strObj->append(s, n); } ELObjDynamicRoot protect(interp, strObj); return new (interp) LiteralSosofoObj(strObj, loc); } DEFPRIMITIVE(ProcessChildren, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } return new (interp) ProcessChildrenSosofoObj(context.processingMode, loc); } DEFPRIMITIVE(ProcessChildrenTrim, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } return new (interp) ProcessChildrenTrimSosofoObj(context.processingMode, loc); } DEFPRIMITIVE(SosofoAppend, argc, argv, context, interp, loc) { AppendSosofoObj *obj = new (interp) AppendSosofoObj; for (int i = 0; i < argc; i++) { SosofoObj *sosofo = argv[i]->asSosofo(); if (!sosofo) return argError(interp, loc, InterpreterMessages::notASosofo, i, argv[i]); obj->append(sosofo); } return obj; } DEFPRIMITIVE(NextMatch, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } StyleObj *style; if (argc == 0) style = 0; else { style = argv[0]->asStyle(); if (!style) return argError(interp, loc, InterpreterMessages::notAStyle, 0, argv[0]); } return new (interp) NextMatchSosofoObj(style, loc); } DEFPRIMITIVE(EmptySosofo, argc, argv, context, interp, loc) { return new (interp) EmptySosofoObj; } DEFPRIMITIVE(SosofoLabel, argc, argv, context, interp, loc) { SosofoObj *sosofo = argv[0]->asSosofo(); if (!sosofo) return argError(interp, loc, InterpreterMessages::notASosofo, 0, argv[0]); SymbolObj *sym = argv[1]->asSymbol(); if (!sym) return argError(interp, loc, InterpreterMessages::notASymbol, 1, argv[1]); return new (interp) LabelSosofoObj(sym, loc, sosofo); } DEFPRIMITIVE(SosofoDiscardLabeled, argc, argv, context, interp, loc) { SosofoObj *sosofo = argv[0]->asSosofo(); if (!sosofo) return argError(interp, loc, InterpreterMessages::notASosofo, 0, argv[0]); SymbolObj *sym = argv[1]->asSymbol(); if (!sym) return argError(interp, loc, InterpreterMessages::notASymbol, 1, argv[1]); return new (interp) DiscardLabeledSosofoObj(sym, sosofo); } DEFPRIMITIVE(IsSosofo, argc, argv, context, interp, loc) { if (argv[0]->asSosofo()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(MergeStyle, argc, argv, context, interp, loc) { MergeStyleObj *merged = new (interp) MergeStyleObj; for (int i = 0; i < argc; i++) { StyleObj *style = argv[i]->asStyle(); if (!style) return argError(interp, loc, InterpreterMessages::notAStyle, i, argv[i]); merged->append(style); } return merged; } DEFPRIMITIVE(IsStyle, argc, argv, context, interp, loc) { if (argv[0]->asStyle()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(CurrentNodePageNumberSosofo, argc, argv, context, interp, loc) { if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) CurrentNodePageNumberSosofoObj(context.currentNode); } DEFPRIMITIVE(PageNumberSosofo, argc, argv, context, interp, loc) { return new (interp) PageNumberSosofoObj; } DEFPRIMITIVE(ProcessElementWithId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (!context.currentNode) return noCurrentNodeError(interp, loc); if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } NodePtr root; NamedNodeListPtr elements; if (context.currentNode->getGroveRoot(root) == accessOK && root->getElements(elements) == accessOK) { NodePtr node; if (elements->namedNode(GroveString(s, n), node) == accessOK) return new (interp) ProcessNodeSosofoObj(node, context.processingMode, loc); } return new (interp) EmptySosofoObj; } DEFPRIMITIVE(ProcessFirstDescendant, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } if (!context.currentNode) return noCurrentNodeError(interp, loc); NCVector patterns(argc); for (size_t i = 0; i < argc; i++) { if (!interp.convertToPattern(argv[i], loc, patterns[i])) return interp.makeError(); } NodeListObj *nl = new (interp) DescendantsNodeListObj(context.currentNode, interp); ELObjDynamicRoot protect(interp, nl); nl = new (interp) SelectElementsNodeListObj(nl, patterns); protect = nl; NodePtr nd(nl->nodeListFirst(context, interp)); if (!nd) return new (interp) EmptySosofoObj; return new (interp) ProcessNodeSosofoObj(nd, context.processingMode, loc); } DEFPRIMITIVE(ProcessMatchingChildren, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } if (!context.currentNode) return noCurrentNodeError(interp, loc); NCVector patterns(argc); for (size_t i = 0; i < argc; i++) { if (!interp.convertToPattern(argv[i], loc, patterns[i])) return interp.makeError(); } NodeListPtr nlPtr; // FIXME handle root if (patterns.size() == 0 || context.currentNode->children(nlPtr) != accessOK) return new (interp) EmptySosofoObj; NodeListObj *nl = new (interp) NodeListPtrNodeListObj(nlPtr); ELObjDynamicRoot protect(interp, nl); nl = new (interp) SelectElementsNodeListObj(nl, patterns); protect = nl; return new (interp) ProcessNodeListSosofoObj(nl, context.processingMode, loc); } DEFPRIMITIVE(SelectElements, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); NCVector patterns(1); if (!interp.convertToPattern(argv[1], loc, patterns[0])) return interp.makeError(); return new (interp) SelectElementsNodeListObj(nl, patterns); } DEFPRIMITIVE(IsMatchElement, argc, argv, context, interp, loc) { Pattern pattern; if (!interp.convertToPattern(argv[0], loc, pattern)) return interp.makeError(); NodePtr node; if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); if (pattern.matches(node, interp)) return interp.makeTrue(); return interp.makeFalse(); } DEFPRIMITIVE(IsNodeListContains, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); NodePtr node; if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); if (nl->contains(context, interp, node)) return interp.makeTrue(); return interp.makeFalse(); } DEFPRIMITIVE(ProcessNodeList, argc, argv, context, interp, loc) { if (!context.processingMode) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noCurrentProcessingMode); return interp.makeError(); } NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); return new (interp) ProcessNodeListSosofoObj(nl, context.processingMode, loc); } static void reverse(StringC &s) { size_t i = 0; size_t j = s.size() - 1; while (i < j) { Char tem = s[i]; s[i] = s[j]; s[j] = tem; i++; j--; } } static StringC formatNumberLetter(long n, const char *letters) { StringC result; if (n == 0) result += '0'; else { bool neg; // FIXME possibility of overflow if (n < 0) { n = -n; neg = 1; } else neg = 0; do { n--; int r = n % 26; n -= r; n /= 26; result += letters[r]; } while (n > 0); if (neg) result += '-'; reverse(result); } return result; } static StringC formatNumberDecimal(long n, size_t minWidth) { StringC result; char buf[32]; sprintf(buf, "%ld", n); const char *p = buf; if (*p == '-') { p++; result += '-'; } size_t len = strlen(p); while (len < minWidth) { result += '0'; len++; } while (*p) result += *p++; return result; } static StringC formatNumberRoman(long n, const char *letters) { StringC result; if (n > 5000 || n < -5000 || n == 0) return formatNumberDecimal(n, 1); if (n < 0) { n = -n; result += '-'; } while (n >= 1000) { result += letters[0]; n -= 1000; } for (int i = 100; i > 0; i /= 10, letters += 2) { long q = n / i; n -= q * i; switch (q) { case 1: result += letters[2]; break; case 2: result += letters[2]; result += letters[2]; break; case 3: result += letters[2]; result += letters[2]; result += letters[2]; break; case 4: result += letters[2]; result += letters[1]; break; case 5: result += letters[1]; break; case 6: result += letters[1]; result += letters[2]; break; case 7: result += letters[1]; result += letters[2]; result += letters[2]; break; case 8: result += letters[1]; result += letters[2]; result += letters[2]; result += letters[2]; break; case 9: result += letters[2]; result += letters[0]; break; } } return result; } static bool formatNumber(long n, const Char *s, size_t len, StringC &result) { if (len > 0) { switch (s[len - 1]) { case 'a': result += formatNumberLetter(n, "abcdefghijklmnopqrstuvwxyz"); return 1; case 'A': result += formatNumberLetter(n, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); return 1; case 'i': result += formatNumberRoman(n, "mdclxvi"); return 1; case 'I': result += formatNumberRoman(n, "MDCLXVI"); return 1; case '1': result += formatNumberDecimal(n, len); return 1; default: break; } } result += formatNumberDecimal(n, 1); return 0; } DEFPRIMITIVE(FormatNumber, argc, argv, context, interp, loc) { long n; if (!argv[0]->exactIntegerValue(n)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); const Char *s; size_t len; if (!argv[1]->stringData(s, len)) return argError(interp, loc, InterpreterMessages::notAString, 1, argv[1]); StringObj *result = new (interp) StringObj; if (!formatNumber(n, s, len, *result)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidNumberFormat, StringMessageArg(StringC(s, len))); } return result; } DEFPRIMITIVE(FormatNumberList, argc, argv, context, interp, loc) { ELObj *numbers = argv[0]; ELObj *formats = argv[1]; ELObj *seps = argv[2]; StringObj *result = new (interp) StringObj; while (!numbers->isNil()) { PairObj *tem; const Char *s; size_t len; if (numbers != argv[0]) { if (!seps->stringData(s, len)) { tem = seps->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 2, argv[2]); if (!tem->car()->stringData(s, len)) return argError(interp, loc, InterpreterMessages::notAString, 2, tem->car()); seps = tem->cdr(); } result->append(s, len); } tem = numbers->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); long k; if (!tem->car()->exactIntegerValue(k)) // FIXME message not quite right return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, tem->car()); numbers = tem->cdr(); if (!formats->stringData(s, len)) { tem = formats->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 1, argv[1]); if (!tem->car()->stringData(s, len)) return argError(interp, loc, InterpreterMessages::notAString, 0, tem->car()); formats = tem->cdr(); } if (!formatNumber(k, s, len, *result)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidNumberFormat, StringMessageArg(StringC(s, len))); } } return result; } DEFPRIMITIVE(ExternalProcedure, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC tem(s, n); FunctionObj *func = interp.lookupExternalProc(tem); if (func) return func; return interp.makeFalse(); } DEFPRIMITIVE(Error, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); interp.setNextLocation(loc); interp.message(InterpreterMessages::errorProc, StringMessageArg(StringC(s, n))); return interp.makeError(); } DEFPRIMITIVE(StringToNumber, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); long radix; if (argc > 1) { if (!argv[1]->exactIntegerValue(radix)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); switch (radix) { case 2: case 8: case 10: case 16: break; default: interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidRadix); radix = 10; break; } } else radix = 10; ELObj *result = interp.convertNumber(StringC(s, n), int(radix)); if (result) { result = result->resolveQuantities(0, interp, loc); if (interp.isError(result)) return result; long n; double d; int dim; if (result->quantityValue(n, d, dim) != ELObj::noQuantity) return result; } return interp.makeFalse(); } DEFPRIMITIVE(NumberToString, argc, argv, context, interp, loc) { double x; if (!argv[0]->realValue(x)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); unsigned radix; if (argc > 1) { long r; if (!argv[1]->exactIntegerValue(r)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); switch (r) { case 2: case 8: case 10: case 16: radix = unsigned(r); break; default: interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidRadix); radix = 10; break; } } else radix = 10; StrOutputCharStream os; argv[0]->print(interp, os, radix); StringC tem; os.extractString(tem); return new (interp) StringObj(tem); } DEFPRIMITIVE(QuantityToString, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; if (argv[0]->quantityValue(lResult, dResult, dim) == ELObj::noQuantity) return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); unsigned radix; if (argc > 1) { long r; if (!argv[1]->exactIntegerValue(r)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); switch (r) { case 2: case 8: case 10: case 16: radix = unsigned(r); break; default: interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidRadix); radix = 10; break; } } else radix = 10; StrOutputCharStream os; argv[0]->print(interp, os, radix); StringC tem; os.extractString(tem); return new (interp) StringObj(tem); } DEFPRIMITIVE(DisplaySize, argc, argv, context, interp, loc) { return new (interp) LengthSpecObj(LengthSpec(LengthSpec::displaySize, 1.0)); } DEFPRIMITIVE(TableUnit, argc, argv, context, interp, loc) { long k; if (!argv[0]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); return new (interp) LengthSpecObj(LengthSpec(LengthSpec::tableUnit, double(k))); } DEFPRIMITIVE(IsDisplaySpace, argc, argv, context, interp, loc) { if (argv[0]->asDisplaySpace()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(DisplaySpace, argc, argv, context, interp, loc) { FOTBuilder::DisplaySpace displaySpace; if (!interp.convertLengthSpec(argv[0], displaySpace.nominal)) return argError(interp, loc, InterpreterMessages::notALengthSpec, 0, argv[0]); displaySpace.min = displaySpace.nominal; displaySpace.max = displaySpace.nominal; // first specified keyword argument takes priority, // so scan them backwards... for (int i = argc - 1; i > 0; i -= 2) { if ((argc & 1) == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::oddKeyArgs); return interp.makeError(); } KeywordObj *keyObj = argv[i - 1]->asKeyword(); if (!keyObj) { interp.setNextLocation(loc); interp.message(InterpreterMessages::keyArgsNotKey); return interp.makeError(); } Identifier::SyntacticKey key; if (!keyObj->identifier()->syntacticKey(key)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidKeyArg, StringMessageArg(keyObj->identifier()->name())); return interp.makeError(); } else { switch (key) { case Identifier::keyMin: if (!interp.convertLengthSpec(argv[i], displaySpace.min)) return argError(interp, loc, InterpreterMessages::notALengthSpec, i, argv[i]); break; case Identifier::keyMax: if (!interp.convertLengthSpec(argv[i], displaySpace.max)) return argError(interp, loc, InterpreterMessages::notALengthSpec, i, argv[i]); break; case Identifier::keyIsConditional: if (argv[i] == interp.makeTrue()) displaySpace.conditional = 1; else if (argv[i] == interp.makeFalse()) displaySpace.conditional = 0; else return argError(interp, loc, InterpreterMessages::notABoolean, i, argv[i]); break; case Identifier::keyPriority: if (argv[i]->exactIntegerValue(displaySpace.priority)) displaySpace.force = 0; else { SymbolObj *sym = argv[i]->asSymbol(); if (sym && sym->cValue() == FOTBuilder::symbolForce) displaySpace.force = 1; else return argError(interp, loc, InterpreterMessages::notAPriority, i, argv[i]); } break; default: interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidKeyArg, StringMessageArg(keyObj->identifier()->name())); return interp.makeError(); } } } return new (interp) DisplaySpaceObj(displaySpace); } DEFPRIMITIVE(IsInlineSpace, argc, argv, context, interp, loc) { if (argv[0]->asInlineSpace()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(InlineSpace, argc, argv, context, interp, loc) { FOTBuilder::InlineSpace inlineSpace; if (!interp.convertLengthSpec(argv[0], inlineSpace.nominal)) return argError(interp, loc, InterpreterMessages::notALengthSpec, 0, argv[0]); inlineSpace.min = inlineSpace.nominal; inlineSpace.max = inlineSpace.nominal; // first specified keyword argument takes priority, // so scan them backwards... for (int i = argc - 1; i > 0; i -= 2) { if ((argc & 1) == 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::oddKeyArgs); return interp.makeError(); } KeywordObj *keyObj = argv[i - 1]->asKeyword(); if (!keyObj) { interp.setNextLocation(loc); interp.message(InterpreterMessages::keyArgsNotKey); return interp.makeError(); } Identifier::SyntacticKey key; if (!keyObj->identifier()->syntacticKey(key)) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidKeyArg, StringMessageArg(keyObj->identifier()->name())); return interp.makeError(); } else { switch (key) { case Identifier::keyMin: if (!interp.convertLengthSpec(argv[i], inlineSpace.min)) return argError(interp, loc, InterpreterMessages::notALengthSpec, i, argv[i]); break; case Identifier::keyMax: if (!interp.convertLengthSpec(argv[i], inlineSpace.max)) return argError(interp, loc, InterpreterMessages::notALengthSpec, i, argv[i]); break; default: interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidKeyArg, StringMessageArg(keyObj->identifier()->name())); return interp.makeError(); } } } return new (interp) InlineSpaceObj(inlineSpace); return argv[0]; } DEFPRIMITIVE(IsColor, argc, argv, context, interp, loc) { if (argv[0]->asColor()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsColorSpace, argc, argv, context, interp, loc) { if (argv[0]->asColorSpace()) return interp.makeTrue(); else return interp.makeFalse(); } static bool decodeKeyArgs(int argc, ELObj **argv, const Identifier::SyntacticKey *keys, int nKeys, Interpreter &interp, const Location &loc, int *pos); // return 1 if obj is a list of numbers of length len. static bool decodeNumVector(double *res, int len, ELObj *obj) { ELObj *e = obj; PairObj *p; for (int i = 0; i < len; i++) { p = e->asPair(); if (!p || !p->car()->realValue(res[i])) return 0; e = p->cdr(); } return 1; } static bool decodeFuncVector(FunctionObj **res, int len, ELObj *obj) { ELObj *e = obj; PairObj *p; for (int i = 0; i < len; i++) { p = e->asPair(); if (!p || !(res[i] = p->car()->asFunction())) return 0; e = p->cdr(); } return 1; } DEFPRIMITIVE(ColorSpace, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC str(s, (n < 43) ? n : 43); if (str == interp.makeStringC("ISO/IEC 10179:1996//Color-Space Family::Dev")) { str.assign(s + 40, n - 40); ELObj *res; if (str == interp.makeStringC("Device RGB")) res = new (interp) DeviceRGBColorSpaceObj; else if (str == interp.makeStringC("Device Gray")) res = new (interp) DeviceGrayColorSpaceObj; else if (str == interp.makeStringC("Device CMYK")) res = new (interp) DeviceCMYKColorSpaceObj; else if (str == interp.makeStringC("Device KX")) res = new (interp) DeviceKXColorSpaceObj; else { interp.setNextLocation(loc); interp.message(InterpreterMessages::unknownColorSpaceFamily, StringMessageArg(StringC(s, n))); return interp.makeError(); } if (argc > 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorSpaceNoArgs, StringMessageArg(str)); } return res; } else if (str == interp.makeStringC("ISO/IEC 10179:1996//Color-Space Family::CIE")) { str.assign(s + 40, n - 40); if ( str == interp.makeStringC("CIE LUV") || str == interp.makeStringC("CIE LAB") || str == interp.makeStringC("CIE Based ABC") || str == interp.makeStringC("CIE Based A")) { static const Identifier::SyntacticKey keys[12] = { Identifier::keyWhitePoint, Identifier::keyBlackPoint, Identifier::keyRange, Identifier::keyRangeAbc, Identifier::keyRangeLmn, Identifier::keyRangeA, Identifier::keyMatrixAbc, Identifier::keyMatrixLmn, Identifier::keyMatrixA, Identifier::keyDecodeAbc, Identifier::keyDecodeLmn, Identifier::keyDecodeA }; int pos[12]; // FIXME messages double wp[3], bp[3], range[6]; double rangeAbc[6], rangeLmn[6], rangeA[2]; double matrixAbc[9], matrixLmn[9], matrixA[3]; FunctionObj *decodeAbc[3], *decodeLmn[3], *decodeA; if (!decodeKeyArgs(argc - 1, argv + 1, keys, 12, interp, loc, pos) || (pos[0] < 0) || (pos[0] >= 0 && !decodeNumVector(wp, 3, argv[pos[0] + 1])) || (pos[1] >= 0 && !decodeNumVector(bp, 3, argv[pos[1] + 1])) || (pos[2] >= 0 && !decodeNumVector(range, 6, argv[pos[2] + 1])) || (pos[3] >= 0 && !decodeNumVector(rangeAbc, 6, argv[pos[3] + 1])) || (pos[4] >= 0 && !decodeNumVector(rangeLmn, 6, argv[pos[4] + 1])) || (pos[5] >= 0 && !decodeNumVector(rangeA, 2, argv[pos[5] + 1])) || (pos[6] >= 0 && !decodeNumVector(matrixAbc, 9, argv[pos[6] + 1])) || (pos[7] >= 0 && !decodeNumVector(matrixLmn, 9, argv[pos[7] + 1])) || (pos[8] >= 0 && !decodeNumVector(matrixA, 3, argv[pos[8] + 1])) || (pos[9] >= 0 && !decodeFuncVector(decodeAbc, 3, argv[pos[9] + 1])) || (pos[10] >= 0 && !decodeFuncVector(decodeLmn, 3, argv[pos[10] + 1])) || (pos[11] >= 0 && !(decodeA = argv[pos[11] + 1]->asFunction()))) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorSpaceArgError, StringMessageArg(str)); return interp.makeError(); } if ( str == interp.makeStringC("CIE LUV") || str == interp.makeStringC("CIE LAB")) { for (int i = 3; i < 12; i++) if (pos[i] >= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorSpaceArgError, StringMessageArg(str)); return interp.makeError(); } if (str == interp.makeStringC("CIE LUV")) return new (interp) CIELUVColorSpaceObj(wp, (pos[1] >= 0) ? bp : 0, (pos[2] >= 0) ? range : 0); else return new (interp) CIELABColorSpaceObj(wp, (pos[1] >= 0) ? bp : 0, (pos[2] >= 0) ? range : 0); } else if (str == interp.makeStringC("CIE Based ABC")) { if (pos[2] >= 0 || pos[5] >= 0 || pos[8] >= 0 || pos[11] >= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorSpaceArgError, StringMessageArg(str)); return interp.makeError(); } return new (interp) CIEABCColorSpaceObj(wp, (pos[1] >= 0) ? bp : 0, (pos[3] >= 0) ? rangeAbc : 0, (pos[9] >= 0) ? decodeAbc : 0, (pos[6] >= 0) ? matrixAbc : 0, (pos[4] >= 0) ? rangeLmn : 0, (pos[10] >= 0) ? decodeLmn : 0, (pos[7] >= 0) ? matrixLmn : 0); } else { // CIE Based A if (pos[2] >= 0 || pos[3] >= 0 || pos[6] >= 0 || pos[9] >= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::colorSpaceArgError, StringMessageArg(str)); return interp.makeError(); } return new (interp) CIEAColorSpaceObj(wp, (pos[1] >= 0) ? bp : 0, (pos[5] >= 0) ? rangeA : 0, (pos[11] >= 0) ? decodeA : 0, (pos[8] >= 0) ? matrixA : 0, (pos[4] >= 0) ? rangeLmn : 0, (pos[10] >= 0) ? decodeLmn : 0, (pos[7] >= 0) ? matrixLmn : 0); } } } interp.setNextLocation(loc); interp.message(InterpreterMessages::unknownColorSpaceFamily, StringMessageArg(StringC(s, n))); return interp.makeError(); } DEFPRIMITIVE(Color, argc, argv, context, interp, loc) { ColorSpaceObj *colorSpace = argv[0]->asColorSpace(); if (!colorSpace) return argError(interp, loc, InterpreterMessages::notAColorSpace, 0, argv[0]); return colorSpace->makeColor(argc - 1, argv + 1, interp, loc); } DEFPRIMITIVE(IsAddress, argc, argv, context, interp, loc) { if (argv[0]->asAddress()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(IsAddressLocal, argc, argv, context, interp, loc) { AddressObj *address = argv[0]->asAddress(); if (!address) return argError(interp, loc, InterpreterMessages::notAnAddress, 0, argv[0]); if (!context.currentNode) return noCurrentNodeError(interp, loc); switch (address->address().type) { case FOTBuilder::Address::resolvedNode: if (address->address().node->sameGrove(*context.currentNode)) return interp.makeTrue(); else return interp.makeFalse(); case FOTBuilder::Address::idref: return interp.makeTrue(); case FOTBuilder::Address::entity: return interp.makeFalse(); default: break; } return interp.makeFalse(); } DEFPRIMITIVE(IsAddressVisited, argc, argv, context, interp, loc) { AddressObj *address = argv[0]->asAddress(); if (!address) return argError(interp, loc, InterpreterMessages::notAnAddress, 0, argv[0]); // FIXME return interp.makeFalse(); } DEFPRIMITIVE(CurrentNodeAddress, argc, argv, context, interp, loc) { if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) AddressObj(FOTBuilder::Address::resolvedNode, context.currentNode); } DEFPRIMITIVE(HytimeLinkend, argc, argv, context, interp, loc) { if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) AddressObj(FOTBuilder::Address::hytimeLinkend, context.currentNode); } DEFPRIMITIVE(SgmlDocumentAddress, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC sysid(s, n); if (!argv[1]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 1, argv[1]); return new (interp) AddressObj(FOTBuilder::Address::sgmlDocument, NodePtr(), sysid, StringC(s, n)); } DEFPRIMITIVE(IdrefAddress, argc, argv, context, interp, loc) { // The advantage of doing this rather than using an NodeAddressObj, // is that when it's a forward reference we don't have to // wait for the node. It might be cleaner to use a ProxyNode class // for this. const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) AddressObj(FOTBuilder::Address::idref, context.currentNode, StringC(s, n)); } DEFPRIMITIVE(EntityAddress, argc, argv, context, interp, loc) { // Note that multiple space separated entity names are allowed; // currently Address doesn't support multiple nodes, so we can't resolve here. const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) AddressObj(FOTBuilder::Address::entity, context.currentNode, StringC(s, n)); } DEFPRIMITIVE(NodeListAddress, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); return new (interp) AddressObj(FOTBuilder::Address::resolvedNode, node); } DEFPRIMITIVE(UriRefAddress, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return new (interp) AddressObj(FOTBuilder::Address::html, NodePtr(), StringC(s, n)); } DEFPRIMITIVE(CharScriptCase, argc, argv, context, interp, loc) { if (!context.styleStack) { interp.setNextLocation(loc); interp.message(InterpreterMessages::notInCharacteristicValue); return interp.makeError(); } for (size_t i = 0; i < argc; i += 2) { const Char *s; size_t n; if (!argv[i]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); } // FIXME return argv[argc - 1]; } DEFPRIMITIVE(IsGlyphId, argc, argv, context, interp, loc) { if (argv[0]->glyphId()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(GlyphId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return interp.convertGlyphId(s, n, loc); } DEFPRIMITIVE(IsGlyphSubstTable, argc, argv, context, interp, loc) { if (argv[0]->asGlyphSubstTable()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(GlyphSubstTable, argc, argv, context, interp, loc) { ELObj *p = argv[0]; Ptr table = new FOTBuilder::GlyphSubstTable; table->uniqueId = interp.allocGlyphSubstTableUniqueId(); while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAGlyphIdPairList, 0, argv[0]); p = tem->cdr(); tem = tem->car()->asPair(); const FOTBuilder::GlyphId *g1, *g2; if (!tem || (g1 = tem->car()->glyphId()) == 0 || (g2 = tem->cdr()->glyphId()) == 0) return argError(interp, loc, InterpreterMessages::notAGlyphIdPairList, 0, argv[0]); table->pairs.push_back(*g1); table->pairs.push_back(*g2); } return new (interp) GlyphSubstTableObj(table); } DEFPRIMITIVE(GlyphSubst, argc, argv, context, interp, loc) { GlyphSubstTableObj *table = argv[0]->asGlyphSubstTable(); if (!table) return argError(interp, loc, InterpreterMessages::notAGlyphSubstTable, 0, argv[0]); const FOTBuilder::GlyphId *glyphId = argv[1]->glyphId(); if (!glyphId) return argError(interp, loc, InterpreterMessages::notAGlyphId, 1, argv[1]); return new (interp) GlyphIdObj(table->glyphSubstTable()->subst(*glyphId)); } // Core query language DEFPRIMITIVE(CurrentNode, argc, argv, context, interp, loc) { if (!context.currentNode) return noCurrentNodeError(interp, loc); return new (interp) NodePtrNodeListObj(context.currentNode); } DEFPRIMITIVE(NodeListError, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); if (!argv[1]->asNodeList()) return argError(interp, loc, InterpreterMessages::notANodeList, 1, argv[1]); NodePtr nd; const LocNode *lnp; Location nodeLoc; if (argv[1]->optSingletonNodeList(context, interp, nd) && (lnp = LocNode::convert(nd)) != 0 && lnp->getLocation(nodeLoc) == accessOK) interp.setNextLocation(nodeLoc); else interp.setNextLocation(loc); interp.message(InterpreterMessages::errorProc, StringMessageArg(StringC(s, n))); return interp.makeError(); } DEFPRIMITIVE(IsNodeListEmpty, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); if (nl->nodeListFirst(context, interp)) return interp.makeFalse(); else return interp.makeTrue(); } DEFPRIMITIVE(IsNodeList, argc, argv, context, interp, loc) { if (argv[0]->asNodeList()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(Parent, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 0, argv[0]); if (!node) return argv[0]; } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } if (node->getParent(node) != accessOK) return interp.makeEmptyNodeList(); return new (interp) NodePtrNodeListObj(node); } static bool convertGeneralName(ELObj *obj, const NodePtr &node, StringC &result) { const Char *s; size_t n; if (!obj->stringData(s, n)) return 0; result.assign(s, n); NodePtr root; node->getGroveRoot(root); NamedNodeListPtr elements; root->getElements(elements); result.resize(elements->normalize(result.begin(), result.size())); return 1; } DEFPRIMITIVE(Ancestor, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } StringC gi; if (!convertGeneralName(argv[0], node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); while (node->getParent(node) == accessOK) { GroveString str; if (node->getGi(str) == accessOK && str == GroveString(gi.data(), gi.size())) return new (interp) NodePtrNodeListObj(node); } return interp.makeEmptyNodeList(); } DEFPRIMITIVE(Gi, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } GroveString str; if (node && node->getGi(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); else return interp.makeFalse(); } DEFPRIMITIVE(FirstChildGi, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 0, argv[0]); if (!node) return interp.makeFalse(); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } if (node.assignFirstChild() != accessOK) return interp.makeFalse(); for (;;) { GroveString str; if (node->getGi(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); if (node.assignNextChunkSibling() != accessOK) break; } return interp.makeFalse(); } DEFPRIMITIVE(Id, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } GroveString str; if (node && node->getId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); else return interp.makeFalse(); } static bool nodeAttributeString(const NodePtr &node, const Char *s, size_t n, const SdataMapper &mapper, StringC &value) { NamedNodeListPtr atts; if (node->getAttributes(atts) != accessOK) return 0; NodePtr att; if (atts->namedNode(GroveString(s, n), att) != accessOK) return 0; bool implied; if (att->getImplied(implied) == accessOK && implied) return 0; GroveString tokens; if (att->tokens(tokens) == accessOK) { value.assign(tokens.data(), tokens.size()); return 1; } NodePtr tem; value.resize(0); if (att->firstChild(tem) == accessOK) { do { GroveString chunk; if (tem->charChunk(mapper, chunk) == accessOK) value.append(chunk.data(), chunk.size()); } while (tem.assignNextChunkSibling() == accessOK); } return 1; } DEFPRIMITIVE(AttributeString, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 1, argv[1]); if (!node) return interp.makeFalse(); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC value; if (nodeAttributeString(node, s, n, interp, value)) return new (interp) StringObj(value); return interp.makeFalse(); } DEFPRIMITIVE(InheritedAttributeString, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 1, argv[1]); if (!node) return interp.makeFalse(); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); do { StringC value; if (nodeAttributeString(node, s, n, interp, value)) return new (interp) StringObj(value); } while (node->getParent(node) == accessOK); return interp.makeFalse(); } DEFPRIMITIVE(InheritedElementAttributeString, argc, argv, context, interp, loc) { NodePtr node; if (argc > 2) { if (!argv[2]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 2, argv[2]); if (!node) return interp.makeFalse(); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } StringC gi; if (!convertGeneralName(argv[0], node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); const Char *s; size_t n; if (!argv[1]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 1, argv[1]); do { GroveString nodeGi; StringC value; if (node->getGi(nodeGi) == accessOK && nodeGi == GroveString(gi.data(), gi.size()) && nodeAttributeString(node, s, n, interp, value)) return new (interp) StringObj(value); } while (node->getParent(node) == accessOK); return interp.makeFalse(); } DEFPRIMITIVE(IsFirstSibling, argc, argv, context, interp, loc) { NodePtr nd; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, nd) || !nd) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); nd = context.currentNode; } GroveString gi; NodePtr p; if (nd->firstSibling(p) != accessOK || nd->getGi(gi) != accessOK) return interp.makeFalse(); while (*p != *nd) { GroveString tem; if (p->getGi(tem) == accessOK && tem == gi) return interp.makeFalse(); if (p.assignNextChunkSibling() != accessOK) CANNOT_HAPPEN(); } return interp.makeTrue(); } DEFPRIMITIVE(IsAbsoluteFirstSibling, argc, argv, context, interp, loc) { NodePtr nd; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, nd) || !nd) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); nd = context.currentNode; } NodePtr p; if (nd->firstSibling(p) != accessOK) return interp.makeFalse(); while (*p != *nd) { GroveString tem; if (p->getGi(tem) == accessOK) return interp.makeFalse(); if (p.assignNextChunkSibling() != accessOK) CANNOT_HAPPEN(); } return interp.makeTrue(); } DEFPRIMITIVE(IsLastSibling, argc, argv, context, interp, loc) { NodePtr nd; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, nd) || !nd) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); nd = context.currentNode; } GroveString gi; if (nd->getGi(gi) != accessOK) return interp.makeFalse(); while (nd.assignNextChunkSibling() == accessOK) { GroveString tem; if (nd->getGi(tem) == accessOK && tem == gi) return interp.makeFalse(); } return interp.makeTrue(); } DEFPRIMITIVE(IsAbsoluteLastSibling, argc, argv, context, interp, loc) { NodePtr nd; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, nd) || !nd) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); nd = context.currentNode; } while (nd.assignNextChunkSibling() == accessOK) { GroveString tem; if (nd->getGi(tem) == accessOK) return interp.makeFalse(); } return interp.makeTrue(); } // Return 0 on error. bool matchAncestors(ELObj *obj, const NodePtr &node, ELObj *&unmatched) { NodePtr parent; if (node->getParent(parent) != accessOK) { unmatched = obj; return 1; } if (!matchAncestors(obj, parent, unmatched)) return 0; if (!unmatched->isNil()) { PairObj *pair = unmatched->asPair(); if (!pair) return 0; StringC gi; if (!convertGeneralName(pair->car(), node, gi)) return 0; GroveString tem; if (parent->getGi(tem) == accessOK && tem == GroveString(gi.data(), gi.size())) unmatched = pair->cdr(); } return 1; } DEFPRIMITIVE(IsHaveAncestor, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } StringC gi; if (convertGeneralName(argv[0], node, gi)) { while (node->getParent(node) == accessOK) { GroveString tem; if (node->getGi(tem) == accessOK && tem == GroveString(gi.data(), gi.size())) return interp.makeTrue(); } return interp.makeFalse(); } ELObj *unmatched; if (!matchAncestors(argv[0], node, unmatched)) return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); else if (unmatched->isNil()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(ChildNumber, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } unsigned long num; if (!interp.childNumber(node, num)) return interp.makeFalse(); return interp.makeInteger(num + 1); } DEFPRIMITIVE(AncestorChildNumber, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } StringC gi; if (!convertGeneralName(argv[0], node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); while (node->getParent(node) == accessOK) { GroveString str; if (node->getGi(str) == accessOK && str == GroveString(gi.data(), gi.size())) { unsigned long num; interp.childNumber(node, num); return interp.makeInteger(num + 1); } } return interp.makeFalse(); } DEFPRIMITIVE(HierarchicalNumber, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } // Make a reversed copy of the list of GIs. ELObjDynamicRoot list(interp, 0); ELObj *p = argv[0]; while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); list = new (interp) PairObj(tem->car(), list); p = tem->cdr(); } p = list; while (p) { PairObj *pair = (PairObj *)p; StringC gi; // FIXME error message not quite right if (!convertGeneralName(pair->car(), node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, pair->car()); for (;;) { // Replace the GI by its number. if (node->getParent(node) != accessOK) { pair->setCar(interp.makeInteger(0)); break; } GroveString str; if (node->getGi(str) == accessOK && str == GroveString(gi.data(), gi.size())) { unsigned long num; interp.childNumber(node, num); pair->setCar(interp.makeInteger(num + 1)); break; } } p = pair->cdr(); } // Reverse the list of numbers in place. p = list; ELObj *result = interp.makeNil(); while (p) { PairObj *tem = (PairObj *)p; p = tem->cdr(); tem->setCdr(result); result = tem; } return result; } DEFPRIMITIVE(HierarchicalNumberRecursive, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } StringC gi; if (!convertGeneralName(argv[0], node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); ELObjDynamicRoot result(interp, interp.makeNil()); while (node->getParent(node) == accessOK) { GroveString str; if (node->getGi(str) == accessOK && str == GroveString(gi.data(), gi.size())) { unsigned long num; interp.childNumber(node, num); PairObj *pair = new (interp) PairObj(0, result); result = pair; pair->setCar(interp.makeInteger(num + 1)); } } return result; } DEFPRIMITIVE(ElementNumber, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } GroveString gi; if (node->getGi(gi) != accessOK) return interp.makeFalse(); StringC buf(gi.data(), gi.size()); unsigned long num = interp.elementNumber(node, buf); return interp.makeInteger(num); } DEFPRIMITIVE(ElementNumberList, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } ELObjDynamicRoot list(interp, 0); ELObj *p = argv[0]; while (!p->isNil()) { PairObj *tem = p->asPair(); if (!tem) return argError(interp, loc, InterpreterMessages::notAList, 0, argv[0]); list = new (interp) PairObj(tem->car(), list); p = tem->cdr(); } ELObjDynamicRoot result(interp, interp.makeNil()); p = list; if (p) { PairObj *pair = (PairObj *)p; StringC gi; if (!convertGeneralName(pair->car(), node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, pair->car()); p = pair->cdr(); while (p) { pair = (PairObj *)p; StringC numGi(gi); if (!convertGeneralName(pair->car(), node, gi)) return argError(interp, loc, InterpreterMessages::notAString, 0, pair->car()); unsigned long num = interp.elementNumberAfter(node, numGi, gi); PairObj *tem = new (interp) PairObj(0, result); result = tem; tem->setCar(interp.makeInteger(num)); p = pair->cdr(); } unsigned long num = interp.elementNumber(node, gi); PairObj *tem = new (interp) PairObj(0, result); result = tem; tem->setCar(interp.makeInteger(num)); } return result; } DEFPRIMITIVE(EntityAttributeString, argc, argv, context, interp, loc) { const Char *entityName; size_t entityNameLen; if (!argv[0]->stringData(entityName, entityNameLen)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); const Char *attName; size_t attNameLen; if (!argv[1]->stringData(attName, attNameLen)) return argError(interp, loc, InterpreterMessages::notAString, 1, argv[1]); NodePtr node; if (argc > 2) { if (!argv[2]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 2, argv[2]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } NamedNodeListPtr entities; StringC value; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(entityName, entityNameLen), node) == accessOK && nodeAttributeString(node, attName, attNameLen, interp, value)) return new (interp) StringObj(value); return interp.makeFalse(); } DEFPRIMITIVE(EntityGeneratedSystemId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr entities; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(s, n), node) == accessOK && node->getExternalId(node) == accessOK && node->getGeneratedSystemId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(EntitySystemId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr entities; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(s, n), node) == accessOK && node->getExternalId(node) == accessOK && node->getSystemId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(EntityPublicId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr entities; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK) { StringC tem(s, n); tem.resize(entities->normalize(tem.begin(), tem.size())); if (entities->namedNode(GroveString(tem.data(), tem.size()), node) == accessOK && node->getExternalId(node) == accessOK && node->getPublicId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); } return interp.makeFalse(); } DEFPRIMITIVE(EntityNotation, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr entities; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(s, n), node) == accessOK && node->getNotation(node) == accessOK && node->getName(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(EntityText, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr entities; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(s, n), node) == accessOK && node->getText(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(EntityType, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } NamedNodeListPtr entities; Node::EntityType::Enum type; if (node->getGroveRoot(node) == accessOK && node->getEntities(entities) == accessOK && entities->namedNode(GroveString(s, n), node) == accessOK && node->getEntityType(type) == accessOK) { const char *s; switch (type) { case Node::EntityType::text: s = "text"; break; case Node::EntityType::cdata: s = "cdata"; break; case Node::EntityType::sdata: s = "sdata"; break; case Node::EntityType::ndata: s = "ndata"; break; case Node::EntityType::subdocument: s = "subdocument"; break; case Node::EntityType::pi: s = "pi"; break; default: CANNOT_HAPPEN(); } return interp.makeSymbol(interp.makeStringC(s)); } return interp.makeFalse(); } DEFPRIMITIVE(NotationSystemId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr notations; if (node->getGroveRoot(node) == accessOK && node->getGoverningDoctype(node) == accessOK && node->getNotations(notations) == accessOK && notations->namedNode(GroveString(s, n), node) == accessOK && node->getExternalId(node) == accessOK && node->getSystemId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(NotationPublicId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr notations; if (node->getGroveRoot(node) == accessOK && node->getGoverningDoctype(node) == accessOK && node->getNotations(notations) == accessOK && notations->namedNode(GroveString(s, n), node) == accessOK && node->getExternalId(node) == accessOK && node->getPublicId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(NotationGeneratedSystemId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } GroveString str; NamedNodeListPtr notations; if (node->getGroveRoot(node) == accessOK && node->getGoverningDoctype(node) == accessOK && node->getNotations(notations) == accessOK && notations->namedNode(GroveString(s, n), node) == accessOK && node->getExternalId(node) == accessOK && node->getGeneratedSystemId(str) == accessOK) return new (interp) StringObj(str.data(), str.size()); return interp.makeFalse(); } DEFPRIMITIVE(GeneralNameNormalize, argc, argv, context, interp, loc) { NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } StringC result; if (!convertGeneralName(argv[0], node, result)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return new (interp) StringObj(result); } DEFPRIMITIVE(EntityNameNormalize, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } StringC result(s, n); node->getGroveRoot(node); NamedNodeListPtr entities; node->getEntities(entities); result.resize(entities->normalize(result.begin(), result.size())); return new (interp) StringObj(result); } DEFPRIMITIVE(NodeListFirst, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); NodePtr nd = nl->nodeListFirst(context, interp); return new (interp) NodePtrNodeListObj(nd); } DEFPRIMITIVE(NodeListRest, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); return nl->nodeListRest(context, interp); } DEFPRIMITIVE(NodeList, argc, argv, context, interp, loc) { if (argc == 0) return interp.makeEmptyNodeList(); int i = argc - 1; NodeListObj *nl = argv[i]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, i, argv[i]); if (i > 0) { ELObjDynamicRoot protect(interp, nl); for (;;) { i--; NodeListObj *tem = argv[i]->asNodeList(); if (!tem) return argError(interp, loc, InterpreterMessages::notANodeList, i, argv[i]); nl = new (interp) PairNodeListObj(tem, nl); if (i == 0) break; protect = nl; } } return nl; } DEFPRIMITIVE(NodeListNoOrder, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); return nl->nodeListNoOrder(interp); } DEFPRIMITIVE(IsNodeListEqual, argc, argv, context, interp, loc) { NodeListObj *nl1 = argv[0]->asNodeList(); if (!nl1) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); if (nl1 == argv[1]) return interp.makeTrue(); NodeListObj *nl2 = argv[1]->asNodeList(); if (!nl2) return argError(interp, loc, InterpreterMessages::notANodeList, 1, argv[1]); ELObjDynamicRoot protect1(interp, nl1); ELObjDynamicRoot protect2(interp, nl2); for (;;) { NodePtr nd1 = nl1->nodeListFirst(context, interp); NodePtr nd2 = nl2->nodeListFirst(context, interp); if (!nd1) { if (nd2) return interp.makeFalse(); else break; } else if (!nd2) return interp.makeFalse(); else if (*nd1 != *nd2) return interp.makeFalse(); nl1 = nl1->nodeListRest(context, interp); protect1 = nl1; nl2 = nl2->nodeListRest(context, interp); protect2 = nl2; } return interp.makeTrue(); } DEFPRIMITIVE(IsNamedNodeList, argc, argv, context, interp, loc) { if (argv[0]->asNamedNodeList()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(NamedNode, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NamedNodeListObj *nnl = argv[1]->asNamedNodeList(); if (!nnl) return argError(interp, loc, InterpreterMessages::notANamedNodeList, 1, argv[1]); return new (interp) NodePtrNodeListObj(nnl->namedNode(s, n)); } DEFPRIMITIVE(NamedNodeListNormalize, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NamedNodeListObj *nnl = argv[1]->asNamedNodeList(); if (!nnl) return argError(interp, loc, InterpreterMessages::notANamedNodeList, 1, argv[1]); if (!argv[2]->asSymbol()) return argError(interp, loc, InterpreterMessages::notASymbol, 2, argv[2]); StringC result(s, n); result.resize(nnl->normalize(result.begin(), result.size())); return new (interp) StringObj(result); } DEFPRIMITIVE(NamedNodeListNames, argc, argv, context, interp, loc) { NamedNodeListObj *nnl = argv[0]->asNamedNodeList(); if (!nnl) return argError(interp, loc, InterpreterMessages::notANamedNodeList, 0, argv[0]); NodeListObj *nl = nnl; PairObj *tail = interp.makePair(0, 0); PairObj *head = tail; ELObjDynamicRoot protect(interp, head); for (;;) { ELObjDynamicRoot protect(interp, nl); NodePtr nd = nl->nodeListFirst(context, interp); if (!nd) break; GroveString str; if (nnl->nodeName(nd, str)) { // protect the StringObj by putting in the head's car head->setCar(new (interp) StringObj(str.data(), str.size())); PairObj *newTail = new (interp) PairObj(head->car(), 0); tail->setCdr(newTail); tail = newTail; } nl = nl->nodeListRest(context, interp); } tail->setCdr(interp.makeNil()); return head->cdr(); } DEFPRIMITIVE(Children, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } if (!node) return argv[0]; NodeListPtr nl; if (node->children(nl) != accessOK) return interp.makeEmptyNodeList(); return new (interp) NodeListPtrNodeListObj(nl); } DEFPRIMITIVE(Follow, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } if (!node) return argv[0]; NodeListPtr nl; if (node->follow(nl) != accessOK) return interp.makeEmptyNodeList(); return new (interp) NodeListPtrNodeListObj(nl); } DEFPRIMITIVE(Subtree, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } return new (interp) SubtreeNodeListObj(node); } DEFPRIMITIVE(Subgrove, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } return new (interp) SubgroveNodeListObj(node); } DEFPRIMITIVE(Descendants, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } return new (interp) DescendantsNodeListObj(node, interp); } DEFPRIMITIVE(Preced, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } NodePtr first; if (!node || node->firstSibling(first) != accessOK) return interp.makeEmptyNodeList(); return new (interp) SiblingNodeListObj(first, node); } DEFPRIMITIVE(Attributes, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node)) { NodeListObj *nl = argv[0]->asNodeList(); if (nl) return new (interp) MapNodeListObj(this, nl, new MapNodeListObj::Context(context, loc)); return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); } if (!node) return argv[0]; NamedNodeListPtr nnl; if (node->getAttributes(nnl) != accessOK) return interp.makeEmptyNodeList(); return new (interp) NamedNodeListPtrNodeListObj(nnl); } static void nodeData(const NodePtr &nd, const SdataMapper &mapper, bool chunk, StringC &s) { GroveString tem; if (nd->charChunk(mapper, tem) == accessOK) { s.append(tem.data(), chunk ? tem.size() : 1); return; } if (nd->tokens(tem) == accessOK) { s.append(tem.data(), tem.size()); return; } NodePtr cnd; if (nd->firstChild(cnd) == accessOK) { do { nodeData(cnd, mapper, 1, s); } while (cnd.assignNextChunkSibling() == accessOK); return; } // This happens if the data procedure is called on an AVT node if (nd->getToken(tem) == accessOK) s.append(tem.data(), tem.size()); } DEFPRIMITIVE(Data, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); StringObj *s = new (interp) StringObj; ELObjDynamicRoot protect(interp, s); for (;;) { ELObjDynamicRoot protect(interp, nl); NodePtr nd = nl->nodeListFirst(context, interp); if (!nd) break; bool chunk; nl = nl->nodeListChunkRest(context, interp, chunk); nodeData(nd, interp, chunk, *s); } return s; } DEFPRIMITIVE(ElementWithId, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); NodePtr node; if (argc > 1) { if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); } else { node = context.currentNode; if (!node) return noCurrentNodeError(interp, loc); } NamedNodeListPtr elements; if (node->getGroveRoot(node) == accessOK && node->getElements(elements) == accessOK && elements->namedNode(GroveString(s, n), node) == accessOK) return new (interp) NodePtrNodeListObj(node); return interp.makeEmptyNodeList(); } DEFPRIMITIVE(EmptyNodeList, argc, argv, context, interp, loc) { return interp.makeEmptyNodeList(); } static bool decodeKeyArgs(int argc, ELObj **argv, const Identifier::SyntacticKey *keys, int nKeys, Interpreter &interp, const Location &loc, int *pos) { if ((argc & 1) == 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::oddKeyArgs); return 0; } for (int i = 0; i < nKeys; i++) pos[i] = -1; // First has priority, so scan in reverse order for (int i = argc - 1; i > 0; i -= 2) { KeywordObj *keyObj = argv[i - 1]->asKeyword(); if (!keyObj) { interp.setNextLocation(loc); interp.message(InterpreterMessages::keyArgsNotKey); return 0; } bool found = 0; Identifier::SyntacticKey key; if (keyObj->identifier()->syntacticKey(key)) { for (int j = 0; j < nKeys; j++) { if (key == keys[j]) { pos[j] = i; found = 1; } } } if (!found) { interp.setNextLocation(loc); interp.message(InterpreterMessages::invalidKeyArg, StringMessageArg(keyObj->identifier()->name())); return 0; } } return 1; } DEFPRIMITIVE(NodeProperty, argc, argv, context, interp, loc) { StringObj *str = argv[0]->convertToString(); if (!str) return argError(interp, loc, InterpreterMessages::notAStringOrSymbol, 0, argv[0]); NodePtr node; if (!argv[1]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 1, argv[1]); static const Identifier::SyntacticKey keys[3] = { Identifier::keyDefault, Identifier::keyNull, Identifier::keyIsRcs }; int pos[3]; if (!decodeKeyArgs(argc - 2, argv + 2, keys, 3, interp, loc, pos)) return interp.makeError(); //FIXME: this is just a hack to fix the single duplicate rcsname 'tokens'; // should really be handled in Interpreter. StringC propname; ComponentName::Id cls; ComponentName::Id id = ComponentName::noId; if (*str == "tokens" && node->getClassName(cls) == accessOK && cls == ComponentName::idModelGroup) id = ComponentName::idContentTokens; else interp.lookupNodeProperty(*str, id); if (id != ComponentName::noId) { ELObjPropertyValue value(interp, pos[2] >= 0 && argv[pos[2] + 2] != interp.makeFalse()); AccessResult ret = node->property(id, interp, value); if (ret == accessOK) return value.obj; if (ret == accessNull && pos[1] >= 0) return argv[pos[1] + 2]; } if (pos[0] < 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::noNodePropertyValue, StringMessageArg(*str)); return interp.makeError(); } return argv[pos[0] + 2]; } DEFPRIMITIVE(SelectByClass, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); StringObj *str = argv[1]->convertToString(); if (!str) return argError(interp, loc, InterpreterMessages::notAStringOrSymbol, 1, argv[1]); ComponentName::Id id; if (!interp.lookupNodeProperty(*str, id)) return interp.makeEmptyNodeList(); return new (interp) SelectByClassNodeListObj(nl, id); } DEFPRIMITIVE(NodeListMap, argc, argv, context, interp, loc) { FunctionObj *func = argv[0]->asFunction(); if (!func) return argError(interp, loc, InterpreterMessages::notAProcedure, 0, argv[0]); if (func->nRequiredArgs() > 1) { interp.setNextLocation(loc); // FIXME interp.message(InterpreterMessages::missingArg); return interp.makeError(); } if (func->nRequiredArgs() + func->nOptionalArgs() + func->restArg() == 0) { interp.setNextLocation(loc); // FIXME interp.message(InterpreterMessages::tooManyArgs); return interp.makeError(); } interp.makeReadOnly(func); NodeListObj *nl = argv[1]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 1, argv[1]); return new (interp) MapNodeListObj(func, nl, new MapNodeListObj::Context(context, loc)); } DEFPRIMITIVE(NodeListFilter, argc, argv, context, interp, loc) { FunctionObj *func = argv[0]->asFunction(); if (!func) return argError(interp, loc, InterpreterMessages::notAProcedure, 0, argv[0]); if (func->nRequiredArgs() > 1) { interp.setNextLocation(loc); // FIXME interp.message(InterpreterMessages::missingArg); return interp.makeError(); } if (func->nRequiredArgs() + func->nOptionalArgs() + func->restArg() == 0) { interp.setNextLocation(loc); // FIXME interp.message(InterpreterMessages::tooManyArgs); return interp.makeError(); } interp.makeReadOnly(func); NodeListObj *nl = argv[1]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 1, argv[1]); return new (interp) FilterNodeListObj(func, nl, new MapNodeListObj::Context(context, loc)); } DEFPRIMITIVE(NodeListRef, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); // Must use temporary variable, because operator new may bew called before nodeListRef. NodePtr nd(nl->nodeListRef(k, context, interp)); return new (interp) NodePtrNodeListObj(nd); } DEFPRIMITIVE(NodeListReverse, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); return nl->nodeListReverse(context, interp); } DEFPRIMITIVE(NodeListLength, argc, argv, context, interp, loc) { NodeListObj *nl = argv[0]->asNodeList(); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 0, argv[0]); return interp.makeInteger(nl->nodeListLength(context, interp)); } DEFPRIMITIVE(SgmlParse, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC sysid(s, n); static const Identifier::SyntacticKey keys[2] = { Identifier::keyActive, Identifier::keyParent }; int pos[2]; if (!decodeKeyArgs(argc - 1, argv + 1, keys, 2, interp, loc, pos)) return interp.makeError(); Vector lists[2]; if (pos[0] >= 0) { ELObj *obj = argv[pos[0] + 1]; while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair) return argError(interp, loc, InterpreterMessages::notAList, pos[0] + 1, argv[pos[0] + 1]); if (!pair->car()->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, pos[0] + 1, pair->car()); lists[0].resize(lists[0].size() + 1); lists[0].back().assign(s, n); obj = pair->cdr(); } } NodePtr parent; if (pos[1] >= 0) { if (!argv[pos[1] + 1]->optSingletonNodeList(context, interp, parent) || !parent) return argError(interp, loc, InterpreterMessages::notASingletonNode, pos[1] + 1, argv[pos[1] + 1]); } NodePtr nd; if (!interp.groveManager()->load(sysid, lists[0], parent, nd, lists[1])) return interp.makeEmptyNodeList(); return new (interp) NodePtrNodeListObj(nd); } DEFPRIMITIVE(XSgmlParse, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC sysid(s, n); static const Identifier::SyntacticKey keys[3] = { Identifier::keyActive, Identifier::keyArchitecture, Identifier::keyParent }; int pos[3]; if (!decodeKeyArgs(argc - 1, argv + 1, keys, 3, interp, loc, pos)) return interp.makeError(); Vector lists[2]; for (int i = 0; i < 3; i++) { if (pos[i] >= 0) { ELObj *obj = argv[pos[0] + 1]; while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair) return argError(interp, loc, InterpreterMessages::notAList, pos[i] + 1, argv[pos[i] + 1]); if (!pair->car()->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, pos[i] + 1, pair->car()); lists[i].resize(lists[i].size() + 1); lists[i].back().assign(s, n); obj = pair->cdr(); } } } NodePtr parent; if (pos[2] >= 0) { if (!argv[pos[2] + 1]->optSingletonNodeList(context, interp, parent) || !parent) return argError(interp, loc, InterpreterMessages::notASingletonNode, pos[2] + 1, argv[pos[2] + 1]); } NodePtr nd; if (!interp.groveManager()->load(sysid, lists[0], parent, nd, lists[1])) return interp.makeEmptyNodeList(); return new (interp) NodePtrNodeListObj(nd); } DEFPRIMITIVE(ReadEntity, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); StringC sysid(s, n); StringObj *contents = new (interp) StringObj; if (interp.groveManager()->readEntity(sysid, *contents)) return contents; return interp.makeError(); } DEFPRIMITIVE(Debug, argc, argv, context, interp, loc) { interp.setNextLocation(loc); interp.message(InterpreterMessages::debug, ELObjMessageArg(argv[0], interp)); return argv[0]; } DEFPRIMITIVE(IfFirstPage, argc, argv, context, interp, loc) { SosofoObj *sosofo[2]; for (int i = 0; i < 2; i++) { sosofo[i] = argv[i]->asSosofo(); if (!sosofo[i]) return argError(interp, loc, InterpreterMessages::notASosofo, i, argv[i]); } return new (interp) PageTypeSosofoObj(FOTBuilder::firstHF, sosofo[0], sosofo[1]); } DEFPRIMITIVE(IfFrontPage, argc, argv, context, interp, loc) { SosofoObj *sosofo[2]; for (int i = 0; i < 2; i++) { sosofo[i] = argv[i]->asSosofo(); if (!sosofo[i]) return argError(interp, loc, InterpreterMessages::notASosofo, i, argv[i]); } return new (interp) PageTypeSosofoObj(FOTBuilder::frontHF, sosofo[0], sosofo[1]); } DEFPRIMITIVE(AllElementNumber, argc, argv, context, interp, loc) { NodePtr node; if (argc > 0) { if (!argv[0]->optSingletonNodeList(context, interp, node)) return argError(interp, loc, InterpreterMessages::notAnOptSingletonNode, 0, argv[0]); } else { if (!context.currentNode) return noCurrentNodeError(interp, loc); node = context.currentNode; } unsigned long n; if (node && node->elementIndex(n) == accessOK) return interp.makeInteger(long(n) + 1); else return interp.makeFalse(); } DEFPRIMITIVE(IsVector, argc, argv, context, interp, loc) { if (argv[0]->asVector()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(Vector, argc, argv, context, interp, loc) { Vector v(argc); for (size_t i = 0; i < argc; i++) v[i] = argv[i]; return new (interp) VectorObj(v); } DEFPRIMITIVE(MakeVector, argc, argv, context, interp, loc) { long k; if (!argv[0]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 0, argv[0]); if (k < 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } ELObj *fill = argc > 1 ? argv[1] : interp.makeUnspecified(); Vector v((size_t)k); for (size_t i = 0; i < v.size(); i++) v[i] = fill; return new (interp) VectorObj(v); } DEFPRIMITIVE(VectorSet, argc, argv, context, interp, loc) { VectorObj *v = argv[0]->asVector(); if (!v) return argError(interp, loc, InterpreterMessages::notAVector, 0, argv[0]); long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (k < 0 || (unsigned long)k >= v->size()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } if (v->readOnly()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::readOnly); return interp.makeError(); } (*v)[k] = argv[2]; return interp.makeUnspecified(); } DEFPRIMITIVE(VectorRef, argc, argv, context, interp, loc) { VectorObj *v = argv[0]->asVector(); if (!v) return argError(interp, loc, InterpreterMessages::notAVector, 0, argv[0]); long k; if (!argv[1]->exactIntegerValue(k)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); if (k < 0 || (unsigned long)k >= v->size()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return (*v)[k]; } DEFPRIMITIVE(VectorToList, argc, argv, context, interp, loc) { VectorObj *v = argv[0]->asVector(); if (!v) return argError(interp, loc, InterpreterMessages::notAVector, 0, argv[0]); Vector &vec = *v; ELObjDynamicRoot result(interp, interp.makeNil()); for (size_t i = vec.size(); i > 0; i--) result = new (interp) PairObj(vec[i - 1], result); return result; } DEFPRIMITIVE(ListToVector, argc, argv, context, interp, loc) { Vector v; ELObj *obj = argv[0]; while (!obj->isNil()) { PairObj *pair = obj->asPair(); if (!pair) return argError(interp, loc, InterpreterMessages::notAList, 0, obj); v.push_back(pair->car()); obj = pair->cdr(); } return new (interp) VectorObj(v); } DEFPRIMITIVE(VectorFill, argc, argv, context, interp, loc) { VectorObj *v = argv[0]->asVector(); if (!v) return argError(interp, loc, InterpreterMessages::notAVector, 0, argv[0]); if (v->readOnly()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::readOnly); return interp.makeError(); } Vector &vec = *v; for (size_t i = 0; i < vec.size(); i++) vec[i] = argv[1]; return interp.makeUnspecified(); } DEFPRIMITIVE(Language, argc, argv, context, interp, loc) { StringObj *lang = argv[0]->convertToString(); if (!lang) return argError(interp, loc, InterpreterMessages::notAStringOrSymbol, 0, argv[0]); StringObj *country = argv[1]->convertToString(); if (!country) return argError(interp, loc, InterpreterMessages::notAStringOrSymbol, 1, argv[1]); #ifdef SP_HAVE_LOCALE if (RefLangObj::supportedLanguage(*lang, *country)) return new (interp) RefLangObj (*lang, *country); else #endif return interp.makeFalse(); } DEFPRIMITIVE(IsLanguage, argc, argv, context, interp, loc) { if (argv[0]->asLanguage()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(CurrentLanguage, argc, argv, context, interp, loc) { if (context.currentLanguage) return context.currentLanguage; else return interp.defaultLanguage(); } DEFPRIMITIVE(WithLanguage, argc, argv, context, interp, loc) { // Check that argv[0] is a language LanguageObj *lang = argv[0]->asLanguage(); if (!lang) return argError(interp, loc, InterpreterMessages::notALanguage, 0, argv[0]); // Check that argv[1] is a thunk FunctionObj *func = argv[1]->asFunction(); if (!func) return argError(interp, loc, InterpreterMessages::notAProcedure, 1, argv[1]); if (func->totalArgs() > 0) { interp.message(InterpreterMessages::tooManyArgs); return interp.makeError(); } LanguageObj *savedLanguage = context.currentLanguage; context.currentLanguage = lang; VM vm(context, interp); InsnPtr insn(func->makeCallInsn(0, interp, loc, InsnPtr())); ELObj *ret = vm.eval(insn.pointer()); context.currentLanguage = savedLanguage; return ret; } #define GETCURLANG(lang,context,interp) \ const LanguageObj *lang; \ if (context.currentLanguage != 0) \ lang = context.currentLanguage; \ else if (interp.defaultLanguage()->asLanguage() != 0) \ lang = interp.defaultLanguage()->asLanguage(); \ else { \ interp.message(InterpreterMessages::noCurrentLanguage); \ return interp.makeError(); \ } DEFPRIMITIVE(CharLess, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); Char c[2]; for (unsigned i = 0; i < 2; i++) if (!argv[i]->charValue(c[i])) return argError(interp, loc, InterpreterMessages::notAChar, i, argv[i]); if (lang->isLess(StringC(c, 1), StringC(c + 1, 1))) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(CharLessOrEqual, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); Char c[2]; for (unsigned i = 0; i < 2; i++) if (!argv[i]->charValue(c[i])) return argError(interp, loc, InterpreterMessages::notAChar, i, argv[i]); if (lang->isLessOrEqual(StringC(c, 1), StringC(c + 1, 1))) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(CharUpcase, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); Char c; if (!argv[0]->charValue(c)) return argError(interp, loc, InterpreterMessages::notAChar, 0, argv[0]); return interp.makeChar(lang->toUpper(c)); } DEFPRIMITIVE(CharDowncase, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); Char c; if (!argv[0]->charValue(c)) return argError(interp, loc, InterpreterMessages::notAChar, 0, argv[0]); return interp.makeChar(lang->toLower(c)); } DEFPRIMITIVE(StringEquiv, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); const Char *s[2]; size_t n[2]; for (unsigned i = 0; i < 2; i++) if (!argv[i]->stringData(s[i], n[i])) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); long k = 0; if (!argv[2]->exactIntegerValue(k) || (k <= 0)) return argError(interp, loc, InterpreterMessages::notAPositiveInteger, 2, argv[2]); if (lang->areEquivalent(StringC(s[0], n[0]), StringC(s[1], n[1]), k)) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(StringLess, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); const Char *s[2]; size_t n[2]; for (unsigned i = 0; i < 2; i++) if (!argv[i]->stringData(s[i], n[i])) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); if (lang->isLess(StringC(s[0], n[0]), StringC(s[1], n[1]))) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(StringLessOrEqual, argc, argv, context, interp, loc) { GETCURLANG(lang, context, interp); const Char *s[2]; size_t n[2]; for (unsigned i = 0; i < 2; i++) if (!argv[i]->stringData(s[i], n[i])) return argError(interp, loc, InterpreterMessages::notAString, i, argv[i]); if (lang->isLessOrEqual(StringC(s[0], n[0]), StringC(s[1], n[1]))) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(Assoc, argc, argv, context, interp, loc) { ELObj *list = argv[1]; for (;;) { PairObj *pair = list->asPair(); if (pair) { PairObj *car = pair->car()->asPair(); if (!car) return argError(interp, loc, InterpreterMessages::notAnAlist, 1, argv[1]); if (ELObj::equal(*car->car(), *argv[0])) return car; list = pair->cdr(); } else if (list->isNil()) break; else return argError(interp, loc, InterpreterMessages::notAList, 1, argv[1]); } return interp.makeFalse(); } DEFPRIMITIVE(KeywordToString, argc, argv, context, interp, loc) { KeywordObj *obj = argv[0]->asKeyword(); if (!obj) return argError(interp, loc, InterpreterMessages::notAKeyword, 0, argv[0]); return new (interp) StringObj(obj->identifier()->name()); } DEFPRIMITIVE(StringToKeyword, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); return interp.makeKeyword(StringC(s, n)); } DEFPRIMITIVE(IsExact, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: return interp.makeFalse(); case ELObj::longQuantity: return interp.makeTrue(); default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(IsInexact, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: return interp.makeTrue(); case ELObj::longQuantity: return interp.makeFalse(); default: CANNOT_HAPPEN(); } } #define DEFNUMPRED(NAME, OP) \ DEFPRIMITIVE(NAME, argc, argv, context, interp, loc) \ { \ long n; \ double d; \ int dim; \ switch (argv[0]->quantityValue(n, d, dim)) { \ case ELObj::noQuantity: \ return argError(interp, loc, \ InterpreterMessages::notAQuantity, 0, argv[0]); \ case ELObj::doubleQuantity: \ if (d OP 0.0) \ return interp.makeTrue(); \ else \ return interp.makeFalse(); \ case ELObj::longQuantity: \ if (n OP 0) \ return interp.makeTrue(); \ else \ return interp.makeFalse(); \ default: \ CANNOT_HAPPEN(); \ } \ } DEFNUMPRED(IsZero, == ) DEFNUMPRED(IsPositive, > ) DEFNUMPRED(IsNegative, < ) DEFPRIMITIVE(IsOdd, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: case ELObj::doubleQuantity: return argError(interp, loc, InterpreterMessages::notAnInteger, 0, argv[0]); case ELObj::longQuantity: if (n % 2) return interp.makeTrue(); else return interp.makeFalse(); default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(IsEven, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: case ELObj::doubleQuantity: return argError(interp, loc, InterpreterMessages::notAnInteger, 0, argv[0]); case ELObj::longQuantity: if (n % 2) return interp.makeFalse(); else return interp.makeTrue(); default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(Exp, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); return new (interp) RealObj(exp(d)); } DEFPRIMITIVE(Log, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); if (d <= 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return new (interp) RealObj(log(d)); } DEFPRIMITIVE(Sin, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); return new (interp) RealObj(sin(d)); } DEFPRIMITIVE(Cos, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); return new (interp) RealObj(cos(d)); } DEFPRIMITIVE(Tan, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); return new (interp) RealObj(tan(d)); } DEFPRIMITIVE(Asin, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); if (d < -1 || d > 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return new (interp) RealObj(asin(d)); } DEFPRIMITIVE(Acos, argc, argv, context, interp, loc) { double d; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); if (d < -1 || d > 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::outOfRange); return interp.makeError(); } return new (interp) RealObj(acos(d)); } DEFPRIMITIVE(Atan, argc, argv, context, interp, loc) { long lResult; double dResult; int dim; ELObj::QuantityType type = argv[0]->quantityValue(lResult, dResult, dim); if (argc == 1) { if (type == ELObj::noQuantity || dim != 0) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); if (type == ELObj::longQuantity) dResult = lResult; return new (interp) RealObj(atan(dResult)); } long lResult2; double dResult2; int dim2; ELObj::QuantityType type2 = argv[1]->quantityValue(lResult2, dResult2, dim2); switch (type) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: break; case ELObj::longQuantity: dResult = lResult; break; default: CANNOT_HAPPEN(); } switch (type2) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 1, argv[1]); case ELObj::doubleQuantity: break; case ELObj::longQuantity: dResult2 = lResult2; break; default: CANNOT_HAPPEN(); } if (dim != dim2) { interp.setNextLocation(loc); interp.message(InterpreterMessages::incompatibleDimensions); return interp.makeError(); } // FIXME: the standard is a bit vague about the range // of atan with two arguments. The description sounds like // it should be [0,2pi] or [-pi,pi], but then it says // the range is [-pi/2,pi/2]. I guess that the last sentence // applies only to the one-argument version of atan, so that // the semantics would parallel that of the C libraries // atan/atan2. return new (interp) RealObj(atan2(dResult, dResult2)); } DEFPRIMITIVE(XExpt, argc, argv, context, interp, loc) { long n1, n2; double d1, d2; int dim1, dim2; ELObj::QuantityType q1 = argv[0]->quantityValue(n1, d1, dim1); ELObj::QuantityType q2 = argv[0]->quantityValue(n2, d2, dim2); if (q1 == ELObj::noQuantity) return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); else if (dim1 != 0) { if (!argv[1]->exactIntegerValue(n2)) return argError(interp, loc, InterpreterMessages::notAnExactInteger, 1, argv[1]); return new (interp) QuantityObj(pow(d1,n2), dim1*n2); } else { if ((q2 == ELObj::noQuantity) || (dim2 != 0)) return argError(interp, loc, InterpreterMessages::notANumber, 1, argv[1]); double res = pow(d1, d2); long tem; if (argv[0]->exactIntegerValue(tem) && argv[1]->exactIntegerValue(tem) && fabs(res) < LONG_MAX) return interp.makeInteger((long)res); return new (interp) RealObj(res); } } DEFPRIMITIVE(Expt, argc, argv, context, interp, loc) { double d, d2; if (!argv[0]->realValue(d)) return argError(interp, loc, InterpreterMessages::notANumber, 0, argv[0]); if (!argv[1]->realValue(d2)) return argError(interp, loc, InterpreterMessages::notANumber, 1, argv[1]); double res = pow(d, d2); long tem; if (argv[0]->exactIntegerValue(tem) && argv[1]->exactIntegerValue(tem) && fabs(res) < LONG_MAX) return interp.makeInteger((long)res); return new (interp) RealObj(res); } DEFPRIMITIVE(ExactToInexact, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: return argv[0]; case ELObj::longQuantity: argv[0]->realValue(d); return new (interp) RealObj(d); default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(InexactToExact, argc, argv, context, interp, loc) { long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: if (argv[0]->realValue(d) && modf(d, &d) == 0.0 && fabs(d) < LONG_MAX && dim == 0) return interp.makeInteger((long)d); interp.setNextLocation(loc); interp.message(InterpreterMessages::noExactRepresentation, ELObjMessageArg(argv[0], interp)); case ELObj::longQuantity: // fall through return argv[0]; default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(QuantityToNumber, argc, argv, context, interp, loc) { // FIXME this is wrong, but what exactly is the // `number of the quantity' ??? long n; double d; int dim; switch (argv[0]->quantityValue(n, d, dim)) { case ELObj::noQuantity: return argError(interp, loc, InterpreterMessages::notAQuantity, 0, argv[0]); case ELObj::doubleQuantity: if (dim == 0) return new (interp) RealObj(d); else return new (interp) RealObj(d * pow(0.0254/interp.unitsPerInch(), dim)); case ELObj::longQuantity: if (dim == 0) return interp.makeInteger(n); else return new (interp) RealObj(n * pow(0.0254/interp.unitsPerInch(), dim)); default: CANNOT_HAPPEN(); } } DEFPRIMITIVE(StringToList, argc, argv, context, interp, loc) { const Char *s; size_t n; if (!argv[0]->stringData(s, n)) return argError(interp, loc, InterpreterMessages::notAString, 0, argv[0]); ELObjDynamicRoot protect(interp, interp.makeNil()); for (int i = n; i > 0; i--) { // We have to do it in this order, to ensure that no object is GC'ed. PairObj *p = interp.makePair(0, protect); protect = p; p->setCar(interp.makeChar(s[i - 1])); } return protect; } DEFPRIMITIVE(ListToString, argc, argv, context, interp, loc) { StringObj *obj = new (interp) StringObj; ELObj *list = argv[0]; for (;;) { PairObj *pair = list->asPair(); if (pair) { Char c; if (!pair->car()->charValue(c)) return argError(interp, loc, InterpreterMessages::notACharList, 0, list); *obj += c; list = pair->cdr(); } else if (list->isNil()) break; else return argError(interp, loc, InterpreterMessages::notAList, 0, list); } return obj; } static long timeConv(const Char *s, size_t n) { char buf[100]; for (unsigned i = 0; i < n; i++) buf[i] = char(s[i]); buf[n] = 0; struct tm tim; sscanf(buf, "%d-%d-%dT%d:%d:%d", &tim.tm_year, &tim.tm_mon, &tim.tm_mday, &tim.tm_hour, &tim.tm_min, &tim.tm_sec); tim.tm_year -= 1900; tim.tm_mon -= 1; return long(mktime(&tim)); } #define DEFTIMECOMP(NAME, OP) \ DEFPRIMITIVE(NAME, argc, argv, context, interp, loc) \ { \ const Char *s1, *s2; \ size_t n1, n2; \ if (!argv[0]->stringData(s1, n1)) \ return argError(interp, loc, \ InterpreterMessages::notAString, 0, argv[0]); \ if (!argv[1]->stringData(s2, n2)) \ return argError(interp, loc, \ InterpreterMessages::notAString, 1, argv[1]); \ if (timeConv(s1, n1) OP timeConv(s2, n2)) \ return interp.makeTrue(); \ else \ return interp.makeFalse(); \ } DEFTIMECOMP(TimeLess, < ) DEFTIMECOMP(TimeGreater, > ) DEFTIMECOMP(TimeLessOrEqual, <= ) DEFTIMECOMP(TimeGreaterOrEqual, >= ) DEFPRIMITIVE(MapConstructor, argc, argv, context, interp, loc) { FunctionObj *func = argv[0]->asFunction(); if (!func) return argError(interp, loc, InterpreterMessages::notAProcedure, 0, argv[0]); if (func->totalArgs() > 0) { interp.setNextLocation(loc); interp.message(InterpreterMessages::tooManyArgs); return interp.makeError(); } NodeListObj *nl = argv[1]->asNodeList(); ELObjDynamicRoot protect1(interp, nl); if (!nl) return argError(interp, loc, InterpreterMessages::notANodeList, 1, argv[1]); AppendSosofoObj *obj = new (interp) AppendSosofoObj; ELObjDynamicRoot protect2(interp, obj); NodePtr nd; ELObj *ret; InsnPtr insn(func->makeCallInsn(0, interp, loc, InsnPtr())); VM vm(context, interp); while (nd = nl->nodeListFirst(context, interp)) { nl = nl->nodeListRest(context, interp); protect1 = nl; EvalContext::CurrentNodeSetter cns(nd, context.processingMode, vm); ret = vm.eval(insn.pointer()); if (!ret->asSosofo()) { interp.setNextLocation(loc); interp.message(InterpreterMessages::returnNotSosofo); return interp.makeError(); } obj->append(ret->asSosofo()); } return obj; } DEFPRIMITIVE(SubgroveSpec, argc, argv, context, interp, loc) { static const Identifier::SyntacticKey keys[10] = { Identifier::keyNode, Identifier::keySubgrove, Identifier::keyClass, Identifier::keyAdd, Identifier::keyNull, Identifier::keyRemove, Identifier::keyChildren, Identifier::keySub, Identifier::keyLabel, Identifier::keySortChildren, }; int pos[10]; if (!decodeKeyArgs(argc, argv, keys, 10, interp, loc, pos)) return interp.makeError(); if ((pos[0] >= 0) + (pos[1] >= 0) + (pos[2] >= 0) != 1) { interp.setNextLocation(loc); interp.message(InterpreterMessages::subgroveArgs); return interp.makeError(); } // FIXME: check the type of these args ELObj *add = (pos[3] >= 0) ? argv[pos[3]] : 0; ELObj *null = (pos[4] >= 0) ? argv[pos[4]] : 0; ELObj *remove = (pos[5] >= 0) ? argv[pos[5]] : 0; ELObj *children = (pos[6] >= 0) ? argv[pos[6]] : 0; ELObj *sub = (pos[7] >= 0) ? argv[pos[7]] : 0; ELObj *label = (pos[8] >= 0) ? argv[pos[8]] : 0; FunctionObj *sort = 0; if (pos[9] >= 0) { sort = argv[pos[9]]->asFunction(); if (!sort) return argError(interp, loc, InterpreterMessages::notAProcedure, pos[0], argv[pos[9]]); } NodePtr node; NodePtr subgrove; SymbolObj *cls = 0; if (pos[0] >= 0) { if (!argv[pos[0]]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, pos[0], argv[pos[0]]); } else if (pos[1] >= 0) { if (!argv[pos[1]]->optSingletonNodeList(context, interp, subgrove) || !subgrove) return argError(interp, loc, InterpreterMessages::notASingletonNode, pos[1], argv[pos[1]]); if (add || null || remove || children || sub) { interp.setNextLocation(loc); interp.message(InterpreterMessages::subgroveSubgroveArgs); return interp.makeError(); } } else { cls = argv[pos[2]]->asSymbol(); if (!cls) return argError(interp, loc, InterpreterMessages::notASymbol, pos[2], argv[pos[2]]); if (remove) { interp.setNextLocation(loc); interp.message(InterpreterMessages::subgroveClassArgs); return interp.makeError(); } } return new (interp) SubgroveSpecObj(node, subgrove, cls, add, null, remove, sub, children, label, sort); } DEFPRIMITIVE(IsCreateSpec, argc, argv, context, interp, loc) { if (argv[0]->asCreateSpec()) return interp.makeTrue(); else return interp.makeFalse(); } DEFPRIMITIVE(CreateRoot, argc, argv, context, interp, loc) { SubgroveSpecObj *sg = argv[1]->asSubgroveSpec(); if (!sg) return argError(interp, loc, InterpreterMessages::notASubgroveSpec, 1, argv[1]); return new (interp) CreateSpecObj(CreateSpecObj::root, argv[0], 0, sg, 0, 0, 0, 0, 0); } DEFPRIMITIVE(CreateSub, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); SubgroveSpecObj *sg = argv[1]->asSubgroveSpec(); if (!sg) return argError(interp, loc, InterpreterMessages::notASubgroveSpec, 1, argv[1]); static const Identifier::SyntacticKey keys[5] = { Identifier::keyProperty, Identifier::keyLabel, Identifier::keyResultPath, Identifier::keyOptional, Identifier::keyUnique, }; int pos[5]; if (!decodeKeyArgs(argc - 2, argv + 2, keys, 5, interp, loc, pos)) return interp.makeError(); StringObj *prop = 0; if (pos[0] >= 0) { prop = argv[pos[0] + 2]->convertToString(); if (!prop) return argError(interp, loc, InterpreterMessages::notAStringOrSymbol, pos[0] + 2, argv[pos[0] + 2]); } ELObj *label = (pos[1] >= 0 ? argv[pos[1] + 2] : 0); FunctionObj *rp = 0; if (pos[2] >= 0) { rp = argv[pos[2] + 2]->asFunction(); if (!rp) return argError(interp, loc, InterpreterMessages::notAProcedure, pos[2] + 2, argv[pos[2] + 2]); } bool opt = (pos[3] >= 0 ? argv[pos[3] + 2]->isTrue() : 0); bool uniq = (pos[4] >= 0 ? argv[pos[4] + 2]->isTrue() : 0); return new (interp) CreateSpecObj(CreateSpecObj::sub, 0, node, sg, prop, label, rp, opt, uniq); } DEFPRIMITIVE(CreatePreced, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); SubgroveSpecObj *sg = argv[1]->asSubgroveSpec(); if (!sg) return argError(interp, loc, InterpreterMessages::notASubgroveSpec, 1, argv[1]); static const Identifier::SyntacticKey keys[4] = { Identifier::keyLabel, Identifier::keyResultPath, Identifier::keyOptional, Identifier::keyUnique, }; int pos[4]; if (!decodeKeyArgs(argc - 2, argv + 2, keys, 4, interp, loc, pos)) return interp.makeError(); ELObj *label = (pos[0] >= 0 ? argv[pos[0] + 2] : 0); FunctionObj *rp = 0; if (pos[1] >= 0) { rp = argv[pos[1] + 2]->asFunction(); if (!rp) return argError(interp, loc, InterpreterMessages::notAProcedure, pos[1] + 2, argv[pos[1] + 2]); } bool opt = (pos[2] >= 0 ? argv[pos[2] + 2]->isTrue() : 0); bool uniq = (pos[3] >= 0 ? argv[pos[3] + 2]->isTrue() : 0); return new (interp) CreateSpecObj(CreateSpecObj::preced, 0, node, sg, 0, label, rp, opt, uniq); } DEFPRIMITIVE(CreateFollow, argc, argv, context, interp, loc) { NodePtr node; if (!argv[0]->optSingletonNodeList(context, interp, node) || !node) return argError(interp, loc, InterpreterMessages::notASingletonNode, 0, argv[0]); SubgroveSpecObj *sg = argv[1]->asSubgroveSpec(); if (!sg) return argError(interp, loc, InterpreterMessages::notASubgroveSpec, 1, argv[1]); static const Identifier::SyntacticKey keys[4] = { Identifier::keyLabel, Identifier::keyResultPath, Identifier::keyOptional, Identifier::keyUnique, }; int pos[4]; if (!decodeKeyArgs(argc - 2, argv + 2, keys, 4, interp, loc, pos)) return interp.makeError(); ELObj *label = (pos[0] >= 0 ? argv[pos[0] + 2] : 0); FunctionObj *rp = 0; if (pos[1] >= 0) { rp = argv[pos[1] + 2]->asFunction(); if (!rp) return argError(interp, loc, InterpreterMessages::notAProcedure, pos[1] + 2, argv[pos[1] + 2]); } bool opt = (pos[2] >= 0 ? argv[pos[2] + 2]->isTrue() : 0); bool uniq = (pos[3] >= 0 ? argv[pos[3] + 2]->isTrue() : 0); return new (interp) CreateSpecObj(CreateSpecObj::follow, 0, node, sg, 0, label, rp, opt, uniq); } void Interpreter::installPrimitives() { #define PRIMITIVE(name, string, nRequired, nOptional, rest, feature) \ installPrimitive(string, new (*this) name ## PrimitiveObj, feature); #define XPRIMITIVE(name, string, nRequired, nOptional, rest) \ installXPrimitive("UNREGISTERED::James Clark//Procedure::", \ string, new (*this) name ## PrimitiveObj); #define XXPRIMITIVE(name, string, nRequired, nOptional, rest) \ installXPrimitive("UNREGISTERED::OpenJade//Procedure::", \ string, new (*this) name ## PrimitiveObj); #define PRIMITIVE2(name, string, nRequired, nOptional, rest) \ if (dsssl2()) installPrimitive(string, new (*this) name ## PrimitiveObj, noFeature); #define SPRIMITIVE(name, string, nRequired, nOptional, rest, feature) \ if (style()) installPrimitive(string, new (*this) name ## PrimitiveObj, feature); #define TPRIMITIVE(name, string, nRequired, nOptional, rest, feature) \ if (!style()) installPrimitive(string, new (*this) name ## PrimitiveObj, feature); #include "primitive.h" #undef PRIMITIVE #undef XPRIMITIVE #undef XXPRIMITIVE #undef PRIMITIVE2 #undef SPRIMITIVE #undef TPRIMITIVE FunctionObj *apply = new (*this) ApplyPrimitiveObj; makePermanent(apply); lookup(makeStringC("apply"))->setValue(apply); if (dsssl2()) { FunctionObj *callCC = new (*this) CallWithCurrentContinuationPrimitiveObj; makePermanent(callCC); lookup(makeStringC("call-with-current-continuation"))->setValue(callCC); } if (dsssl2()) lookup(makeStringC("string->quantity")) ->setValue(lookup(makeStringC("string->number"))->computeValue(0, *this)); } void Interpreter::installPrimitive(const char *s, PrimitiveObj *value, Interpreter::Feature feature) { makePermanent(value); Identifier *ident = lookup(makeStringC(s)); ident->setValue(value); ident->setFeature(feature); value->setIdentifier(ident); StringC pubid(makeStringC("ISO/IEC 10179:1996//Procedure::")); pubid += makeStringC(s); externalProcTable_.insert(pubid, value); } void Interpreter::installXPrimitive(const char *prefix, const char *s, PrimitiveObj *value) { makePermanent(value); value->setIdentifier(lookup(makeStringC(s))); StringC pubid(makeStringC(prefix)); pubid += makeStringC(s); externalProcTable_.insert(pubid, value); } TreeNodeListObj::TreeNodeListObj(const NodePtr &start) : start_(start), root_(start) { } NodePtr TreeNodeListObj::nodeListFirst(EvalContext &, Interpreter &) { return start_; } NodeListObj *TreeNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { TreeNodeListObj *obj = copy(interp); // SubgroveNodeListObj::advance uses ELObjPropertyValue, so we must // protect obj. ELObjDynamicRoot protect(interp, obj); obj->advance(context, interp); return obj; } NodeListObj *TreeNodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { TreeNodeListObj *obj = copy(interp); // SubgroveNodeListObj::chunkAdvance uses ELObjPropertyValue, so we must // protect obj. ELObjDynamicRoot protect(interp, obj); obj->chunkAdvance(context, interp); chunk = 1; return obj; } SubgroveNodeListObj::SubgroveNodeListObj(const NodePtr &start) : TreeNodeListObj(start), depth_(0) { } SubgroveNodeListObj *SubgroveNodeListObj::copy(Interpreter &interp) { return new (interp) SubgroveNodeListObj(*this); } void SubgroveNodeListObj::advance(EvalContext &context, Interpreter &interp) { if (!start_) return; // try to move down const ComponentName::Id *ids; if (start_->getSubnodePropertyNames(ids) == accessOK) { for (;*ids != ComponentName::noId; ids++) { ELObjPropertyValue pv(interp, 0); NodeListObj *nl; NodePtr nd; if (start_->property(*ids, interp, pv) == accessOK && (nl = pv.obj->asNodeList()) && (nd = nl->nodeListFirst(context, interp))) { start_ = nd; depth_++; return; } } } // check if we are back up to the root if (depth_ == 0) { start_.clear(); return; } // try to move horziontally first in the same property of origin while (start_.assignNextSibling() != accessOK) { NodePtr origin; ComponentName::Id orel; const ComponentName::Id *ids; if (start_->getOrigin(origin) != accessOK || start_->getOriginToSubnodeRelPropertyName(orel) != accessOK || origin->getSubnodePropertyNames(ids) != accessOK) { start_.clear(); return; } for (; *ids != orel; ids++) ; // ...and then in the other properties of origin for (ids++; *ids != ComponentName::noId; ids++) { ELObjPropertyValue pv(interp, 0); NodeListObj *nl; NodePtr nd; if (origin->property(*ids, interp, pv) == accessOK && (nl = pv.obj->asNodeList()) && (nd = nl->nodeListFirst(context, interp))) { start_ = nd; return; } } if (depth_ == 1 || start_.assignOrigin() != accessOK) { start_.clear(); return; } depth_--; } } void SubgroveNodeListObj::chunkAdvance(EvalContext &context, Interpreter &interp) { if (!start_) return; // try to move down const ComponentName::Id *ids; if (start_->getSubnodePropertyNames(ids) == accessOK) { for (;*ids != ComponentName::noId; ids++) { ELObjPropertyValue pv(interp, 0); NodeListObj *nl; NodePtr nd; if (start_->property(*ids, interp, pv) == accessOK && (nl = pv.obj->asNodeList()) && (nd = nl->nodeListFirst(context, interp))) { start_ = nd; depth_++; return; } } } // check if we are back up to the root if (depth_ == 0) { start_.clear(); return; } // try to move horziontally first in the same property of origin while (start_.assignNextChunkSibling() != accessOK) { NodePtr origin; ComponentName::Id orel; const ComponentName::Id *ids; if (start_->getOrigin(origin) != accessOK || start_->getOriginToSubnodeRelPropertyName(orel) != accessOK || origin->getSubnodePropertyNames(ids) != accessOK) { start_.clear(); return; } for (; *ids != orel; ids++) ; // ...and then in the other properties of origin for (ids++; *ids != ComponentName::noId; ids++) { ELObjPropertyValue pv(interp, 0); NodeListObj *nl; NodePtr nd; if (origin->property(*ids, interp, pv) == accessOK && (nl = pv.obj->asNodeList()) && (nd = nl->nodeListFirst(context, interp))) { start_ = nd; return; } } if (depth_ == 1 || start_.assignOrigin() != accessOK) { start_.clear(); return; } depth_--; } } bool SubgroveNodeListObj::contains(EvalContext &, Interpreter &, const NodePtr &ptr) { if (!start_) return 0; NodePtr nd(ptr); unsigned int depth = 0; // determine the depth of ptr for(;;) { if (*start_ == *nd) return 1; // start_ ancestor of ptr if (*root_ == *nd) break; if (nd->getOrigin(nd) != accessOK) return 0; depth++; } nd = ptr; for (; depth > depth_; depth--) nd->getOrigin(nd); NodePtr s(start_); for (; depth_ > depth; depth++) s->getOrigin(s); if (*s == *nd) return 0; // ptr ancestor of start_ // now s and nd are ancestors of start_ and ptr at the same depth NodePtr s1(s); NodePtr nd1(nd); while (*s1 != *nd1) { nd = nd1; s = s1; nd1->getOrigin(nd1); s1->getOrigin(s1); } // now s and nd are ancestors of start_ and ptr with common parent s1 unsigned long i1, i2; if (s->siblingsIndex(i1) == accessOK && nd->siblingsIndex(i2) == accessOK) return (i1 < i2); NodePtr sibling; if (s->firstSibling(sibling) != accessOK) return 0; for (;;) { if (*sibling == *s) return 1; if (*sibling == *nd) return 0; if (sibling.assignNextSibling() != accessOK) return 0; } return 0; } SubtreeNodeListObj::SubtreeNodeListObj(const NodePtr &start) : TreeNodeListObj(start), depth_(0) { } SubtreeNodeListObj *SubtreeNodeListObj::copy(Interpreter &interp) { return new (interp) SubtreeNodeListObj(*this); } void SubtreeNodeListObj::advance(EvalContext &, Interpreter &) { if (!start_) return; if (start_.assignFirstChild() == accessOK) { depth_++; return; } if (depth_ == 0) { start_.clear(); return; } while (start_.assignNextSibling() != accessOK) { if (depth_ == 1 || start_.assignOrigin() != accessOK) { start_.clear(); return; } depth_--; } } void SubtreeNodeListObj::chunkAdvance(EvalContext &, Interpreter &) { if (!start_) return; if (start_.assignFirstChild() == accessOK) { depth_++; return; } if (depth_ == 0) { start_.clear(); return; } while (start_.assignNextChunkSibling() != accessOK) { if (depth_ == 1 || start_.assignOrigin() != accessOK) { start_.clear(); return; } depth_--; } } bool SubtreeNodeListObj::contains(EvalContext &, Interpreter &, const NodePtr &ptr) { if (!start_) return 0; NodePtr nd(ptr); unsigned int depth = 0; // determine the depth of ptr for(;;) { if (*start_ == *nd) return 1; // start_ ancestor of ptr if (*root_ == *nd) break; if (nd->getParent(nd) != accessOK) return 0; depth++; } nd = ptr; for (; depth > depth_; depth--) nd->getParent(nd); NodePtr s(start_); for (; depth_ > depth; depth++) s->getParent(s); if (*s == *nd) return 0; // ptr ancestor of start_ // now s and nd are ancestors of start_ and ptr at the same depth NodePtr s1(s); NodePtr nd1(nd); while (*s1 != *nd1) { nd = nd1; s = s1; nd1->getParent(nd1); s1->getParent(s1); } // now s and nd are ancestors of start_ and ptr with common parent s1 unsigned long i1, i2; if (s->siblingsIndex(i1) == accessOK && nd->siblingsIndex(i2) == accessOK) return (i1 < i2); NodePtr sibling; if (s->firstSibling(sibling) != accessOK) return 0; for (;;) { if (*sibling == *s) return 1; if (*sibling == *nd) return 0; if (sibling.assignNextSibling() != accessOK) return 0; } return 0; } DescendantsNodeListObj::DescendantsNodeListObj(const NodePtr &start, Interpreter &interp) : SubtreeNodeListObj(start) { EvalContext context; advance(context, interp); } DescendantsNodeListObj *DescendantsNodeListObj::copy(Interpreter &interp) { return new (interp) DescendantsNodeListObj(*this); } bool DescendantsNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &ptr) { return (*ptr != *root_ && SubtreeNodeListObj::contains(context, interp, ptr)); } SelectByClassNodeListObj::SelectByClassNodeListObj(NodeListObj *nl, ComponentName::Id cls) : nodeList_(nl), cls_(cls) { hasSubObjects_ = 1; } NodePtr SelectByClassNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nodeList_->nodeListFirst(context, interp); if (!nd || nd->classDef().className == cls_) return nd; // All nodes in a chunk have the same class bool chunk; nodeList_ = nodeList_->nodeListChunkRest(context, interp, chunk); } // not reached return NodePtr(); } NodeListObj *SelectByClassNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nodeList_->nodeListFirst(context, interp); if (!nd || nd->classDef().className == cls_) break; // All nodes in a chunk have the same class bool chunk; nodeList_ = nodeList_->nodeListChunkRest(context, interp, chunk); } NodeListObj *tem = nodeList_->nodeListRest(context, interp); ELObjDynamicRoot protect(interp, tem); return new (interp) SelectByClassNodeListObj(tem, cls_); } NodeListObj *SelectByClassNodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { for (;;) { NodePtr nd = nodeList_->nodeListFirst(context, interp); if (!nd) return interp.makeEmptyNodeList(); if (nd->classDef().className == cls_) break; bool tem; nodeList_ = nodeList_->nodeListChunkRest(context, interp, tem); } NodeListObj *tem = nodeList_->nodeListChunkRest(context, interp, chunk); ELObjDynamicRoot protect(interp, tem); return new (interp) SelectByClassNodeListObj(tem, cls_); } void SelectByClassNodeListObj::traceSubObjects(Collector &c) const { c.trace(nodeList_); } bool SelectByClassNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &n) { return (n->classDef().className == cls_ && nodeList_->contains(context, interp, n)); } FilterNodeListObj::FilterNodeListObj(FunctionObj *func, NodeListObj *nl, const ConstPtr &context) : MapNodeListObj(func, nl, context) { } bool FilterNodeListObj::maybeIn(EvalContext &context, Interpreter &interp, const NodePtr &nd) { VM vm(context, interp); context_->set(vm); InsnPtr insn(func_->makeCallInsn(1, interp, context_->loc, InsnPtr())); ELObj *ret = vm.eval(insn.pointer(), 0, new (interp) NodePtrNodeListObj(nd)); return ret->isTrue(); } NodePtr FilterNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nl_->nodeListFirst(context, interp); if (!nd || maybeIn(context, interp, nd)) return nd; nl_ = nl_->nodeListRest(context, interp); } // not reached return NodePtr(); } NodeListObj *FilterNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nl_->nodeListFirst(context, interp); if (!nd || maybeIn(context, interp, nd)) break; nl_ = nl_->nodeListRest(context, interp); } NodeListObj *tem = nl_->nodeListRest(context, interp); ELObjDynamicRoot protect(interp, tem); return new (interp) FilterNodeListObj(func_, tem, context_); } bool FilterNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &nd) { VM vm(context, interp); context_->set(vm); InsnPtr insn(func_->makeCallInsn(1, interp, context_->loc, InsnPtr())); ELObj *ret = vm.eval(insn.pointer(), 0, new (interp) NodePtrNodeListObj(nd)); return (ret->isTrue() && nl_->contains(context, interp, nd)); } MapNodeListObj::MapNodeListObj(FunctionObj *func, NodeListObj *nl, const ConstPtr &context, NodeListObj *mapped) : func_(func), nl_(nl), context_(context), mapped_(mapped) { hasSubObjects_ = 1; } NodePtr MapNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { for (;;) { if (!mapped_) { mapNext(context, interp); if (!mapped_) break; } NodePtr nd = mapped_->nodeListFirst(context, interp); if (nd) return nd; mapped_ = 0; } return NodePtr(); } NodeListObj *MapNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { for (;;) { if (!mapped_) { mapNext(context, interp); if (!mapped_) break; } NodePtr nd = mapped_->nodeListFirst(context, interp); if (nd) { NodeListObj *tem = mapped_->nodeListRest(context, interp); ELObjDynamicRoot protect(interp, tem); return new (interp) MapNodeListObj(func_, nl_, context_, tem); } mapped_ = 0; } return interp.makeEmptyNodeList(); } void MapNodeListObj::mapNext(EvalContext &context, Interpreter &interp) { if (!func_) return; NodePtr nd = nl_->nodeListFirst(context, interp); if (!nd) return; VM vm(context, interp); context_->set(vm); InsnPtr insn(func_->makeCallInsn(1, interp, context_->loc, InsnPtr())); ELObj *ret = vm.eval(insn.pointer(), 0, new (interp) NodePtrNodeListObj(nd)); if (interp.isError(ret)) { func_ = 0; return; } mapped_ = ret->asNodeList(); if (!mapped_) { interp.setNextLocation(context_->loc); interp.message(InterpreterMessages::returnNotNodeList); func_ = 0; return; } nl_ = nl_->nodeListRest(context, interp); } void MapNodeListObj::traceSubObjects(Collector &c) const { c.trace(nl_); c.trace(func_); c.trace(mapped_); context_->traceSubObjects(c); } bool MapNodeListObj::suppressError() { return func_ == 0; } MapNodeListObj::Context::Context(const EvalContext &context, const Location &l) : loc(l), haveStyleStack_(context.styleStack != 0), processingMode_(context.processingMode), currentNode_(context.currentNode), overridingStyle_(context.overridingStyle) { } void MapNodeListObj::Context::set(EvalContext &context) const { context.processingMode = processingMode_; context.currentNode = currentNode_; context.overridingStyle = overridingStyle_; if (!haveStyleStack_) context.styleStack = 0; } void MapNodeListObj::Context::traceSubObjects(Collector &c) const { c.trace(overridingStyle_); } SelectElementsNodeListObj::SelectElementsNodeListObj(NodeListObj *nodeList, const ConstPtr &patterns) : nodeList_(nodeList), patterns_(patterns) { ASSERT(!patterns_.isNull()); hasSubObjects_ = 1; } SelectElementsNodeListObj::SelectElementsNodeListObj(NodeListObj *nodeList, NCVector &patterns) : nodeList_(nodeList) { hasSubObjects_ = 1; Ptr tem(new PatternSet); tem->swap(patterns); patterns_ = tem; } void SelectElementsNodeListObj::traceSubObjects(Collector &c) const { c.trace(nodeList_); } NodePtr SelectElementsNodeListObj::nodeListFirst(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nodeList_->nodeListFirst(context, interp); if (!nd) return nd; for (size_t i = 0; i < patterns_->size(); i++) if ((*patterns_)[i].matches(nd, interp)) return nd; bool chunk; nodeList_ = nodeList_->nodeListChunkRest(context, interp, chunk); } // not reached return NodePtr(); } NodeListObj *SelectElementsNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { for (;;) { NodePtr nd = nodeList_->nodeListFirst(context, interp); if (!nd) break; bool matched = 0; for (size_t i = 0; i < patterns_->size(); i++) { if ((*patterns_)[i].matches(nd, interp)) { matched = 1; break; } } if (matched) break; bool chunk; nodeList_ = nodeList_->nodeListChunkRest(context, interp, chunk); } bool chunk; NodeListObj *tem = nodeList_->nodeListChunkRest(context, interp, chunk); ELObjDynamicRoot protect(interp, tem); return new (interp) SelectElementsNodeListObj(tem, patterns_); } bool SelectElementsNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &ptr) { for (size_t i = 0; i < patterns_->size(); i++) if ((*patterns_)[i].matches(ptr, interp)) return nodeList_->contains(context, interp, ptr); return 0; } SiblingNodeListObj::SiblingNodeListObj(const NodePtr &first, const NodePtr &end) : first_(first), end_(end) { } NodePtr SiblingNodeListObj::nodeListFirst(EvalContext &, Interpreter &) { if (*first_ == *end_) return NodePtr(); return first_; } NodeListObj *SiblingNodeListObj::nodeListRest(EvalContext &context, Interpreter &interp) { if (*first_ == *end_) return interp.makeEmptyNodeList(); NodePtr nd; if (first_->nextSibling(nd) != accessOK) CANNOT_HAPPEN(); return new (interp) SiblingNodeListObj(nd, end_); } NodeListObj *SiblingNodeListObj::nodeListChunkRest(EvalContext &context, Interpreter &interp, bool &chunk) { if (first_->chunkContains(*end_)) { chunk = 0; return nodeListRest(context, interp); } NodePtr nd; if (first_->nextChunkSibling(nd) != accessOK) CANNOT_HAPPEN(); chunk = 1; return new (interp) SiblingNodeListObj(nd, end_); } bool SiblingNodeListObj::contains(EvalContext &context, Interpreter &interp, const NodePtr &ptr) { NodePtr origin1, origin2; if (first_->getOrigin(origin1) != accessOK || ptr->getOrigin(origin2) != accessOK || *origin1 != *origin2) return 0; unsigned long i1, i2, i3; if (first_->siblingsIndex(i1) == accessOK && ptr->siblingsIndex(i2) == accessOK && end_->siblingsIndex(i3) == accessOK) return i1 <= i2 && i2 < i3; return NodeListObj::contains(context, interp, ptr); } #ifdef DSSSL_NAMESPACE } #endif #include "primitive_inst.cxx" OpenJade-1.4devel/style/primitive.h0000644000021000000240000003264107067706751013071 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. PRIMITIVE(Cons, "cons", 2, 0, 0, expression) PRIMITIVE(List, "list", 0, 0, 1, noFeature) PRIMITIVE(IsNull, "null?", 1, 0, 0, noFeature) PRIMITIVE(IsList, "list?", 1, 0, 0, noFeature) PRIMITIVE(IsPair, "pair?", 1, 0, 0, expression) PRIMITIVE(IsEqual, "equal?", 2, 0, 0, noFeature) PRIMITIVE(Car, "car", 1, 0, 0, expression) PRIMITIVE(Cdr, "cdr", 1, 0, 0, expression) PRIMITIVE(Length, "length", 1, 0, 0, noFeature) PRIMITIVE(Append, "append", 0, 0, 1, noFeature) PRIMITIVE(Reverse, "reverse", 1, 0, 0, noFeature) PRIMITIVE(ListTail, "list-tail", 2, 0, 0, noFeature) PRIMITIVE(ListRef, "list-ref", 2, 0, 0, noFeature) PRIMITIVE(Member, "member", 2, 0, 0, noFeature) PRIMITIVE(Not, "not", 1, 0, 0, noFeature) PRIMITIVE(IsSymbol, "symbol?", 1, 0, 0, noFeature) PRIMITIVE(IsKeyword, "keyword?", 1, 0, 0, noFeature) PRIMITIVE(IsBoolean, "boolean?", 1, 0, 0, noFeature) PRIMITIVE(IsProcedure, "procedure?", 1, 0, 0, noFeature) PRIMITIVE(IsString, "string?", 1, 0, 0, noFeature) PRIMITIVE(IsInteger, "integer?", 1, 0, 0, noFeature) PRIMITIVE(IsReal, "real?", 1, 0, 0, noFeature) PRIMITIVE(IsNumber, "number?", 1, 0, 0, noFeature) PRIMITIVE(IsQuantity, "quantity?", 1, 0, 0, noFeature) PRIMITIVE(IsChar, "char?", 1, 0, 0, noFeature) PRIMITIVE(IsCharEqual, "char=?", 2, 0, 0, noFeature) PRIMITIVE(String, "string", 0, 0, 1, noFeature) PRIMITIVE(SymbolToString, "symbol->string", 1, 0, 0, expression) PRIMITIVE(StringToSymbol, "string->symbol", 1, 0, 0, expression) PRIMITIVE(StringLength, "string-length", 1, 0, 0, noFeature) PRIMITIVE(IsStringEqual, "string=?", 2, 0, 0, noFeature) PRIMITIVE(StringAppend, "string-append", 0, 0, 1, noFeature) PRIMITIVE(StringRef, "string-ref", 2, 0, 0, noFeature) PRIMITIVE(Substring, "substring", 3, 0, 0, noFeature) PRIMITIVE(Equal, "=", 0, 0, 1, noFeature) PRIMITIVE(Plus, "+", 0, 0, 1, noFeature) PRIMITIVE(Minus, "-", 1, 0, 1, noFeature) PRIMITIVE(Multiply, "*", 0, 0, 1, noFeature) PRIMITIVE(Divide, "/", 1, 0, 1, noFeature) PRIMITIVE(Quotient, "quotient", 2, 0, 0, noFeature) PRIMITIVE(Remainder, "remainder", 2, 0, 0, noFeature) PRIMITIVE(Modulo, "modulo", 2, 0, 0, noFeature) PRIMITIVE(Less, "<", 0, 0, 1, noFeature) PRIMITIVE(Greater, ">", 0, 0, 1, noFeature) PRIMITIVE(LessEqual, "<=", 0, 0, 1, noFeature) PRIMITIVE(GreaterEqual, ">=", 0, 0, 1, noFeature) PRIMITIVE(Min, "min", 1, 0, 1, noFeature) PRIMITIVE(Max, "max", 1, 0, 1, noFeature) PRIMITIVE(Floor, "floor", 1, 0, 0, noFeature) PRIMITIVE(Ceiling, "ceiling", 1, 0, 0, noFeature) PRIMITIVE(Truncate, "truncate", 1, 0, 0, noFeature) PRIMITIVE(Round, "round", 1, 0, 0, noFeature) PRIMITIVE(Abs, "abs", 1, 0, 0, noFeature) PRIMITIVE(Sqrt, "sqrt", 1, 0, 0, noFeature) PRIMITIVE(Time, "time", 0, 0, 0, noFeature) PRIMITIVE(TimeToString, "time->string", 1, 1, 0, noFeature) PRIMITIVE(CharProperty, "char-property", 2, 1, 0, noFeature) SPRIMITIVE(Literal, "literal", 0, 0, 1, noFeature) SPRIMITIVE(ProcessChildren, "process-children", 0, 0, 0, noFeature) SPRIMITIVE(ProcessChildrenTrim, "process-children-trim", 0, 0, 0, noFeature) SPRIMITIVE(SosofoAppend, "sosofo-append", 0, 0, 1, noFeature) SPRIMITIVE(NextMatch, "next-match", 0, 1, 0, noFeature) SPRIMITIVE(EmptySosofo, "empty-sosofo", 0, 0, 0, noFeature) SPRIMITIVE(SosofoLabel, "sosofo-label", 2, 0, 0, noFeature) SPRIMITIVE(SosofoDiscardLabeled, "sosofo-discard-labeled", 2, 0, 0, noFeature) SPRIMITIVE(IsSosofo, "sosofo?", 1, 0, 0, noFeature) SPRIMITIVE(IsStyle, "style?", 1, 0, 0, noFeature) SPRIMITIVE(MergeStyle, "merge-style", 0, 0, 1, noFeature) SPRIMITIVE(ProcessElementWithId, "process-element-with-id", 1, 0, 0, crossReference) SPRIMITIVE(ProcessFirstDescendant, "process-first-descendant", 0, 0, 1, noFeature) SPRIMITIVE(ProcessMatchingChildren, "process-matching-children", 0, 0, 1, noFeature) SPRIMITIVE(ProcessNodeList, "process-node-list", 1, 0, 0, query) SPRIMITIVE(CurrentNodePageNumberSosofo, "current-node-page-number-sosofo", 0, 0, 0, simplePage) SPRIMITIVE(PageNumberSosofo, "page-number-sosofo", 0, 0, 0, simplePage) PRIMITIVE(FormatNumber, "format-number", 2, 0, 0, noFeature) PRIMITIVE(FormatNumberList, "format-number-list", 3, 0, 0, noFeature) PRIMITIVE(Error, "error", 1, 0, 0, noFeature) PRIMITIVE(ExternalProcedure, "external-procedure", 1, 0, 0, noFeature) PRIMITIVE(StringToNumber, "string->number", 1, 1, 0, noFeature) PRIMITIVE(NumberToString, "number->string", 1, 1, 0, noFeature) SPRIMITIVE(DisplaySize, "display-size", 0, 0, 0, noFeature) SPRIMITIVE(TableUnit, "table-unit", 1, 0, 0, table) SPRIMITIVE(IsDisplaySpace, "display-space?", 1, 0, 0, noFeature) SPRIMITIVE(DisplaySpace, "display-space", 1, 0, 1, noFeature) SPRIMITIVE(IsInlineSpace, "inline-space?", 1, 0, 0, noFeature) SPRIMITIVE(InlineSpace, "inline-space", 1, 0, 1, noFeature) SPRIMITIVE(IsColor, "color?", 1, 0, 0, noFeature) SPRIMITIVE(IsColorSpace, "color-space?", 1, 0, 0, noFeature) SPRIMITIVE(Color, "color", 1, 0, 1, noFeature) SPRIMITIVE(ColorSpace, "color-space", 1, 0, 1, noFeature) SPRIMITIVE(IsAddress, "address?", 1, 0, 0, noFeature) SPRIMITIVE(IsAddressLocal, "address-local?", 1, 0, 0, noFeature) SPRIMITIVE(IsAddressVisited, "address-visited?", 1, 0, 0, noFeature) SPRIMITIVE(CurrentNodeAddress, "current-node-address", 0, 0, 0, noFeature) SPRIMITIVE(IdrefAddress, "idref-address", 1, 0, 0, noFeature) SPRIMITIVE(EntityAddress, "entity-address", 1, 0, 0, noFeature) SPRIMITIVE(SgmlDocumentAddress, "sgml-document-address", 2, 0, 0, noFeature) SPRIMITIVE(NodeListAddress, "node-list-address", 1, 0, 0, noFeature) SPRIMITIVE(HytimeLinkend, "hytime-linkend", 0, 0, 0, noFeature) SPRIMITIVE(CharScriptCase, "char-script-case", 1, 0, 1, noFeature) SPRIMITIVE(IsGlyphId, "glyph-id?", 1, 0, 0, noFeature) SPRIMITIVE(GlyphId, "glyph-id", 1, 0, 0, noFeature) SPRIMITIVE(IsGlyphSubstTable, "glyph-subst-table?", 1, 0, 0, noFeature) SPRIMITIVE(GlyphSubstTable, "glyph-subst-table", 1, 0, 0, noFeature) SPRIMITIVE(GlyphSubst, "glyph-subst", 2, 0, 0, noFeature) // Core query language PRIMITIVE(CurrentNode, "current-node", 0, 0, 0, noFeature) PRIMITIVE(IsNodeListEmpty, "node-list-empty?", 1, 0, 0, noFeature) PRIMITIVE(IsNodeList, "node-list?", 1, 0, 0, noFeature) PRIMITIVE(NodeListError, "node-list-error", 2, 0, 0, noFeature) PRIMITIVE(Gi, "gi", 0, 1, 0, noFeature) PRIMITIVE(FirstChildGi, "first-child-gi", 0, 1, 0, noFeature) PRIMITIVE(Id, "id", 0, 1, 0, noFeature) PRIMITIVE(Parent, "parent", 0, 1, 0, noFeature) PRIMITIVE(Ancestor, "ancestor", 1, 1, 0, noFeature) PRIMITIVE(AttributeString, "attribute-string", 1, 1, 0, noFeature) PRIMITIVE(InheritedAttributeString, "inherited-attribute-string", 1, 1, 0, noFeature) PRIMITIVE(InheritedElementAttributeString, "inherited-element-attribute-string", 2, 1, 0, noFeature) PRIMITIVE(IsFirstSibling, "first-sibling?", 0, 1, 0, noFeature) PRIMITIVE(IsAbsoluteFirstSibling, "absolute-first-sibling?", 0, 1, 0, noFeature) PRIMITIVE(IsLastSibling, "last-sibling?", 0, 1, 0, noFeature) PRIMITIVE(IsAbsoluteLastSibling, "absolute-last-sibling?", 0, 1, 0, noFeature) PRIMITIVE(IsHaveAncestor, "have-ancestor?", 1, 1, 0, noFeature) PRIMITIVE(ChildNumber, "child-number", 0, 1, 0, noFeature) PRIMITIVE(AncestorChildNumber, "ancestor-child-number", 1, 1, 0, noFeature) PRIMITIVE(HierarchicalNumber, "hierarchical-number", 1, 1, 0, noFeature) PRIMITIVE(HierarchicalNumberRecursive, "hierarchical-number-recursive", 1, 1, 0, noFeature) PRIMITIVE(ElementNumber, "element-number", 0, 1, 0, noFeature) PRIMITIVE(ElementNumberList, "element-number-list", 1, 1, 0, noFeature) PRIMITIVE(EntitySystemId, "entity-system-id", 1, 1, 0, noFeature) PRIMITIVE(EntityPublicId, "entity-public-id", 1, 1, 0, noFeature) PRIMITIVE(EntityGeneratedSystemId, "entity-generated-system-id", 1, 1, 0, noFeature) PRIMITIVE(EntityText, "entity-text", 1, 1, 0, noFeature) PRIMITIVE(EntityNotation, "entity-notation", 1, 1, 0, noFeature) PRIMITIVE(EntityType, "entity-type", 1, 1, 0, noFeature) PRIMITIVE(EntityAttributeString, "entity-attribute-string", 2, 1, 0, noFeature) PRIMITIVE(NotationSystemId, "notation-system-id", 1, 1, 0, noFeature) PRIMITIVE(NotationPublicId, "notation-public-id", 1, 1, 0, noFeature) PRIMITIVE(NotationGeneratedSystemId, "notation-generated-system-id", 1, 1, 0, noFeature) PRIMITIVE(GeneralNameNormalize, "general-name-normalize", 1, 1, 0, noFeature) PRIMITIVE(EntityNameNormalize, "entity-name-normalize", 1, 1, 0, noFeature) // Some non-core query language PRIMITIVE(NodeListFirst, "node-list-first", 1, 0, 0, query) PRIMITIVE(NodeListRest, "node-list-rest", 1, 0, 0, query) PRIMITIVE(NodeList, "node-list", 0, 0, 1, query) PRIMITIVE(Children, "children", 1, 0, 0, query) PRIMITIVE(Follow, "follow", 1, 0, 0, query) PRIMITIVE(Preced, "preced", 1, 0, 0, query) PRIMITIVE(Subtree, "subtree", 1, 0, 0, query) PRIMITIVE(Subgrove, "subgrove", 1, 0, 0, query) PRIMITIVE(Descendants, "descendants", 1, 0, 0, query) PRIMITIVE(Attributes, "attributes", 1, 0, 0, query) PRIMITIVE(NodeListNoOrder, "node-list-no-order", 1, 0, 0, query) PRIMITIVE(IsNodeListEqual, "node-list=?", 2, 0, 0, query) PRIMITIVE(IsNamedNodeList, "named-node-list?", 1, 0, 0, query) PRIMITIVE(NamedNode, "named-node", 2, 0, 0, query) PRIMITIVE(NamedNodeListNames, "named-node-list-names", 1, 0, 0, query) PRIMITIVE(NamedNodeListNormalize, "named-node-list-normalize", 3, 0, 0, query) PRIMITIVE(SelectElements, "select-elements", 2, 0, 0, query) PRIMITIVE(Data, "data", 1, 0, 0, query) PRIMITIVE(ElementWithId, "element-with-id", 1, 1, 0, query) PRIMITIVE(EmptyNodeList, "empty-node-list", 0, 0, 0, query) PRIMITIVE(NodeProperty, "node-property", 2, 0, 1, query) PRIMITIVE(SelectByClass, "select-by-class", 2, 0, 0, query) PRIMITIVE(NodeListMap, "node-list-map", 2, 0, 0, query) PRIMITIVE(NodeListFilter, "node-list-filter", 2, 0, 0, query) PRIMITIVE(NodeListRef, "node-list-ref", 2, 0, 0, query) PRIMITIVE(NodeListReverse, "node-list-reverse", 1, 0, 0, query) PRIMITIVE(NodeListLength, "node-list-length", 1, 0, 0, query) PRIMITIVE(SgmlParse, "sgml-parse", 1, 0, 1, query) PRIMITIVE(IsMatchElement, "match-element?", 2, 0, 0, query) PRIMITIVE(IsNodeListContains, "node-list-contains?", 2, 0, 0, query) // External procedures XPRIMITIVE(ReadEntity, "read-entity", 1, 0, 0) XPRIMITIVE(Debug, "debug", 1, 0, 0) XPRIMITIVE(IfFirstPage, "if-first-page", 2, 0, 0) XPRIMITIVE(IfFrontPage, "if-front-page", 2, 0, 0) XPRIMITIVE(AllElementNumber, "all-element-number", 0, 1, 0) // DSSSL2 procedures PRIMITIVE2(IsVector, "vector?", 1, 0, 0) PRIMITIVE2(Vector, "vector", 0, 0, 1) PRIMITIVE2(VectorRef, "vector-ref", 2, 0, 0) PRIMITIVE2(VectorSet, "vector-set!", 3, 0, 0) PRIMITIVE2(MakeVector, "make-vector", 1, 1, 0) PRIMITIVE2(VectorToList, "vector->list", 1, 0, 0) PRIMITIVE2(ListToVector, "list->vector", 1, 0, 0) PRIMITIVE2(VectorFill, "vector-fill!", 2, 0, 0) PRIMITIVE2(IsEqv, "eqv?", 2, 0, 0) PRIMITIVE2(Memv, "memv", 2, 0, 0) PRIMITIVE2(QuantityToString, "quantity->string", 1, 1, 0) //more non-core expression language PRIMITIVE(Assoc, "assoc", 2, 0, 0, expression) PRIMITIVE(KeywordToString, "keyword->string", 1, 0, 0, expression) PRIMITIVE(StringToKeyword, "string->keyword", 1, 0, 0, expression) PRIMITIVE(IsExact, "exact?", 1, 0, 0, expression) PRIMITIVE(IsInexact, "inexact?", 1, 0, 0, expression) PRIMITIVE(IsZero, "zero?", 1, 0, 0, expression) PRIMITIVE(IsPositive, "positive?", 1, 0, 0, expression) PRIMITIVE(IsNegative, "negative?", 1, 0, 0, expression) PRIMITIVE(IsOdd, "odd?", 1, 0, 0, expression) PRIMITIVE(IsEven, "even?", 1, 0, 0, expression) PRIMITIVE(Exp, "exp", 1, 0, 0, expression) PRIMITIVE(Log, "log", 1, 0, 0, expression) PRIMITIVE(Sin, "sin", 1, 0, 0, expression) PRIMITIVE(Cos, "cos", 1, 0, 0, expression) PRIMITIVE(Tan, "tan", 1, 0, 0, expression) PRIMITIVE(Asin, "asin", 1, 0, 0, expression) PRIMITIVE(Acos, "acos", 1, 0, 0, expression) PRIMITIVE(Atan, "atan", 1, 1, 0, expression) PRIMITIVE(Expt, "expt", 2, 0, 0, expression) PRIMITIVE(ExactToInexact, "exact->inexact", 1, 0, 0, expression) PRIMITIVE(InexactToExact, "inexact->exact", 1, 0, 0, expression) PRIMITIVE(QuantityToNumber, "quantity->number", 1, 0, 0, expression) PRIMITIVE(StringToList, "string->list", 1, 0, 0, expression) PRIMITIVE(ListToString, "list->string", 1, 0, 0, expression) PRIMITIVE(TimeLess, "time?", 2, 0, 0, expression) PRIMITIVE(TimeLessOrEqual, "time<=?", 2, 0, 0, expression) PRIMITIVE(TimeGreaterOrEqual, "time>=?", 2, 0, 0, expression) PRIMITIVE(IsLanguage, "language?", 1, 0, 0, expression) PRIMITIVE(CurrentLanguage, "current-language", 0, 0, 0, expression) PRIMITIVE(WithLanguage, "with-language", 2, 0, 0, expression) PRIMITIVE(CharLess, "char #include #include #include #include #include #include #include #include #include #include #include #ifdef SP_SIZEOF_BOOL_1 #include #endif #undef SP_DEFINE_TEMPLATES #include "Insn.h" #include "Expression.h" #include "Interpreter.h" #include "ELObj.h" #include "Style.h" #include "FOTBuilder.h" #include "ProcessingMode.h" #include "ProcessContext.h" #include "SosofoObj.h" #include "DssslSpecEventHandler.h" #include #include "Node.h" #include "DssslApp.h" #include "Pattern.h" #include "MacroFlowObj.h" #ifdef DSSSL_NAMESPACE class DSSSL_NAMESPACE::ProcessingMode; class DSSSL_NAMESPACE::SosofoObj; #else class ProcessingMode; class SosofoObj; #endif #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector > #else #ifdef __xlC__ #pragma define(NCVector >) #else #ifdef SP_ANSI_CLASS_INST template class NCVector >; #else typedef NCVector > Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_4; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_5; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_6; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_7; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_8; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_9; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_10; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr #else #ifdef __xlC__ #pragma define(ConstPtr) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr; #else typedef ConstPtr Dummy_11; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_12; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTableIter #else #ifdef __xlC__ #pragma define(NamedTableIter) #else #ifdef SP_ANSI_CLASS_INST template class NamedTableIter; #else typedef NamedTableIter Dummy_13; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_14; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_15; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr #else #ifdef __xlC__ #pragma define(ConstPtr) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr; #else typedef ConstPtr Dummy_16; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_17; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > *> #else #ifdef __xlC__ #pragma define(Vector > *>) #else #ifdef SP_ANSI_CLASS_INST template class Vector > *>; #else typedef Vector > *> Dummy_18; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_19; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_20; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTable #else #ifdef __xlC__ #pragma define(NamedTable) #else #ifdef SP_ANSI_CLASS_INST template class NamedTable; #else typedef NamedTable Dummy_21; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTableIter #else #ifdef __xlC__ #pragma define(NamedTableIter) #else #ifdef SP_ANSI_CLASS_INST template class NamedTableIter; #else typedef NamedTableIter Dummy_22; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTableIter #else #ifdef __xlC__ #pragma define(NamedTableIter) #else #ifdef SP_ANSI_CLASS_INST template class NamedTableIter; #else typedef NamedTableIter Dummy_23; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_24; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_25; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_26; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_27; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_28; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_29; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_30; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_31; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_32; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_33; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_34; #endif #endif #endif #ifdef __DECCXX #pragma define_template IQueue #else #ifdef __xlC__ #pragma define(IQueue) #else #ifdef SP_ANSI_CLASS_INST template class IQueue; #else typedef IQueue Dummy_35; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector > #else #ifdef __xlC__ #pragma define(NCVector >) #else #ifdef SP_ANSI_CLASS_INST template class NCVector >; #else typedef NCVector > Dummy_36; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_37; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_38; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_39; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_40; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_41; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_42; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_43; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_44; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTable #else #ifdef __xlC__ #pragma define(NamedTable) #else #ifdef SP_ANSI_CLASS_INST template class NamedTable; #else typedef NamedTable Dummy_45; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector > #else #ifdef __xlC__ #pragma define(NCVector >) #else #ifdef SP_ANSI_CLASS_INST template class NCVector >; #else typedef NCVector > Dummy_46; #endif #endif #endif #ifdef __DECCXX #pragma define_template NamedTable #else #ifdef __xlC__ #pragma define(NamedTable) #else #ifdef SP_ANSI_CLASS_INST template class NamedTable; #else typedef NamedTable Dummy_47; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector > #else #ifdef __xlC__ #pragma define(NCVector >) #else #ifdef SP_ANSI_CLASS_INST template class NCVector >; #else typedef NCVector > Dummy_48; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_49; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_50; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_51; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_52; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_53; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_54; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_55; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_56; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_57; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_58; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_59; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTable #else #ifdef __xlC__ #pragma define(HashTable) #else #ifdef SP_ANSI_CLASS_INST template class HashTable; #else typedef HashTable Dummy_60; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTableItem #else #ifdef __xlC__ #pragma define(HashTableItem) #else #ifdef SP_ANSI_CLASS_INST template class HashTableItem; #else typedef HashTableItem Dummy_61; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_62; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_63; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_64; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_65; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_66; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_67; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_68; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_69; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_70; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_71; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_72; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_73; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_74; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector *> #else #ifdef __xlC__ #pragma define(Vector *>) #else #ifdef SP_ANSI_CLASS_INST template class Vector *>; #else typedef Vector *> Dummy_75; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable *, String, Interpreter::StringSet, Interpreter::StringSet> #else #ifdef __xlC__ #pragma define(PointerTable *, String, Interpreter::StringSet, Interpreter::StringSet>) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable *, String, Interpreter::StringSet, Interpreter::StringSet>; #else typedef PointerTable *, String, Interpreter::StringSet, Interpreter::StringSet> Dummy_76; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTable, String, Interpreter::StringSet, Interpreter::StringSet> #else #ifdef __xlC__ #pragma define(OwnerTable, String, Interpreter::StringSet, Interpreter::StringSet>) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTable, String, Interpreter::StringSet, Interpreter::StringSet>; #else typedef OwnerTable, String, Interpreter::StringSet, Interpreter::StringSet> Dummy_77; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_78; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_79; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr #else #ifdef __xlC__ #pragma define(ConstPtr) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr; #else typedef ConstPtr Dummy_80; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_81; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_82; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_83; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTable #else #ifdef __xlC__ #pragma define(HashTable) #else #ifdef SP_ANSI_CLASS_INST template class HashTable; #else typedef HashTable Dummy_84; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTableItem #else #ifdef __xlC__ #pragma define(HashTableItem) #else #ifdef SP_ANSI_CLASS_INST template class HashTableItem; #else typedef HashTableItem Dummy_85; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_86; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_87; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_88; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_89; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_90; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_91; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_92; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_93; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_94; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTable #else #ifdef __xlC__ #pragma define(HashTable) #else #ifdef SP_ANSI_CLASS_INST template class HashTable; #else typedef HashTable Dummy_95; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTableItem #else #ifdef __xlC__ #pragma define(HashTableItem) #else #ifdef SP_ANSI_CLASS_INST template class HashTableItem; #else typedef HashTableItem Dummy_96; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTable #else #ifdef __xlC__ #pragma define(HashTable) #else #ifdef SP_ANSI_CLASS_INST template class HashTable; #else typedef HashTable Dummy_97; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTableItem #else #ifdef __xlC__ #pragma define(HashTableItem) #else #ifdef SP_ANSI_CLASS_INST template class HashTableItem; #else typedef HashTableItem Dummy_98; #endif #endif #endif #ifdef SP_SIZEOF_BOOL_1 #ifdef __DECCXX #pragma define_template XcharMap #else #ifdef __xlC__ #pragma define(XcharMap) #else #ifdef SP_ANSI_CLASS_INST template class XcharMap; #else typedef XcharMap Dummy_99; #endif #endif #endif #ifdef __DECCXX #pragma define_template SharedXcharMap #else #ifdef __xlC__ #pragma define(SharedXcharMap) #else #ifdef SP_ANSI_CLASS_INST template class SharedXcharMap; #else typedef SharedXcharMap Dummy_100; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr > #else #ifdef __xlC__ #pragma define(Ptr >) #else #ifdef SP_ANSI_CLASS_INST template class Ptr >; #else typedef Ptr > Dummy_101; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr > #else #ifdef __xlC__ #pragma define(ConstPtr >) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr >; #else typedef ConstPtr > Dummy_102; #endif #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_103; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_104; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_105; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapResource #else #ifdef __xlC__ #pragma define(CharMapResource) #else #ifdef SP_ANSI_CLASS_INST template class CharMapResource; #else typedef CharMapResource Dummy_106; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr > #else #ifdef __xlC__ #pragma define(Ptr >) #else #ifdef SP_ANSI_CLASS_INST template class Ptr >; #else typedef Ptr > Dummy_107; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr > #else #ifdef __xlC__ #pragma define(ConstPtr >) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr >; #else typedef ConstPtr > Dummy_108; #endif #endif #endif #ifndef _MSC_VER #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_109; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_110; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_111; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_112; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_113; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_114; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_115; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_116; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_117; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_118; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_119; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_120; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_121; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_122; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall > #else #ifdef __xlC__ #pragma define(OneRefArgCall >) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall >; #else typedef OneRefArgCall > Dummy_123; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_124; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_125; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_126; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_127; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall > > #else #ifdef __xlC__ #pragma define(OneRefArgCall > >) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall > >; #else typedef OneRefArgCall > > Dummy_128; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_129; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_130; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_131; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_132; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneArgCall #else #ifdef __xlC__ #pragma define(OneArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneArgCall; #else typedef OneArgCall Dummy_133; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_134; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_135; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner::size_type> > #else #ifdef __xlC__ #pragma define(Owner::size_type> >) #else #ifdef SP_ANSI_CLASS_INST template class Owner::size_type> >; #else typedef Owner::size_type> > Dummy_136; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap::size_type> #else #ifdef __xlC__ #pragma define(CharMap::size_type>) #else #ifdef SP_ANSI_CLASS_INST template class CharMap::size_type>; #else typedef CharMap::size_type> Dummy_137; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn::size_type> #else #ifdef __xlC__ #pragma define(CharMapColumn::size_type>) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn::size_type>; #else typedef CharMapColumn::size_type> Dummy_138; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage::size_type> #else #ifdef __xlC__ #pragma define(CharMapPage::size_type>) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage::size_type>; #else typedef CharMapPage::size_type> Dummy_139; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_140; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_141; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_142; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall #else #ifdef __xlC__ #pragma define(OneRefArgCall) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall; #else typedef OneRefArgCall Dummy_143; #endif #endif #endif #ifdef __DECCXX #pragma define_template NCVector #else #ifdef __xlC__ #pragma define(NCVector) #else #ifdef SP_ANSI_CLASS_INST template class NCVector; #else typedef NCVector Dummy_144; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_145; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_146; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_147; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_148; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_149; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_150; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_151; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_152; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_153; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_154; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_155; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_156; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_157; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_158; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_159; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_160; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_161; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMap #else #ifdef __xlC__ #pragma define(CharMap) #else #ifdef SP_ANSI_CLASS_INST template class CharMap; #else typedef CharMap Dummy_162; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapColumn #else #ifdef __xlC__ #pragma define(CharMapColumn) #else #ifdef SP_ANSI_CLASS_INST template class CharMapColumn; #else typedef CharMapColumn Dummy_163; #endif #endif #endif #ifdef __DECCXX #pragma define_template CharMapPage #else #ifdef __xlC__ #pragma define(CharMapPage) #else #ifdef SP_ANSI_CLASS_INST template class CharMapPage; #else typedef CharMapPage Dummy_164; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_165; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner > #else #ifdef __xlC__ #pragma define(Owner >) #else #ifdef SP_ANSI_CLASS_INST template class Owner >; #else typedef Owner > Dummy_166; #endif #endif #endif #ifdef __DECCXX #pragma define_template String #else #ifdef __xlC__ #pragma define(String) #else #ifdef SP_ANSI_CLASS_INST template class String; #else typedef String Dummy_167; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_168; #endif #endif #endif #ifdef __DECCXX #pragma define_template OneRefArgCall > #else #ifdef __xlC__ #pragma define(OneRefArgCall >) #else #ifdef SP_ANSI_CLASS_INST template class OneRefArgCall >; #else typedef OneRefArgCall > Dummy_169; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_170; #endif #endif #endif #endif #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/style_pch.h0000644000021000000240000000123707025631173013035 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "Interpreter.h" #include "Collector.h" #include "DssslApp.h" #include "DssslSpecEventHandler.h" #include "ELObj.h" #include "ELObjMessageArg.h" #include "EvalContext.h" #include "Expression.h" #include "FOTBuilder.h" #include "GroveManager.h" #include "Insn.h" #include "Insn2.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "MacroFlowObj.h" #include "NumberCache.h" #include "Pattern.h" #include "ProcessContext.h" #include "ProcessingMode.h" #include "SchemeParser.h" #include "SosofoObj.h" #include "Style.h" #include "StyleEngine.h" #include "VM.h" OpenJade-1.4devel/style/stylelib.cxx0000644000021000000240000000015507025631173013243 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" OpenJade-1.4devel/style/stylelib.h0000644000021000000240000000055107025631173012670 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #define BUILD_LIBSP #include "config.h" #undef BUILD_LIBSP #define BUILD_LIBSTYLE #ifdef SP_USE_DLL #undef SP_API #define SP_API SP_DLLIMPORT #endif #ifdef _MSC_VER #pragma warning (disable: 4355) #endif #include "dsssl_ns.h" #ifdef SP_PCH #include "style_pch.h" #endif OpenJade-1.4devel/style/TransformationMode.h0000644000021000000240000000335707025631172014662 // Copyright (c) 1999 Matthias Clasen // See the file copying.txt for copying permission. #ifndef TransformationMode_INCLUDED #define TransformationMode_INCLUDED 1 #include #include #include #include #include "Insn.h" #include #include "ELObj.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class Expression; class TransformationMode { public: class Action : public Resource { public: Action(unsigned partIndex, Owner &, const Location &); void compile(Interpreter &); void get(InsnPtr &, Vector&) const; const Location &location() const; unsigned partIndex() const; private: Location defLoc_; Owner expr_; // must be permanent Vector specs_; InsnPtr insn_; unsigned partIndex_; }; class Association { public: Association(); Association(Owner &,Owner &,const Ptr &); const Action &action() const; Action &action(); long priority() const; const Location &location() const; void compile(Interpreter &, const NodePtr &); void swap(Association &); private: Owner qexpr_; Owner pexpr_; long priority_; NodeListObj *nl_; InsnPtr insn_; Ptr action_; }; TransformationMode(); void addAssociation(Owner &, Owner &, Owner&, const Location &, Interpreter &); void compile(Interpreter &, const NodePtr &); private: NCVector associations_; friend class TransformContext; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not TransformationMode_INCLUDED */ OpenJade-1.4devel/style/TransformationMode.cxx0000644000021000000240000001216707025631172015234 // Copyright (c) 1999 Matthias Clasen // See the file copying.txt for copying permission. #include "stylelib.h" #include "TransformationMode.h" #include "Expression.h" #include "Interpreter.h" #include "InterpreterMessages.h" #include "ELObjMessageArg.h" #include "VM.h" #include // for qsort #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif TransformationMode::TransformationMode() { } void TransformationMode::Action::get(InsnPtr &insn, Vector &specs) const { insn = insn_; specs = specs_; } const Location &TransformationMode::Action::location() const { return defLoc_; } TransformationMode::Action &TransformationMode::Association::action() { return *action_; } long TransformationMode::Association::priority() const { return priority_; } const TransformationMode::Action &TransformationMode::Association::action() const { return *action_; } unsigned TransformationMode::Action::partIndex() const { return partIndex_; } const Location &TransformationMode::Association::location() const { return action_->location(); } extern "C" { static int associationCompare(const void *p1, const void *p2) { return (*(const TransformationMode::Association *const *)p1)->priority() - (*(const TransformationMode::Association *const *)p2)->priority(); }; } void TransformationMode::compile(Interpreter &interp, const NodePtr &node) { for (size_t j = 0; j < associations_.size(); j++) associations_[j].compile(interp, node); qsort(&associations_[0], associations_.size(), sizeof(associations_[0]), associationCompare); } TransformationMode::Action::Action(unsigned partIndex, Owner &expr, const Location &loc) : partIndex_(partIndex), defLoc_(loc) { expr.swap(expr_); } TransformationMode::Association::Association() : action_(0), priority_(0), nl_(0) { } TransformationMode::Association::Association(Owner &qexpr, Owner &pexpr, const Ptr &action) : action_(action), priority_(0), nl_(0) { qexpr.swap(qexpr_); pexpr.swap(pexpr_); } void TransformationMode::Association::swap(Association &a) { action_.swap(a.action_); qexpr_.swap(a.qexpr_); pexpr_.swap(a.pexpr_); } void TransformationMode::Association::compile(Interpreter &interp, const NodePtr &node) { action_->compile(interp); qexpr_->optimize(interp, Environment(), qexpr_); ELObj *tem = qexpr_->constantValue(); if (!tem) { InsnPtr insn = qexpr_->compile(interp, Environment(), 0, InsnPtr()); VM vm(interp); EvalContext::CurrentNodeSetter cns(node, 0, vm); tem = vm.eval(insn.pointer()); } if (tem->asNodeList()) nl_ = tem->asNodeList(); else { interp.setNextLocation(qexpr_->location()); interp.message(InterpreterMessages::queryNotANodeList, ELObjMessageArg(tem, interp)); nl_ = interp.makeEmptyNodeList(); } pexpr_->optimize(interp, Environment(), pexpr_); tem = pexpr_->constantValue(); if (!tem) { InsnPtr insn = pexpr_->compile(interp, Environment(), 0, InsnPtr()); VM vm(interp); EvalContext::CurrentNodeSetter cns(node, 0, vm); tem = vm.eval(insn.pointer()); } if (!tem->exactIntegerValue(priority_)) { interp.setNextLocation(pexpr_->location()); interp.message(InterpreterMessages::priorityNotAnExactInteger, ELObjMessageArg(tem, interp)); priority_ = 0; } } void TransformationMode::Action::compile(Interpreter &interp) { expr_->optimize(interp, Environment(), expr_); ELObj *tem = expr_->constantValue(); if (tem) { if (tem->asCreateSpec()) specs_.push_back(tem->asCreateSpec()); else if (tem->asPair()) // must be a list of create-specs then for (;;) { PairObj *pair = tem->asPair(); if (pair) { CreateSpecObj *cspec = pair->car()->asCreateSpec(); if (!cspec) { interp.setNextLocation(expr_->location()); interp.message(InterpreterMessages::notACspecList, ELObjMessageArg(tem, interp)); } else specs_.push_back(cspec); tem = pair->cdr(); } else if (tem->isNil()) break; else { interp.setNextLocation(expr_->location()); interp.message(InterpreterMessages::notACspecList, ELObjMessageArg(tem, interp)); return; } } else { interp.setNextLocation(expr_->location()); interp.message(InterpreterMessages::notACspecOrCspecList, ELObjMessageArg(tem, interp)); return; } } else { insn_ = expr_->compile(interp, Environment(), 0, InsnPtr()); } } void TransformationMode::addAssociation(Owner &qexpr, Owner &texpr, Owner &pexpr, const Location &loc, Interpreter &interp) { Ptr action = new Action(interp.currentPartIndex(), texpr, loc); Association assoc(qexpr, pexpr, action); associations_.resize(associations_.size() + 1); associations_.back().swap(assoc); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/DocumentGenerator.h0000644000021000000240000000146407025631170014467 // Copyright (c) 1999 Matthias Clasen // See the file copying.txt for copying permission. #ifndef DocumentGenerator_INCLUDED #define DocumentGenerator_INCLUDED 1 #include "config.h" #include "Node.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif class DocumentGenerator { public: DocumentGenerator(SdataMapper *, OutputCharStream *); void emit(const NodePtr &); private: void emit(const NodeListPtr &, const GroveString &); void emit(const GroveStringListPtr &, const char *, const char *, const char *); OutputCharStream &os() { return *os_; } Owner os_; SdataMapper *smap_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not DocumentGenerator_INCLUDED */ OpenJade-1.4devel/style/DocumentGenerator.cxx0000644000021000000240000003031307054313677015050 // Copyright (c) 1999 Matthias Clasen // See the file copying.txt for copying permission. #include "stylelib.h" #include #include "DocumentGenerator.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif //FIXME: this is just because OutputCharStream::operator<<(Newline) is broken const char RE = '\r'; inline OutputCharStream &operator<<(OutputCharStream &os, const GroveString &str) { os << StringC((const Char *)str.data(), str.size()); return os; } inline OutputCharStream &operator<<(OutputCharStream &os, const GroveChar ch) { os << StringC((const Char *)&ch, 1); return os; }; DocumentGenerator::DocumentGenerator(SdataMapper *smap, OutputCharStream *os) : smap_(smap), os_(os) { } void DocumentGenerator::emit(const GroveStringListPtr &strs, const char *a, const char *sep, const char *o) { ConstGroveStringListIter iter(ConstGroveStringListIter(strs->iter())); if (!iter.done()) { os() << a << iter.cur(); iter.next(); for (;!iter.done();iter.next()) os() << sep << iter.cur(); os() << o; } } void DocumentGenerator::emit(const NodePtr &ptr) { switch (ptr->classDef().className) { case ComponentName::idSgmlDocument: { NodePtr gdtd; ptr->getGoverningDoctype(gdtd); emit(gdtd); NodeListPtr prolog; GroveString sep; if (ptr->getProlog(prolog) == accessOK) emit(prolog, sep); NodePtr docelem; if (ptr->getDocumentElement(docelem) == accessOK) emit(docelem); NodeListPtr epilog; if (ptr->getProlog(epilog) == accessOK) emit(epilog, sep); break; } case ComponentName::idElement: { GroveString gi; ptr->getGi(gi); os() << "<" << gi; NamedNodeListPtr atts; GroveChar ch = ' '; GroveString sep(&ch, 1); NodePtr nd; if (ptr->getAttributes(atts) == accessOK && atts->nodeList()->first(nd) == accessOK) { os() << " "; emit(atts->nodeList(), sep); } os() << ">"; NodeListPtr content; sep.assign(0, 0); if (ptr->getContent(content) == accessOK) emit(content, sep); bool mustOmitEndTag; ptr->getMustOmitEndTag(mustOmitEndTag); if (!mustOmitEndTag) os() << ""; break; } case ComponentName::idDataChar: { GroveChar ch; ptr->getChar(*smap_, ch); os() << ch; break; } case ComponentName::idAttributeAssignment: { bool implied; ptr->getImplied(implied); if (!implied) { GroveString name; ptr->getName(name); os() << name << "='"; GroveChar ch; GroveString sep; if (ptr->getTokenSep(ch) != accessNull) sep.assign(&ch, 1); NodeListPtr value; if (ptr->getValue(value) == accessOK) emit(value, sep); os() << "'"; } break; } case ComponentName::idAttributeValueToken: { GroveString tok; ptr->getToken(tok); os() << tok; break; } case ComponentName::idPi: { GroveString str; if (ptr->getEntityName(str) == accessOK) os() << "&" << str << ";"; else { ptr->getSystemData(str); os() << ""; } break; } case ComponentName::idSdata: case ComponentName::idSubdocument: case ComponentName::idExternalData: { GroveString str; ptr->getEntityName(str); os() << "&" << str << ";"; break; } case ComponentName::idDocumentType: { GroveString name; GroveString sep; ptr->getName(name); os() << "getNotations(nnl) == accessOK) emit(nnl->nodeList(), sep); if (ptr->getParameterEntities(nnl) == accessOK) emit(nnl->nodeList(), sep); if (ptr->getGeneralEntities(nnl) == accessOK) emit(nnl->nodeList(), sep); NodePtr dent; if (ptr->getDefaultEntity(dent) == accessOK) emit(dent); if (ptr->getElementTypes(nnl) == accessOK) emit(nnl->nodeList(), sep); os() << "]>" << RE; break; } case ComponentName::idNotation: { GroveString name; ptr->getName(name); os() << "getExternalId(extid) == accessOK) emit(extid); os() << ">" << RE; NamedNodeListPtr atts; NodePtr first; if (ptr->getAttributeDefs(atts) == accessOK && atts->nodeList()->first(first) == accessOK) { os() << "nodeList(), sep); os() << " >" << RE; } break; } case ComponentName::idDefaultEntity: case ComponentName::idEntity: { bool defaulted; ptr->getDefaulted(defaulted); if (defaulted) break; os() << "getEntityType(type); GroveString name; ptr->getName(name); if (name.size() > 0) os() << name << " "; else os() << "#DEFAULT "; NodePtr extid; if (ptr->getExternalId(extid) == accessOK) { emit(extid); switch (type) { case Node::EntityType::subdocument: os() << " SUBDOC"; break; case Node::EntityType::cdata: os() << " CDATA"; break; case Node::EntityType::sdata: os() << " SDATA"; break; case Node::EntityType::ndata: os() << " NDATA"; break; default: CANNOT_HAPPEN(); } switch (type) { case Node::EntityType::cdata: case Node::EntityType::sdata: case Node::EntityType::ndata: { GroveString notname; ptr->getNotationName(notname); os() << " " << notname << " "; NamedNodeListPtr atts; NodePtr first; if (ptr->getAttributes(atts) == accessOK && atts->nodeList()->first(first) == accessOK) { os() << "["; GroveChar ch = ' '; GroveString sep(&ch, 1); emit(atts->nodeList(), sep); os() << "] "; } break; } default: break; } } else { // internal entity switch (type) { case Node::EntityType::text: break; case Node::EntityType::pi: os() << "PI "; break; case Node::EntityType::cdata: os() << "CDATA "; break; case Node::EntityType::sdata: os() << "SDATA "; break; default: CANNOT_HAPPEN(); } GroveString text; ptr->getText(text); os() << "'" << text << "' "; } os() << ">" << RE; break; } case ComponentName::idElementType: { GroveString gi; ptr->getGi(gi); os() << "getOmitStartTag(ostart); ptr->getOmitEndTag(oend); os() << (ostart ? "O " : "- ") << (oend ? "O " : "- "); Node::ContentType::Enum type; ptr->getContentType(type); switch(type) { case Node::ContentType::cdata: os() << "CDATA"; break; case Node::ContentType::rcdata: os() << "RCDATA"; break; case Node::ContentType::empty: os() << "EMPTY"; break; case Node::ContentType::any: os() << "ANY"; break; case Node::ContentType::modelgrp: { NodePtr model; if (ptr->getModelGroup(model) == accessOK) emit(model); break; } default: CANNOT_HAPPEN(); } GroveStringListPtr cl; if (ptr->getExclusions(cl) == accessOK) emit(cl, " -(", "|", ")"); if (ptr->getInclusions(cl) == accessOK) emit(cl, " +(", "|", ")"); os() << " >" << RE; NamedNodeListPtr atts; NodePtr first; if (ptr->getAttributeDefs(atts) == accessOK && atts->nodeList()->first(first) == accessOK) { os() << "nodeList(), sep); os() << " >" << RE; } break; } case ComponentName::idAttributeDef: { GroveString name; ptr->getName(name); os() << " " << name << " "; Node::DeclValueType::Enum decl; ptr->getDeclValueType(decl); switch (decl) { case Node::DeclValueType::cdata: os() << "CDATA "; break; case Node::DeclValueType::entity: os() << "ENTITY "; break; case Node::DeclValueType::entities: os() << "ENTITIES "; break; case Node::DeclValueType::id: os() << "ID "; break; case Node::DeclValueType::idref: os() << "IDREF "; break; case Node::DeclValueType::idrefs: os() << "IDREFS "; break; case Node::DeclValueType::name: os() << "NAME "; break; case Node::DeclValueType::names: os() << "NAMES "; break; case Node::DeclValueType::nmtoken: os() << "NMTOKEN "; break; case Node::DeclValueType::nmtokens: os() << "NMTOKENS "; break; case Node::DeclValueType::number: os() << "NUMBER "; break; case Node::DeclValueType::numbers: os() << "NUMBERS "; break; case Node::DeclValueType::nutoken: os() << "NUTOKEN "; break; case Node::DeclValueType::nutokens: os() << "NUTOKENS "; break; case Node::DeclValueType::notation: os() << "NOTATION "; // fall through case Node::DeclValueType::nmtkgrp: { GroveStringListPtr toks; ptr->getTokens(toks); emit(toks, "(", "|", ") "); break; } default: CANNOT_HAPPEN(); } Node::DefaultValueType::Enum deflt; ptr->getDefaultValueType(deflt); switch (deflt) { case Node::DefaultValueType::fixed: os() << "#FIXED "; // fall through case Node::DefaultValueType::value: { NodeListPtr val; GroveString sep; if (ptr->getDefaultValue(val) == accessOK) emit(val, sep); break; } case Node::DefaultValueType::required: os() << "#REQUIRED"; break; case Node::DefaultValueType::current: os() << "#CURRENT"; break; case Node::DefaultValueType::conref: os() << "#CONREF"; break; case Node::DefaultValueType::implied: os() << "#IMPLIED"; break; default: CANNOT_HAPPEN(); } break; } case ComponentName::idExternalId: { GroveString pubid, sysid; if (ptr->getPublicId(pubid) == accessOK) os() << "PUBLIC '" << pubid << "'"; if (ptr->getSystemId(sysid) == accessOK) os() << (pubid.size() > 0 ? " " : "") << "SYSTEM '" << sysid << "'"; break; } case ComponentName::idModelGroup: { //FIXME: fails for (#pcdata) os() << "("; Node::Connector::Enum conn; ptr->getConnector(conn); GroveChar ch; switch (conn) { case Node::Connector::and_: ch = '&'; break; case Node::Connector::or_: ch = '|'; break; case Node::Connector::seq: ch = ','; break; default: CANNOT_HAPPEN(); } GroveString sep(&ch, 1); NodeListPtr toks; if (ptr->getContentTokens(toks) == accessOK) emit(toks, sep); os() << ")"; Node::OccurIndicator::Enum occur; if (ptr->getOccurIndicator(occur) == accessOK) { switch (occur) { case Node::OccurIndicator::opt: os() << '?'; break; case Node::OccurIndicator::plus: os() << '+'; break; case Node::OccurIndicator::rep: os() << '*'; break; default: CANNOT_HAPPEN(); } } break; } case ComponentName::idElementToken: { GroveString gi; ptr->getGi(gi); os() << gi; Node::OccurIndicator::Enum occur; if (ptr->getOccurIndicator(occur) == accessOK) { switch (occur) { case Node::OccurIndicator::opt: os() << '?'; break; case Node::OccurIndicator::plus: os() << '+'; break; case Node::OccurIndicator::rep: os() << '*'; break; default: CANNOT_HAPPEN(); } } break; } case ComponentName::idPcdataToken: { os() << "#PCDATA"; break; } case ComponentName::idSgmlConstants: case ComponentName::noId: // message and nonSgml break; default: CANNOT_HAPPEN(); } } void DocumentGenerator::emit(const NodeListPtr &ptr, const GroveString &sep) { NodeListPtr nl(ptr); NodePtr nd; for (;;) { if (nl->first(nd) != accessOK) return; emit(nd); if (nl->rest(nl) != accessOK) return; os() << sep; } } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/style/FlowObj_inst.cxx0000644000021000000240000001230607067713001014011 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #undef SP_DEFINE_TEMPLATES #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template CopyOwner #else #ifdef __xlC__ #pragma define(CopyOwner) #else #ifdef SP_ANSI_CLASS_INST template class CopyOwner; #else typedef CopyOwner Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_4; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_5; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_6; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_7; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_8; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_9; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_10; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_11; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_12; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_13; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_14; #endif #endif #endif #ifdef __DECCXX #pragma define_template Owner #else #ifdef __xlC__ #pragma define(Owner) #else #ifdef SP_ANSI_CLASS_INST template class Owner; #else typedef Owner Dummy_15; #endif #endif #endif #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/primitive_inst.cxx0000644000021000000240000000360407067713001014460 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr #else #ifdef __xlC__ #pragma define(ConstPtr) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr; #else typedef ConstPtr Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Ptr #else #ifdef __xlC__ #pragma define(Ptr) #else #ifdef SP_ANSI_CLASS_INST template class Ptr; #else typedef Ptr Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template ConstPtr #else #ifdef __xlC__ #pragma define(ConstPtr) #else #ifdef SP_ANSI_CLASS_INST template class ConstPtr; #else typedef ConstPtr Dummy_3; #endif #endif #endif #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/style_inst.m40000644000021000000240000002330607067706751013345 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #include #include #include #include #include #include #include #include #include #ifdef SP_SIZEOF_BOOL_1 #include #endif #undef SP_DEFINE_TEMPLATES #include "Insn.h" #include "Expression.h" #include "Interpreter.h" #include "ELObj.h" #include "Style.h" #include "FOTBuilder.h" #include "ProcessingMode.h" #include "ProcessContext.h" #include "SosofoObj.h" #include "DssslSpecEventHandler.h" #include #include "Node.h" #include "DssslApp.h" #include "Pattern.h" #include "MacroFlowObj.h" #ifdef DSSSL_NAMESPACE class DSSSL_NAMESPACE::ProcessingMode; class DSSSL_NAMESPACE::SosofoObj; #else class ProcessingMode; class SosofoObj; #endif #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif __instantiate(Ptr) __instantiate(Owner) __instantiate(Vector) __instantiate(NCVector >) __instantiate(Vector) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Vector) __instantiate(Owner) __instantiate(Ptr) __instantiate(ConstPtr) __instantiate(`PointerTable') __instantiate(NamedTableIter) __instantiate(Ptr) __instantiate(Ptr) __instantiate(ConstPtr) __instantiate(Vector >) __instantiate(Vector > *>) __instantiate(Vector) __instantiate(Ptr) __instantiate(NamedTable) __instantiate(NamedTableIter) __instantiate(NamedTableIter) __instantiate(NCVector) __instantiate(Vector) __instantiate(Ptr) __instantiate(IList) __instantiate(IListIter) __instantiate(Vector) __instantiate(IList) __instantiate(Vector) __instantiate(Owner) __instantiate(Vector) __instantiate(Vector) __instantiate(IQueue) __instantiate(NCVector >) __instantiate(IList) __instantiate(IListIter) __instantiate(IList) __instantiate(IListIter) __instantiate(Ptr) __instantiate(Vector >) __instantiate(NCVector) __instantiate(NCVector) __instantiate(NamedTable) __instantiate(NCVector >) __instantiate(NamedTable) __instantiate(NCVector >) __instantiate(Vector) __instantiate(Vector >) __instantiate(Vector) __instantiate(Vector >) __instantiate(IList) __instantiate(IListIter) __instantiate(Vector >) __instantiate(Owner) __instantiate(Vector) __instantiate(Vector >) __instantiate(Vector) __instantiate(`HashTable') __instantiate(`HashTableItem') __instantiate(Vector) __instantiate(Vector) __instantiate(IListIter) __instantiate(IList) __instantiate(IListIter) __instantiate(IList) __instantiate(IListIter) __instantiate(IList) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Vector *>) __instantiate(`PointerTable *, String, Interpreter::StringSet, Interpreter::StringSet>') __instantiate(`OwnerTable, String, Interpreter::StringSet, Interpreter::StringSet>') __instantiate(Vector) __instantiate(Ptr) __instantiate(ConstPtr) __instantiate(Vector >) __instantiate(Owner) __instantiate(Owner) __instantiate(`HashTable') __instantiate(`HashTableItem') __instantiate(Vector) __instantiate(Vector) __instantiate(NCVector) __instantiate(IList) __instantiate(IListIter) __instantiate(IList) __instantiate(IListIter) __instantiate(Ptr) __instantiate(Owner) __instantiate(`HashTable') __instantiate(`HashTableItem') __instantiate(`HashTable') __instantiate(`HashTableItem') #ifdef SP_SIZEOF_BOOL_1 __instantiate(XcharMap) __instantiate(SharedXcharMap) __instantiate(Ptr >) __instantiate(ConstPtr >) #endif __instantiate(CharMap) __instantiate(CharMapPage) __instantiate(CharMapColumn) __instantiate(CharMapResource) __instantiate(Ptr >) __instantiate(ConstPtr >) #ifndef _MSC_VER __instantiate(`OneRefArgCall') __instantiate(`OneArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneArgCall') __instantiate(`OneArgCall') __instantiate(`OneArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall >') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall > >') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneArgCall') __instantiate(`OneRefArgCall') __instantiate(`OneRefArgCall') __instantiate(`Owner::size_type> >') __instantiate(`CharMap::size_type>') __instantiate(`CharMapColumn::size_type>') __instantiate(`CharMapPage::size_type>') __instantiate(`NCVector') __instantiate(`Vector >') __instantiate(`Ptr') __instantiate(`OneRefArgCall') __instantiate(`NCVector') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`Vector') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`Ptr') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`CharMap') __instantiate(`CharMapColumn') __instantiate(`CharMapPage') __instantiate(`Vector') __instantiate(`Owner >') __instantiate(`String') __instantiate(`Vector') __instantiate(`OneRefArgCall >') __instantiate(`Vector') #endif #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/FlowObj_inst.m40000644000021000000240000000243307025631171013530 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #undef SP_DEFINE_TEMPLATES #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif __instantiate(Owner) __instantiate(CopyOwner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) __instantiate(Owner) #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/primitive_inst.m40000644000021000000240000000137307025631172014201 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "stylelib.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #if _MSC_VER >= 1100 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef DSSSL_NAMESPACE using namespace DSSSL_NAMESPACE; #endif #ifdef GROVE_NAMESPACE using namespace GROVE_NAMESPACE; #endif #else #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #endif __instantiate(ConstPtr) __instantiate(Ptr) __instantiate(Ptr) __instantiate(ConstPtr) #ifdef SP_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/style/InterpreterMessages.msg0000644000021000000240000004043307067706567015416 !cxx E0+unexpectedEof++unexpected end of file E0+invalidChar++invalid character E0+unknownHash+ISO/IEC 10179:1996 8.5.1 8.5.6 8.5.7.4 8.5.8 12.5.5 [70] [76] [79] [80] [81] [82] [94] [187]+invalid character after '#' E1+unknownNamedConstant+ISO/IEC 10179:1996 8.5.6 [76]+unknown #! named constant %1 E1+unexpectedToken++unexpected token %1 E0+unterminatedString+ISO/IEC 10179:1996 8.5.9 [118]+string with no closing quote E0+missingCloseParen++missing closing parenthesis E1+invalidNumber+ISO/IEC 10179:1996 8.5.7.4+invalid number %1 E1+invalidAfiiGlyphId+ISO/IEC 10179:1996 12.5.5+invalid AFII glyph identifier %1 E1+callNonFunction+ISO/IEC 10179:1996 8.3.1.3+call of non-function object %1 E0+tooManyArgs+ISO/IEC 10179:1996 8.3.1.4+too many arguments for function E0+oddKeyArgs+ISO/IEC 10179:1996 8.3.1.4+odd number of keyword/value arguments E0+missingArg+ISO/IEC 10179:1996 8.3.1.4+missing argument for function call E1+syntacticKeywordAsVariable+ISO/IEC 10179:1996 8.2.1p1+syntactic keyword %1 used as variable E1+undefinedVariableReference+ISO/IEC 10179:1996 8.3.1.1+reference to undefined variable %1 E1+badCharName+ISO/IEC 10179:1996 8.5.8+no character with name %1 -E1+keywordNotAllowedCall++syntactic keyword %1 not valid in call position -E1+symbolRequired++symbol required (got %1) E1+unknownTopLevelForm+ISO/IEC 10179:1996 12 [159]+unknown top level form %1 E1+badModeForm+ISO/IEC 10179:1996 12.4.1 [162]+bad form %1 in mode group E1+duplicateDefinition+ISO/IEC 10179:1996 8.4+identifier %1 already defined in same part+first definition was here E1+identifierLoop+ISO/IEC 10179:1996 8.4+loop in specification of value of %1 E0+outOfRange+ISO/IEC 10179:1996 8.5.3.12 8.5.3.13 8.5.7.17 8.5.7.19 8.5.7.20 8.5.9.4 8.5.9.7+argument out of range E1+unitLoop+ISO/IEC 10179:1996 8.4+loop in specification of value of unit %1 E1+badUnitDefinition+ISO/IEC 10179:1996 8.5.7.1+bad value specified for unit %1 E1+duplicateUnitDefinition+ISO/IEC 10179:1996 8.4+unit %1 already defined in same part+first definition was here E1+undefinedQuantity++quantity %1 undefined E0+incompatibleDimensions+ISO/IEC 10179:1996 8.5.7.7 8.5.7.9 8.5.7.10 8.5.7.12 8.5.7.19+incompatible dimensions E3+notABoolean++%2 argument for primitive %1 of wrong type: %3 not a boolean E3+notAPair++%2 argument for primitive %1 of wrong type: %3 not a pair E3+notAList++%2 argument for primitive %1 of wrong type: %3 not a list E3+notASymbol++%2 argument for primitive %1 of wrong type: %3 not a symbol E3+notAString++%2 argument for primitive %1 of wrong type: %3 not a string E3+notAStringOrSymbol++%2 argument for primitive %1 of wrong type: %3 not a string or symbol E3+notAChar++%2 argument for primitive %1 of wrong type: %3 not a char E3+notAStyle++%2 argument for primitive %1 of wrong type: %3 not a style E3+notAnExactInteger++%2 argument for primitive %1 of wrong type: %3 not an exact integer E3+notAQuantity++%2 argument for primitive %1 of wrong type: %3 not a quantity E3+notAColorSpace++%2 argument for primitive %1 of wrong type: %3 not a color-space E3+notANumber++%2 argument for primitive %1 of wrong type: %3 not a number E3+notASosofo++%2 argument for primitive %1 of wrong type: %3 not a sosofo E3+notAnOptSingletonNode++%2 argument for primitive %1 of wrong type: %3 not an optional singleton node list E3+notASingletonNode++%2 argument for primitive %1 of wrong type: %3 not a singleton node list E3+notANodeList++%2 argument for primitive %1 of wrong type: %3 not a node list E3+notANamedNodeList++%2 argument for primitive %1 of wrong type: %3 not a named node list E3+notALengthSpec++%2 argument for primitive %1 of wrong type: %3 not a length or length-spec E3+notAQuantityOrLengthSpec++%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec E3+notAPriority+ISO/IEC 10179:1996 12.5.4.1+%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol "force" -E3+notAPattern++%2 argument for primitive %1 of wrong type: %3 not a valid element matching pattern E3+notAnAddress+ISO/IEC 10179:1996 12.5.8+%2 argument for primitive %1 of wrong type: %3 not an address E3+notAGlyphId+ISO/IEC 10179:1996 12.5.5+%2 argument for primitive %1 of wrong type: %3 not a glyph-id E3+notAGlyphSubstTable+ISO/IEC 10179:1996 12.5.6+%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table E3+notAGlyphIdPairList+ISO/IEC 10179:1996 12.5.6+%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids E3+notAProcedure++%2 argument for primitive %1 of wrong type: %3 not a procedure E3+notAVector++%2 argument for primitive %1 of wrong type: %3 not a vector E0+duplicateRootRule+ISO/IEC 10179:1996 12.4.1+root rule already defined in same part with same importance+first definition was here E1+duplicateInitialValue+ISO/IEC 10179:1996 12.4.6+initial value already declared for characteristic %1 in same part+first declaration was here E1+invalidStyleKeyword+ISO/IEC 10179:1996 12.4.5+%1 is not a valid keyword in a style expression E2+invalidMakeKeyword+ISO/IEC 10179:1996 12.4.3+%1 is not a valid keyword in a make expression for flow object class %2 E1+unknownFlowObjectClass++%1 is not the name of any flow object class E1+atomicContent+ISO/IEC 10179:1996 12.4.3+content expression cannot be specified in make expression for atomic flow object class %1 E0+labelNotASymbol+ISO/IEC 10179:1996 12.4.3+value for "label:" not a symbol E1+badConnection++no port for label %1 E0+badContentMap+ISO/IEC 10179:1996 12.4.3+invalid content map E1+contentMapBadPort+ISO/IEC 10179:1996 12.4.3+content map references non-existent port %1 E1+invalidCharacteristicValue++invalid value for %1 characteristic E0+condFail+ISO/IEC 10179:1996 8.3.2.1+no clause in cond expression matched E1+caseFail+ISO/IEC 10179:1996 8.3.2.2+no clause in case expression matched %1 E1+caseElse+ISO/IEC 10179:1996 8.3.2.2 [45]+expected "else" not %1 E0+caseUnresolvedQuantities++sorry, cannot handle unresolvable quantities in datums in case expression E1+errorProc+ISO/IEC 10179:1996 8.5.12+%1 E0+divideBy0+ISO/IEC 10179:1996 8.5.7.13+division by zero E1+invalidKeyArg+ISO/IEC 10179:1996 8.3.1.4+procedure does not have %1 keyword argument E0+keyArgsNotKey+ISO/IEC 10179:1996 8.3.1.4+argument not a keyword -E0+oneBody++support for more than one style-specification-body not yet implemented E0+specNotArc+ISO/IEC 10179:1996 7p1+specification document does not have the DSSSL architecture as a base architecture E0+noStyleSpec+ISO/IEC 10179:1996 7.1+specification document did not contain a style-specification-body element E1+unknownCharName+ISO/IEC 10179:1996 8.5.8+unknown character name %1 E0+noCurrentNode+ISO/IEC 10179:1996 10.1.1 12.4.1+attempt to use current node when there is none E0+noCurrentProcessingMode+ISO/IEC 10179:1996 12.4.1+attempt to process node in illegal context E0+invalidRadix++radix must be 2, 8, 10 or 16 E0+sosofoContext++this context requires a sosofo E0+styleContext++this context requires a style object E0+notInCharacteristicValue+ISO/IEC 10179:1996 12.4.6+procedure can only be used in evaluation of characteristic value -E1+expressionNotImplemented++sorry, %1 expression not implemented E1+colorArgCount++%1 color requires three arguments E1+colorArgType++arguments for %1 color must be numbers E1+colorArgRange++arguments for %1 color must be in the range 0 to 1 E1+colorProcResType++result of procedure in %1 color must be a number E1+unknownColorSpaceFamily+ISO/IEC 10179:1996 12.5.9+unknown color-space family %1 E1+colorSpaceNoArgs++%1 color-space family does not take any arguments E1+colorSpaceArgError++invalid parameters for %1 color-space family E1+notABuiltinInheritedC++%1 is not a pre-defined inherited characteristic E1+invalidNumberFormat+ISO/IEC 10179:1996 8.5.7.24+invalid number format %1 E1+invalidPublicIdChar++invalid character %1 in public identifier I1+debug++debug %1 E0+useLoop+ISO/IEC 10179:1996 7.1+circular use of specification parts E1+missingPart+ISO/IEC 10179:1996 7.1+no style-specification or external-specification with ID %1 E0+noParts+ISO/IEC 10179:1996 7.1+document did not contain any style-specifications or external-specifications E0+tableCellOutsideTable++table-cell flow object not inside a table E0+tableRowOutsideTable++table-row flow object not inside a table E1+noNodePropertyValue+ISO/IEC 10179:1996 10.1.6+no value for node property %1 E0+returnNotNodeList++value returned by procedure was not a node-list I0+stackTrace++called from here I1+stackTraceEllipsis++called from here...(%1 calls omitted) E0+processNodeLoop++node processing loop detected E0+spliceNotList+ISO/IEC 10179:1996 8.3.2.7+unquote-splicing expression does not evaluate to a list E0+readOnly++object is read-only E1+topLevelAssignment++assignment to top-level variable %1 E0+continuationDead++invalid call to continuation E0+patternEmptyGi++empty generic identifier in pattern E0+patternNotList++pattern is not a list E1+patternBadGi++%1 cannot be used as a generic identifier in a pattern E1+patternBadMember++%1 cannot occur in a pattern E0+patternMissingQualifierValue++value missing for qualifier in pattern E1+patternUnknownQualifier++unknown pattern qualifier %1 E2+patternBadQualifierValue++bad value %1 for %2 qualifier in pattern E0+patternChildRepeat++repeat qualifier not allowed inside children qualifier E0+patternBadAttributeQualifier++bad value for attributes qualifier in pattern E1+ambiguousStyle++characteristic %1 applied in style rule with same specificity+other style rule is here E0+ambiguousMatch+ISO/IEC 10179:1996 12.4.1+node matches more than one pattern with the same specificity E1+uninitializedVariableReference++reference to uninitialized variable %1 E1+actualLoop+ISO/IEC 10179:1996 12.4.6+circular use of actual value of characteristic %1 E1+duplicateCharacteristic+ISO/IEC 10179:1996 12.4.6+characteristic %1 already defined in same part+first definition was here E1+duplicateFlowObjectClass+ISO/IEC 10179:1996 12.4.3 [178]+flow object class %1 already defined in same part+first definition was here E1+undefinedMode+ISO/IEC 10179:1996 12.4.3 [180]+mode %1 not defined E1+duplicateCharName+ISO/IEC 10179:1996 7.1.4+duplicate character name %1 E1+duplicateSdataEntityName+ISO/IEC 10179:1996 7.1.8+duplicate SDATA entity name %1 E1+duplicateSdataEntityText+ISO/IEC 10179:1996 7.1.8+duplicate SDATA entity text %1 W0+unsupportedDeclaration++unsupported declaration will be ignored W1+unsupportedCharRepertoire++unsupported character repertoire %1 will be ignored E0+badDeclaration++error in declaration element -E1+duplicateDeclaration++duplicate declaration element (%1) E1+invalidIdentifier+ISO/IEC 10179:1996 7.3.2 [1]+%1 is not a valid identifier E0+badLanguageDefinition+ISO/IEC 10179:1996 8.5.8.2.1 [100]+error in language definition E0+noCurrentLanguage+ISO/IEC 10179:1996 8.5.8.4 8.5.8.5 8.5.8.6 8.5.9.5 8.5.9.6+no current language E3+notALanguage+ISO/IEC 10179:1996 8.5.8.2+%2 argument for primitive %1 of wrong type: %3 not a language E3+notAPositiveInteger++%2 argument for primitive %1 of wrong type: %3 not a positive integer E3+notAnInteger++%2 argument for primitive %1 of wrong type: %3 not an integer E3+notAKeyword++%2 argument for primitive %1 of wrong type: %3 not a keyword E3+notAnAlist++%2 argument for primitive %1 of wrong type: %3 not an alist E3+notACharList++%2 argument for primitive %1 of wrong type: %3 not a list of characters E3+lengthError++%2 argument for primitive %1 has wrong length W1+noExactRepresentation+ISO/IEC 10179:1996 8.5.7.2+quantity %1 can't be represented exactly E0+duplicateDefLangDecl+ISO/IEC 10179:1996 8.5.8.2 [99]+default language already declared in this part+first declaration was here E1+defLangDeclRequiresLanguage+ISO/IEC 10179:1996 8.5.8.2+%1 not a language as required in a default-language-declaration E1+invalidUnitName+ISO/IEC 10179:1996 8.5.7.4 [87]+%1 not a valid unit name E1+invalidCharName+ISO/IEC 10179:1996 8.5.8 [95]+%1 not a valid character name E1+invalidCharNumber+ISO/IEC 10179:1996 7.1.4p2 7.1.6p2+%1 not a valid character number E1+unknownCharProperty+ISO/IEC 10179:1996 8.5.8.1+unknown character property %1 E0+badAddCharProperty+ISO/IEC 10179:1996 8.5.8.1+error in character property declaration E1+duplicateCharPropertyDecl+ISO/IEC 10179:1996 8.5.8.1+character property %1 already declared in same part+first declaration was here # FIXME: Would like to report both property name and character, but there is # no MessageType2L in Message.h. E1+duplicateAddCharProperty+ISO/IEC 10179:1996 8.5.8.1+added value for character property %1 already declared in same part+previous declaration was here E0+returnNotSosofo++value returned by procedure was not a sosofo E1+charPropertyLoop++loop in specification of value of character property %1 E2+charPropertyNotInteger++value for character property %1 of wrong type: %2 not an integer E2+charPropertyNotIntegerOrFalse++value for character property %1 of wrong type: %2 not an integer or the value "#f" E1+unknownFeature+ISO/IEC 10179:1996 11.1 12.1+%1 not a style or transformation language feature E1+missingFeature+ISO/IEC 10179:1996 7.1.1+undeclared use of feature %1 W1+unsupportedFeature++feature %1 not supported W1+partiallySupportedFeature++feature %1 only partially supported E0+styleLanguage++only allowed in style language E0+transformationLanguage++only allowed in transformation language E0+mixedLanguages+ISO/IEC 10179:1996 7.1+style and transformation language parts mixed W0+partialSpec+ISO/IEC 10179:1996 7.1+specification is marked as partial W1+cantOmitModule++grove plan excluding module %1 not supported W1+cantAddModule++grove plan including module %1 not supported E1+unknownModule++%1 not an SGML property set module E2+notACharInCharMap+ISO/IEC 10179:1996 12.6.11+Function for char-map characteristic returned non-char object %2 for character %1 E2+charPropertyNotPublicId++value for character property %1 of wrong type: %2 not a public identifier or the value "#f" E1+duplicateVariableBinding+ISO/IEC 10179:1996 8.3.2.5+variable %1 occurs more than once in bindings E0+subgroveArgs+ISO/IEC 10179:1996 11.3.1+exactly one of node:, subgrove: and class: needed W0+subgroveSubgroveArgs+ISO/IEC 10179:1996 11.3.1+add:, null:, remove:, children:, sub: make no sense with subgrove: W0+subgroveClassArgs+ISO/IEC 10179:1996 11.3.1+remove: makes no sense with class: E3+notASubgroveSpec++%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec E1+notACspecList++wrong type: %1 not a list of create-specs E1+notACspecOrCspecList++wrong type: %1 not a create-spec or list of create-specs E1+queryNotANodeList+ISO/IEC 10179:1996 11.2 12.4.1 [152] [164]+query expression: %1 not a node list E1+priorityNotAnExactInteger+ISO/IEC 10179:1996 11.2 12.4.1 [152] [164]+priority expression: %1 not an exact integer E0+badTopLevelFlowObj+ISO/IEC 10179:1996 12.4.1+flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence E0+noPrincipalPort++current flow parent has no principal port E0+noParagraphAncestor++this flow object requires a paragraph as an ancestor flow object E0+notInlineFlowObj++flow object not accepted by port; only inline flow objects accepted E0+notDisplayFlowObj++flow object not accepted by port; only display flow objects accepted E0+notInlineOrDisplayFlowObj++flow object not accepted by port; only display or inline flow objects accepted E0+notValidInParagraph++flow object not accepted in a paragraph; only inline, display or paragraph-break flow objects accepted E0+notSideBySideItem++a side-by-side flow object only accepts side-by-side-item flow objects as children E0+notMathSequence++flow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects accepted E0+notGridCell++flow object not accepted by port; must be grid-cell E0+notSingleChar++flow object not accepted by port; only a single character flow object accepted E0+badTableContent++flow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowed E0+badTablePartHF++flow object not accepted by port; only table-row or table-cell flow objects accepted E0+badTablePartBody++flow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowd E0+badTableRow++flow object not accepted by port; only table-cell flow objects accepted E0+priorityNotNumber++priority-expression must be a number E0+queryNotNodelist++query-expression must be a node-list E0+sorryPriority++Sorry, non-integral priorities not implemented OpenJade-1.4devel/style/InterpreterMessages.rc0000444000021000000240000002611607067713002015212 STRINGTABLE BEGIN 0, "unexpected end of file" 1, "invalid character" 2, "invalid character after '#'" 3, "unknown #! named constant %1" 4, "unexpected token %1" 5, "string with no closing quote" 6, "missing closing parenthesis" 7, "invalid number %1" 8, "invalid AFII glyph identifier %1" 9, "call of non-function object %1" 10, "too many arguments for function" 11, "odd number of keyword/value arguments" 12, "missing argument for function call" 13, "syntactic keyword %1 used as variable" 14, "reference to undefined variable %1" 15, "no character with name %1" 18, "unknown top level form %1" 19, "bad form %1 in mode group" 20, "identifier %1 already defined in same part" 21, "first definition was here" 22, "loop in specification of value of %1" 23, "argument out of range" 24, "loop in specification of value of unit %1" 25, "bad value specified for unit %1" 26, "unit %1 already defined in same part" 27, "first definition was here" 28, "quantity %1 undefined" 29, "incompatible dimensions" 30, "%2 argument for primitive %1 of wrong type: %3 not a boolean" 31, "%2 argument for primitive %1 of wrong type: %3 not a pair" 32, "%2 argument for primitive %1 of wrong type: %3 not a list" 33, "%2 argument for primitive %1 of wrong type: %3 not a symbol" 34, "%2 argument for primitive %1 of wrong type: %3 not a string" 35, "%2 argument for primitive %1 of wrong type: %3 not a string or symbol" 36, "%2 argument for primitive %1 of wrong type: %3 not a char" 37, "%2 argument for primitive %1 of wrong type: %3 not a style" 38, "%2 argument for primitive %1 of wrong type: %3 not an exact integer" 39, "%2 argument for primitive %1 of wrong type: %3 not a quantity" 40, "%2 argument for primitive %1 of wrong type: %3 not a color-space" 41, "%2 argument for primitive %1 of wrong type: %3 not a number" 42, "%2 argument for primitive %1 of wrong type: %3 not a sosofo" 43, "%2 argument for primitive %1 of wrong type: %3 not an optional singleton node list" 44, "%2 argument for primitive %1 of wrong type: %3 not a singleton node list" 45, "%2 argument for primitive %1 of wrong type: %3 not a node list" 46, "%2 argument for primitive %1 of wrong type: %3 not a named node list" 47, "%2 argument for primitive %1 of wrong type: %3 not a length or length-spec" 48, "%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec" 49, "%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol ""force""" 51, "%2 argument for primitive %1 of wrong type: %3 not an address" 52, "%2 argument for primitive %1 of wrong type: %3 not a glyph-id" 53, "%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table" 54, "%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids" 55, "%2 argument for primitive %1 of wrong type: %3 not a procedure" 56, "%2 argument for primitive %1 of wrong type: %3 not a vector" 57, "root rule already defined in same part with same importance" 58, "first definition was here" 59, "initial value already declared for characteristic %1 in same part" 60, "first declaration was here" 61, "%1 is not a valid keyword in a style expression" 62, "%1 is not a valid keyword in a make expression for flow object class %2" 63, "%1 is not the name of any flow object class" 64, "content expression cannot be specified in make expression for atomic flow object class %1" 65, "value for ""label:"" not a symbol" 66, "no port for label %1" 67, "invalid content map" 68, "content map references non-existent port %1" 69, "invalid value for %1 characteristic" 70, "no clause in cond expression matched" 71, "no clause in case expression matched %1" 72, "expected ""else"" not %1" 73, "sorry, cannot handle unresolvable quantities in datums in case expression" 74, "%1" 75, "division by zero" 76, "procedure does not have %1 keyword argument" 77, "argument not a keyword" 79, "specification document does not have the DSSSL architecture as a base architecture" 80, "specification document did not contain a style-specification-body element" 81, "unknown character name %1" 82, "attempt to use current node when there is none" 83, "attempt to process node in illegal context" 84, "radix must be 2, 8, 10 or 16" 85, "this context requires a sosofo" 86, "this context requires a style object" 87, "procedure can only be used in evaluation of characteristic value" 89, "%1 color requires three arguments" 90, "arguments for %1 color must be numbers" 91, "arguments for %1 color must be in the range 0 to 1" 92, "result of procedure in %1 color must be a number" 93, "unknown color-space family %1" 94, "%1 color-space family does not take any arguments" 95, "invalid parameters for %1 color-space family" 96, "%1 is not a pre-defined inherited characteristic" 97, "invalid number format %1" 98, "invalid character %1 in public identifier" 99, "debug %1" 100, "circular use of specification parts" 101, "no style-specification or external-specification with ID %1" 102, "document did not contain any style-specifications or external-specifications" 103, "table-cell flow object not inside a table" 104, "table-row flow object not inside a table" 105, "no value for node property %1" 106, "value returned by procedure was not a node-list" 107, "called from here" 108, "called from here...(%1 calls omitted)" 109, "node processing loop detected" 110, "unquote-splicing expression does not evaluate to a list" 111, "object is read-only" 112, "assignment to top-level variable %1" 113, "invalid call to continuation" 114, "empty generic identifier in pattern" 115, "pattern is not a list" 116, "%1 cannot be used as a generic identifier in a pattern" 117, "%1 cannot occur in a pattern" 118, "value missing for qualifier in pattern" 119, "unknown pattern qualifier %1" 120, "bad value %1 for %2 qualifier in pattern" 121, "repeat qualifier not allowed inside children qualifier" 122, "bad value for attributes qualifier in pattern" 123, "characteristic %1 applied in style rule with same specificity" 124, "other style rule is here" 125, "node matches more than one pattern with the same specificity" 126, "reference to uninitialized variable %1" 127, "circular use of actual value of characteristic %1" 128, "characteristic %1 already defined in same part" 129, "first definition was here" 130, "flow object class %1 already defined in same part" 131, "first definition was here" 132, "mode %1 not defined" 133, "duplicate character name %1" 134, "duplicate SDATA entity name %1" 135, "duplicate SDATA entity text %1" 136, "unsupported declaration will be ignored" 137, "unsupported character repertoire %1 will be ignored" 138, "error in declaration element" 140, "%1 is not a valid identifier" 141, "error in language definition" 142, "no current language" 143, "%2 argument for primitive %1 of wrong type: %3 not a language" 144, "%2 argument for primitive %1 of wrong type: %3 not a positive integer" 145, "%2 argument for primitive %1 of wrong type: %3 not an integer" 146, "%2 argument for primitive %1 of wrong type: %3 not a keyword" 147, "%2 argument for primitive %1 of wrong type: %3 not an alist" 148, "%2 argument for primitive %1 of wrong type: %3 not a list of characters" 149, "%2 argument for primitive %1 has wrong length" 150, "quantity %1 can't be represented exactly" 151, "default language already declared in this part" 152, "first declaration was here" 153, "%1 not a language as required in a default-language-declaration" 154, "%1 not a valid unit name" 155, "%1 not a valid character name" 156, "%1 not a valid character number" 157, "unknown character property %1" 158, "error in character property declaration" 159, "character property %1 already declared in same part" 160, "first declaration was here" 161, "added value for character property %1 already declared in same part" 162, "previous declaration was here" 163, "value returned by procedure was not a sosofo" 164, "loop in specification of value of character property %1" 165, "value for character property %1 of wrong type: %2 not an integer" 166, "value for character property %1 of wrong type: %2 not an integer or the value ""#f""" 167, "%1 not a style or transformation language feature" 168, "undeclared use of feature %1" 169, "feature %1 not supported" 170, "feature %1 only partially supported" 171, "only allowed in style language" 172, "only allowed in transformation language" 173, "style and transformation language parts mixed" 174, "specification is marked as partial" 175, "grove plan excluding module %1 not supported" 176, "grove plan including module %1 not supported" 177, "%1 not an SGML property set module" 178, "Function for char-map characteristic returned non-char object %2 for character %1" 179, "value for character property %1 of wrong type: %2 not a public identifier or the value ""#f""" 180, "variable %1 occurs more than once in bindings" 181, "exactly one of node:, subgrove: and class: needed" 182, "add:, null:, remove:, children:, sub: make no sense with subgrove:" 183, "remove: makes no sense with class:" 184, "%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec" 185, "wrong type: %1 not a list of create-specs" 186, "wrong type: %1 not a create-spec or list of create-specs" 187, "query expression: %1 not a node list" 188, "priority expression: %1 not an exact integer" 189, "flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence" 190, "current flow parent has no principal port" 191, "this flow object requires a paragraph as an ancestor flow object" 192, "flow object not accepted by port; only inline flow objects accepted" 193, "flow object not accepted by port; only display flow objects accepted" 194, "flow object not accepted by port; only display or inline flow objects accepted" 195, "flow object not accepted in a paragraph; only inline, display or paragraph-break flow objects accepted" 196, "a side-by-side flow object only accepts side-by-side-item flow objects as children" 197, "flow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects accepted" 198, "flow object not accepted by port; must be grid-cell" 199, "flow object not accepted by port; only a single character flow object accepted" 200, "flow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowed" 201, "flow object not accepted by port; only table-row or table-cell flow objects accepted" 202, "flow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowd" 203, "flow object not accepted by port; only table-cell flow objects accepted" 204, "priority-expression must be a number" 205, "query-expression must be a node-list" 206, "Sorry, non-integral priorities not implemented" END OpenJade-1.4devel/style/DssslAppMessages.msg0000644000021000000240000000167407031700242014617 # Copyright (c) 1996 James Clark, 1999 Matthias Clasen # See the file COPYING for copying permission =2000 I2+versionInfo++%1 version %2 E0+noSpec++no DSSSL specification: use -d to specify E2+noSpecTitle++no applicable processing instruction with title %1; available titles: %2 I1+prefixInfo++Options with a "doc-"/"spec-" prefix apply only to the document/specification. I1+help2++Enable experimental DSSSL extensions. I1+GHelp++Debug mode. I1+dHelp++Use DSSSL specification %1. I1+THelp++Use DSSSL specification with title %1. I1+VHelp++Pretend that %1 appeared in the specification. I1+sHelp++Strict DSSSL compliance mode. I1+eHelp++Show open entities in error messages. I1+gHelp++Show open elements in error messages. I1+nHelp++Show error numbers in error messages. I1+xHelp++Show references in error messages. I1+iHelp++Define parameter entity %1 as "INCLUDE". I1+wHelp++Enable warning %1. +sysid++SYSID +vardef++DEFINITION +name++NAME +type++TYPE OpenJade-1.4devel/style/DssslAppMessages.rc0000444000021000000240000000154207067713003014435 STRINGTABLE BEGIN 2000, "%1 version %2" 2001, "no DSSSL specification: use -d to specify" 2002, "no applicable processing instruction with title %1; available titles: %2" 2003, "Options with a ""doc-""/""spec-"" prefix apply only to the document/specification." 2004, "Enable experimental DSSSL extensions." 2005, "Debug mode." 2006, "Use DSSSL specification %1." 2007, "Use DSSSL specification with title %1." 2008, "Pretend that %1 appeared in the specification." 2009, "Strict DSSSL compliance mode." 2010, "Show open entities in error messages." 2011, "Show open elements in error messages." 2012, "Show error numbers in error messages." 2013, "Show references in error messages." 2014, "Define parameter entity %1 as ""INCLUDE""." 2015, "Enable warning %1." 2016, "SYSID" 2017, "DEFINITION" 2018, "NAME" 2019, "TYPE" END OpenJade-1.4devel/style/style.dsp0000644000021000000240000003345207025631173012546 # Microsoft Developer Studio Project File - Name="style" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=style - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "style.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "style.mak" CFG="style - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "style - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "style - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "style - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir ".\Release" # PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\spgrove" /I "..\grove" /I "..\include" /D "_WINDOWS" /D "NDEBUG" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"..\bin\ostyle.dll" /base:0x23000000 # SUBTRACT LINK32 /profile /map !ELSEIF "$(CFG)" == "style - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir ".\Debug" # PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\spgrove" /I "..\grove" /I "..\include" /D "_WINDOWS" /D "_DEBUG" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /D SP_HAVE_LOCALE=1 /FR /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\ostyle.dll" /base:0x23000000 # SUBTRACT LINK32 /incremental:no /map !ENDIF # Begin Target # Name "style - Win32 Release" # Name "style - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" # Begin Source File SOURCE=.\Collector.cxx # SUBTRACT CPP /YX # End Source File # Begin Source File SOURCE=.\common_inst.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\common_inst.m4 !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\common_inst.m4 InputName=common_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\common_inst.m4 InputName=common_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\DssslApp.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\DssslAppMessages.msg !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\DssslAppMessages.msg InputName=DssslAppMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\DssslAppMessages.msg InputName=DssslAppMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\DssslSpecEventHandler.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\ELObj.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\ELObjMessageArg.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\Expression.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\FlowObj.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\FlowObj_inst.m4 !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\FlowObj_inst.m4 InputName=FlowObj_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\FlowObj_inst.m4 InputName=FlowObj_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\FOTBuilder.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\GroveManager.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\InheritedC.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\Insn.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\Interpreter.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\InterpreterMessages.cxx # SUBTRACT CPP /YX # End Source File # Begin Source File SOURCE=.\InterpreterMessages.msg !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\InterpreterMessages.msg InputName=InterpreterMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\InterpreterMessages.msg InputName=InterpreterMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\LangObj.cxx # End Source File # Begin Source File SOURCE=.\MacroFlowObj.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\NumberCache.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\Pattern.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\primitive.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\primitive_inst.m4 !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\primitive_inst.m4 InputName=primitive_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\primitive_inst.m4 InputName=primitive_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\ProcessContext.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\ProcessingMode.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\SchemeParser.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\Style.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\style_inst.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\style_inst.m4 !IF "$(CFG)" == "style - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\style_inst.m4 InputName=style_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "style - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\style_inst.m4 InputName=style_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=..\VERSION !IF "$(CFG)" == "lib - Win32 Release" # Begin Custom Build - Building jade_version.h InputPath=..\VERSION "jade_version.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f jade_version.h perl -w mkversion.pl $(InputPath)>jade_version.h attrib +r jade_version.h # End Custom Build !ELSEIF "$(CFG)" == "lib - Win32 Debug" # Begin Custom Build - Building jade_version.h InputPath=..\VERSION "jade_version.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f jade_version.h perl -w mkversion.pl $(InputPath)>jade_version.h attrib +r jade_version.h # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\StyleEngine.cxx # ADD CPP /Yu"stylelib.h" # End Source File # Begin Source File SOURCE=.\stylelib.cxx # ADD CPP /Yc"stylelib.h" # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # Begin Source File SOURCE=.\charNames.h # End Source File # Begin Source File SOURCE=.\Collector.h # End Source File # Begin Source File SOURCE=.\dsssl_ns.h # End Source File # Begin Source File SOURCE=.\DssslApp.h # End Source File # Begin Source File SOURCE=.\DssslAppMessages.h # End Source File # Begin Source File SOURCE=.\DssslSpecEventHandler.h # End Source File # Begin Source File SOURCE=.\ELObj.h # End Source File # Begin Source File SOURCE=.\ELObjMessageArg.h # End Source File # Begin Source File SOURCE=.\EvalContext.h # End Source File # Begin Source File SOURCE=.\Expression.h # End Source File # Begin Source File SOURCE=.\FOTBuilder.h # End Source File # Begin Source File SOURCE=.\GroveManager.h # End Source File # Begin Source File SOURCE=.\Insn.h # End Source File # Begin Source File SOURCE=.\Insn2.h # End Source File # Begin Source File SOURCE=.\Interpreter.h # End Source File # Begin Source File SOURCE=.\InterpreterMessages.h # End Source File # Begin Source File SOURCE=.\jade_version.h # End Source File # Begin Source File SOURCE=.\MacroFlowObj.h # End Source File # Begin Source File SOURCE=.\NumberCache.h # End Source File # Begin Source File SOURCE=.\Pattern.h # End Source File # Begin Source File SOURCE=.\primitive.h # End Source File # Begin Source File SOURCE=.\ProcessContext.h # End Source File # Begin Source File SOURCE=.\ProcessingMode.h # End Source File # Begin Source File SOURCE=.\SchemeParser.h # End Source File # Begin Source File SOURCE=.\sdata.h # End Source File # Begin Source File SOURCE=.\SosofoObj.h # End Source File # Begin Source File SOURCE=.\Style.h # End Source File # Begin Source File SOURCE=.\style_pch.h # End Source File # Begin Source File SOURCE=.\StyleEngine.h # End Source File # Begin Source File SOURCE=.\stylelib.h # End Source File # Begin Source File SOURCE=.\VM.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=.\FlowObj_inst.cxx # PROP BASE Exclude_From_Build 1 # PROP Ignore_Default_Tool 1 # End Source File # Begin Source File SOURCE=.\primitive_inst.cxx # PROP BASE Exclude_From_Build 1 # PROP Ignore_Default_Tool 1 # End Source File # End Target # End Project OpenJade-1.4devel/jade/0000777000021000000240000000000007070410064010510 5OpenJade-1.4devel/jade/Makefile.in0000644000021000000240000002743007070410064012477 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ GENCAT = @GENCAT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ OPENJADE_MESSAGE_DOMAIN = @OPENJADE_MESSAGE_DOMAIN@ PACKAGE = @PACKAGE@ PERL = @PERL@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ l = @l@ bin_PROGRAMS = openjade openjade_SOURCES = jade.cxx SgmlFOTBuilder.cxx RtfFOTBuilder.cxx HtmlFOTBuilder.cxx TeXFOTBuilder.cxx TransformFOTBuilder.cxx MifFOTBuilder.cxx SgmlFOTBuilder.h RtfFOTBuilder.h HtmlFOTBuilder.h TeXFOTBuilder.h TransformFOTBuilder.h MifFOTBuilder.h JadeMessages.h HtmlMessages.h RtfMessages.h TeXMessages.h MifMessages.h TmpOutputByteStream.h openjade_LDADD = $(top_builddir)/style/libostyle.la $(top_builddir)/spgrove/libospgrove.la $(top_builddir)/grove/libogrove.la -losp INCLUDES = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove -I$(top_srcdir)/style EXTRA_DIST = JadeMessages.msg JadeMessages.rc HtmlMessages.msg HtmlMessages.rc RtfMessages.msg RtfMessages.rc TeXMessages.msg TeXMessages.rc MifMessages.msg MifMessages.rc HtmlFOTBuilder_inst.cxx RtfFOTBuilder_inst.cxx TeXFOTBuilder_inst.cxx TransformFOTBuilder_inst.cxx MifFOTBuilder_inst.cxx HtmlFOTBuilder_inst.m4 RtfFOTBuilder_inst.m4 TeXFOTBuilder_inst.m4 TransformFOTBuilder_inst.m4 MifFOTBuilder_inst.m4 jade.dsp jade.rc RtfOle.cxx RtfOle.h BUILT_SOURCES = JadeMessages.h JadeMessages.rc HtmlMessages.h HtmlMessages.rc RtfMessages.h RtfMessages.rc TeXMessages.h TeXMessages.rc MifMessages.h MifMessages.rc HtmlFOTBuilder_inst.cxx RtfFOTBuilder_inst.cxx TeXFOTBuilder_inst.cxx TransformFOTBuilder_inst.cxx MifFOTBuilder_inst.cxx MSGGENFLAGS = -l xModule SUFFIXES = .msg .m4 .rc mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ openjade_OBJECTS = jade.o SgmlFOTBuilder.o RtfFOTBuilder.o \ HtmlFOTBuilder.o TeXFOTBuilder.o TransformFOTBuilder.o MifFOTBuilder.o openjade_DEPENDENCIES = $(top_builddir)/style/libostyle.la \ $(top_builddir)/spgrove/libospgrove.la \ $(top_builddir)/grove/libogrove.la openjade_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(openjade_SOURCES) OBJECTS = $(openjade_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cxx .lo .m4 .msg .o .rc .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps jade/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: maintainer-clean-libtool: openjade: $(openjade_OBJECTS) $(openjade_DEPENDENCIES) @rm -f openjade $(CXXLINK) $(openjade_LDFLAGS) $(openjade_OBJECTS) $(openjade_LDADD) $(LIBS) .cxx.o: $(CXXCOMPILE) -c $< .cxx.lo: $(LTCXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = jade distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done HtmlFOTBuilder.o: HtmlFOTBuilder.cxx ../config.h HtmlFOTBuilder.h \ ../style/FOTBuilder.h ../grove/Node.h ../style/dsssl_ns.h \ HtmlMessages.h HtmlFOTBuilder_inst.cxx MifFOTBuilder.o: MifFOTBuilder.cxx ../config.h MifFOTBuilder.h \ ../style/FOTBuilder.h ../grove/Node.h ../style/dsssl_ns.h \ MifMessages.h TmpOutputByteStream.h MifFOTBuilder_inst.cxx RtfFOTBuilder.o: RtfFOTBuilder.cxx ../config.h RtfFOTBuilder.h \ ../style/FOTBuilder.h ../grove/Node.h ../style/dsssl_ns.h \ TmpOutputByteStream.h RtfMessages.h RtfFOTBuilder_inst.cxx SgmlFOTBuilder.o: SgmlFOTBuilder.cxx ../config.h SgmlFOTBuilder.h \ ../style/FOTBuilder.h ../grove/Node.h ../style/dsssl_ns.h TeXFOTBuilder.o: TeXFOTBuilder.cxx ../config.h TeXFOTBuilder.h \ ../style/FOTBuilder.h ../grove/Node.h ../style/dsssl_ns.h \ TeXMessages.h TmpOutputByteStream.h TeXFOTBuilder_inst.cxx TransformFOTBuilder.o: TransformFOTBuilder.cxx ../config.h \ TransformFOTBuilder.h ../style/FOTBuilder.h ../grove/Node.h \ ../style/dsssl_ns.h TransformFOTBuilder_inst.cxx jade.o: jade.cxx ../config.h ../style/DssslApp.h ../spgrove/GroveApp.h \ ../spgrove/GroveBuilder.h ../grove/Node.h ../style/FOTBuilder.h \ ../style/dsssl_ns.h ../style/GroveManager.h SgmlFOTBuilder.h \ RtfFOTBuilder.h TeXFOTBuilder.h TransformFOTBuilder.h \ HtmlFOTBuilder.h MifFOTBuilder.h JadeMessages.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ %.h %.cxx %.rc: %.msg $(PERL) -w $(top_builddir)/msggen.pl $(MSGGENFLAGS) $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/jade/Makefile.am0000644000021000000240000000314307067711201012464 ## Process this file with automake to produce Makefile.in bin_PROGRAMS = openjade openjade_SOURCES = jade.cxx SgmlFOTBuilder.cxx RtfFOTBuilder.cxx \ HtmlFOTBuilder.cxx TeXFOTBuilder.cxx TransformFOTBuilder.cxx \ MifFOTBuilder.cxx SgmlFOTBuilder.h RtfFOTBuilder.h \ HtmlFOTBuilder.h TeXFOTBuilder.h TransformFOTBuilder.h \ MifFOTBuilder.h \ JadeMessages.h HtmlMessages.h RtfMessages.h TeXMessages.h \ MifMessages.h TmpOutputByteStream.h openjade_LDADD = $(top_builddir)/style/libostyle.la \ $(top_builddir)/spgrove/libospgrove.la \ $(top_builddir)/grove/libogrove.la -losp INCLUDES = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove -I$(top_srcdir)/style EXTRA_DIST = JadeMessages.msg JadeMessages.rc \ HtmlMessages.msg HtmlMessages.rc \ RtfMessages.msg RtfMessages.rc \ TeXMessages.msg TeXMessages.rc \ MifMessages.msg MifMessages.rc \ HtmlFOTBuilder_inst.cxx RtfFOTBuilder_inst.cxx \ TeXFOTBuilder_inst.cxx TransformFOTBuilder_inst.cxx \ MifFOTBuilder_inst.cxx \ HtmlFOTBuilder_inst.m4 RtfFOTBuilder_inst.m4 \ TeXFOTBuilder_inst.m4 TransformFOTBuilder_inst.m4 \ MifFOTBuilder_inst.m4 jade.dsp jade.rc \ RtfOle.cxx RtfOle.h BUILT_SOURCES = JadeMessages.h JadeMessages.rc \ HtmlMessages.h HtmlMessages.rc \ RtfMessages.h RtfMessages.rc \ TeXMessages.h TeXMessages.rc \ MifMessages.h MifMessages.rc \ HtmlFOTBuilder_inst.cxx RtfFOTBuilder_inst.cxx \ TeXFOTBuilder_inst.cxx TransformFOTBuilder_inst.cxx \ MifFOTBuilder_inst.cxx MSGGENFLAGS = -l xModule SUFFIXES = .msg .m4 .rc .m4.cxx: $(PERL) $(top_srcdir)/instmac.pl $< >$@ %.h %.cxx %.rc: %.msg $(PERL) -w $(top_builddir)/msggen.pl $(MSGGENFLAGS) $< OpenJade-1.4devel/jade/jade.cxx0000644000021000000240000001176607067711306012077 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #include "DssslApp.h" #include "SgmlFOTBuilder.h" #include "RtfFOTBuilder.h" #include "TeXFOTBuilder.h" #include "TransformFOTBuilder.h" #ifdef JADE_HTML #include "HtmlFOTBuilder.h" #endif #ifdef JADE_MIF #include "MifFOTBuilder.h" #endif #ifdef JADE_TEXT #include "TextFOTBuilder.h" #endif #include #include #include #include "JadeMessages.h" #include #include #include "dsssl_ns.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class JadeApp : public DssslApp { public: enum { u = 72000 }; JadeApp(); void processOption(AppChar opt, const AppChar *arg); FOTBuilder *makeFOTBuilder(const FOTBuilder::Description *&); private: enum OutputType { fotType, rtfType, #ifdef JADE_HTML htmlType, #endif texType, #ifdef JADE_MIF mifType, #endif sgmlType, xmlType, #ifdef JADE_TEXT txtType #endif }; static const AppChar *const outputTypeNames[]; OutputType outputType_; String outputFilename_; Vector outputOptions_; FileOutputByteStream outputFile_; }; const JadeApp::AppChar *const JadeApp::outputTypeNames[] = { SP_T("fot"), SP_T("rtf"), #ifdef JADE_HTML SP_T("html"), #endif SP_T("tex"), #ifdef JADE_MIF SP_T("mif"), #endif SP_T("sgml"), SP_T("xml"), #ifdef JADE_TEXT SP_T("txt"), #endif }; JadeApp::JadeApp() : DssslApp(u), outputType_(fotType) { registerOption('t', SP_T("output-type"), JadeMessages::outputType, JadeMessages::tHelp); registerOption('o', SP_T("output-file"), JadeMessages::file, JadeMessages::oHelp); } void JadeApp::processOption(AppChar opt, const AppChar *arg) { switch (opt) { case 't': { const AppChar *sub = tcschr(arg, SP_T('-')); size_t len = sub ? sub - arg : tcslen(arg); for (size_t i = 0;; i++) { if (i >= SIZEOF(outputTypeNames)) { message(JadeMessages::unknownType, StringMessageArg(convertInput(arg))); break; } if (tcsncmp(arg, outputTypeNames[i], len) == 0) { outputType_ = OutputType(i); break; } } if (sub) { StringC tem(convertInput(sub)); StringC arg; for (size_t i = 0; i < tem.size(); i++) { if (tem[i] == '-') { if (arg.size()) outputOptions_.push_back(arg); arg.resize(0); } else arg += tem[i]; } if (arg.size()) outputOptions_.push_back(arg); } } break; case 'o': if (*arg == 0) message(JadeMessages::emptyOutputFilename); else outputFilename_.assign(arg, tcslen(arg)); break; default: DssslApp::processOption(opt, arg); break; } } FOTBuilder *JadeApp::makeFOTBuilder(const FOTBuilder::Description *&descr) { if (outputFilename_.size() == 0) { if (defaultOutputBasename_.size() != 0) { #ifdef SP_WIDE_SYSTEM outputFilename_ = defaultOutputBasename_; #else outputFilename_ = codingSystem()->convertOut(defaultOutputBasename_); // convertOut adds a nul outputFilename_.resize(outputFilename_.size() - 1); #endif } else outputFilename_.assign(SP_T("jade-out"), 8); outputFilename_ += SP_T('.'); const AppChar *ext = outputTypeNames[outputType_]; outputFilename_.append(ext, tcslen(ext)); } switch (outputType_) { #ifdef JADE_HTML case htmlType: #endif case sgmlType: case xmlType: break; default: outputFilename_ += 0; if (!outputFile_.open(outputFilename_.data())) { message(JadeMessages::cannotOpenOutputError, StringMessageArg(CmdLineApp::convertInput(outputFilename_.data())), ErrnoMessageArg(errno)); return 0; } break; } switch (outputType_) { case rtfType: unitsPerInch_ = 20*72; // twips return makeRtfFOTBuilder(&outputFile_, outputOptions_, entityManager(), systemCharset(), this, descr); case texType: return makeTeXFOTBuilder(&outputFile_, this, descr); #ifdef JADE_HTML case htmlType: return makeHtmlFOTBuilder(outputFilename_, this, descr); #endif /* JADE_HTML */ #ifdef JADE_MIF case mifType: return makeMifFOTBuilder(outputFilename_, entityManager(), systemCharset(), this, descr); #endif /* JADE_MIF */ case fotType: return makeSgmlFOTBuilder(new RecordOutputCharStream( new EncodeOutputCharStream(&outputFile_, outputCodingSystem_)), descr); case sgmlType: case xmlType: return makeTransformFOTBuilder(this, outputType_ == xmlType, outputOptions_, descr); #ifdef JADE_TEXT case txtType: return makeTextFOTBuilder(&outputFile_, this, descr); #endif /* JADE_TEXT */ default: break; } CANNOT_HAPPEN(); return 0; } #ifdef DSSSL_NAMESPACE } #endif #ifdef DSSSL_NAMESPACE SP_DEFINE_APP(DSSSL_NAMESPACE::JadeApp) #else SP_DEFINE_APP(JadeApp) #endif OpenJade-1.4devel/jade/SgmlFOTBuilder.cxx0000644000021000000240000015521607031473760013755 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. // Possible improvements: // Don't serialize ports // Extension flow objects // Merge text chunks // Handle input-whitespace-treatment/tabs // Table processing // When element has an ID, output both ID anchor and numeric anchor #include "config.h" #include "SgmlFOTBuilder.h" #include #include "dsssl_ns.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class SgmlFOTBuilder : public SerialFOTBuilder { public: SgmlFOTBuilder(OutputCharStream *); ~SgmlFOTBuilder(); void setFontSize(Length); void setFontFamilyName(const StringC &); void setFontWeight(Symbol); void setFontPosture(Symbol); void setStartIndent(const LengthSpec &); void setEndIndent(const LengthSpec &); void setFirstLineStartIndent(const LengthSpec &); void setLastLineEndIndent(const LengthSpec &); void setLineSpacing(const LengthSpec &); void setFieldWidth(const LengthSpec &); void setPositionPointShift(const LengthSpec &); void setStartMargin(const LengthSpec &); void setEndMargin(const LengthSpec &); void setSidelineSep(const LengthSpec &); void setAsisWrapIndent(const LengthSpec &); void setLineNumberSep(const LengthSpec &); void setLastLineJustifyLimit(const LengthSpec &); void setJustifyGlyphSpaceMaxAdd(const LengthSpec &); void setJustifyGlyphSpaceMaxRemove(const LengthSpec &); void setTableCornerRadius(const LengthSpec &); void setBoxCornerRadius(const LengthSpec &); void setMarginaliaSep(const LengthSpec &); void setMinPreLineSpacing(const OptLengthSpec &); void setMinPostLineSpacing(const OptLengthSpec &); void setMinLeading(const OptLengthSpec &); void setLines(Symbol); void setQuadding(Symbol); void setDisplayAlignment(Symbol sym); void setFieldAlign(Symbol); void setLineJoin(Symbol); void setLineCap(Symbol); void setLineNumberSide(Symbol); void setKernMode(Symbol); void setInputWhitespaceTreatment(Symbol); void setFillingDirection(Symbol); void setWritingMode(Symbol); void setLastLineQuadding(Symbol); void setMathDisplayMode(Symbol); void setScriptPreAlign(Symbol); void setScriptPostAlign(Symbol); void setScriptMidSupAlign(Symbol); void setScriptMidSubAlign(Symbol); void setNumeratorAlign(Symbol); void setDenominatorAlign(Symbol); void setGridPositionCellType(Symbol); void setGridColumnAlignment(Symbol); void setGridRowAlignment(Symbol); void setBoxType(Symbol); void setSideBySideOverlapControl(Symbol sym); void setSideBySidePreAlign(Symbol sym); void setSideBySidePostAlign(Symbol sym); void setGlyphAlignmentMode(Symbol); void setBoxBorderAlignment(Symbol); void setCellRowAlignment(Symbol); void setBorderAlignment(Symbol); void setSidelineSide(Symbol); void setHyphenationKeep(Symbol); void setFontStructure(Symbol); void setFontProportionateWidth(Symbol); void setCellCrossed(Symbol); void setMarginaliaSide(Symbol); void setColor(const DeviceRGBColor &); void setBackgroundColor(const DeviceRGBColor &); void setBackgroundColor(); void setPageWidth(Length); void setPageHeight(Length); void setLeftMargin(Length); void setRightMargin(Length); void setTopMargin(Length); void setBottomMargin(Length); void setHeaderMargin(Length); void setFooterMargin(Length); void setLineThickness(Length); void setCellBeforeRowMargin(Length); void setCellAfterRowMargin(Length); void setCellBeforeColumnMargin(Length); void setCellAfterColumnMargin(Length); void setLineSep(Length); void setBoxSizeBefore(Length); void setBoxSizeAfter(Length); void setLayer(long); void setBackgroundLayer(long); void setBorderPriority(long); void setLineRepeat(long); void setSpan(long); void setMinLeaderRepeat(long); void setHyphenationRemainCharCount(long); void setHyphenationPushCharCount(long); void setWidowCount(long); void setOrphanCount(long); void setExpandTabs(long); void setHyphenationLadderCount(long); void setLanguage(Letter2); void setCountry(Letter2); void setBackgroundTile(PublicId); void setLineBreakingMethod(PublicId); void setLineCompositionMethod(PublicId); void setImplicitBidiMethod(PublicId); void setGlyphSubstMethod(PublicId); void setGlyphReorderMethod(PublicId); void setHyphenationMethod(PublicId); void setTableAutoWidthMethod(PublicId); void setFontName(PublicId); void setBorderPresent(bool); void setInhibitLineBreaks(bool); void setHyphenate(bool); void setKern(bool); void setLigature(bool); void setScoreSpaces(bool); void setFloatOutMarginalia(bool); void setFloatOutSidelines(bool); void setFloatOutLineNumbers(bool); void setCellBackground(bool); void setSpanWeak(bool); void setIgnoreRecordEnd(bool); void setNumberedLines(bool); void setHangingPunct(bool); void setBoxOpenEnd(bool); void setTruncateLeader(bool); void setAlignLeader(bool); void setTablePartOmitMiddleHeader(bool); void setTablePartOmitMiddleFooter(bool); void setBorderOmitAtBreak(bool); void setPrincipalModeSimultaneous(bool); void setMarginaliaKeepWithPrevious(bool); void setGridEquidistantRows(bool); void setGridEquidistantColumns(bool); void setEscapementSpaceBefore(const InlineSpace &); void setEscapementSpaceAfter(const InlineSpace &); void setInlineSpaceSpace(const OptInlineSpace &); void setCharMap(Symbol); void setGlyphSubstTable(const Vector > &tables); void paragraphBreak(const ParagraphNIC &); void characters(const Char *, size_t); void charactersFromNode(const NodePtr &nd, const Char *s, size_t n); void character(const CharacterNIC &); void externalGraphic(const ExternalGraphicNIC &); void rule(const RuleNIC &); void alignmentPoint(); void startSimplePageSequenceSerial(); void endSimplePageSequenceSerial(); void pageNumber(); void startSimplePageSequenceHeaderFooter(unsigned); void endSimplePageSequenceHeaderFooter(unsigned); void endAllSimplePageSequenceHeaderFooter(); void startScroll(); void endScroll(); void startLink(const Address &); void endLink(); void startMarginalia(); void endMarginalia(); void startMultiModeSerial(const MultiMode *); void endMultiModeSerial(); void startMultiModeMode(const MultiMode &); void endMultiModeMode(); void startScore(Char); void startScore(const LengthSpec &); void startScore(Symbol); void endScore(); void startLeader(const LeaderNIC &); void endLeader(); void startSideline(); void endSideline(); void startBox(const BoxNIC &); void endBox(); void startSideBySide(const DisplayNIC&); void endSideBySide(); void startSideBySideItem(); void endSideBySideItem(); void startParagraph(const ParagraphNIC &); void endParagraph(); void startSequence(); void endSequence(); void startLineField(const LineFieldNIC &); void endLineField(); void startDisplayGroup(const DisplayGroupNIC &); void endDisplayGroup(); void startTable(const TableNIC &); void endTable(); void tableBeforeRowBorder(); void tableAfterRowBorder(); void tableBeforeColumnBorder(); void tableAfterColumnBorder(); void tableColumn(const TableColumnNIC &); void startTablePartSerial(const TablePartNIC &); void endTablePartSerial(); void startTablePartHeader(); void endTablePartHeader(); void startTablePartFooter(); void endTablePartFooter(); void startTableRow(); void endTableRow(); void startTableCell(const TableCellNIC &); void endTableCell(); void tableCellBeforeRowBorder(); void tableCellAfterRowBorder(); void tableCellBeforeColumnBorder(); void tableCellAfterColumnBorder(); void startMathSequence(); void endMathSequence(); void startFractionSerial(); void endFractionSerial(); void startFractionNumerator(); void endFractionNumerator(); void startFractionDenominator(); void endFractionDenominator(); void fractionBar(); void startUnmath(); void endUnmath(); void startSuperscript(); void endSuperscript(); void startSubscript(); void endSubscript(); void startScriptSerial(); void endScriptSerial(); void startScriptPreSup(); void endScriptPreSup(); void startScriptPreSub(); void endScriptPreSub(); void startScriptPostSup(); void endScriptPostSup(); void startScriptPostSub(); void endScriptPostSub(); void startScriptMidSup(); void endScriptMidSup(); void startScriptMidSub(); void endScriptMidSub(); void startMarkSerial(); void endMarkSerial(); void startMarkOver(); void endMarkOver(); void startMarkUnder(); void endMarkUnder(); void startFenceSerial(); void endFenceSerial(); void startFenceOpen(); void endFenceOpen(); void startFenceClose(); void endFenceClose(); void startRadicalSerial(); void endRadicalSerial(); void startRadicalDegree(); void endRadicalDegree(); void radicalRadical(const CharacterNIC &); void radicalRadicalDefaulted(); void startMathOperatorSerial(); void endMathOperatorSerial(); void startMathOperatorOperator(); void endMathOperatorOperator(); void startMathOperatorLowerLimit(); void endMathOperatorLowerLimit(); void startMathOperatorUpperLimit(); void endMathOperatorUpperLimit(); void startGrid(const GridNIC &); void endGrid(); void startGridCell(const GridCellNIC &); void endGridCell(); void startNode(const NodePtr &, const StringC &); void endNode(); void currentNodePageNumber(const NodePtr &); struct Data { Data(const StringC &str) : ptr(str.data()), size(str.size()) { } Data(const Char *p, size_t n) : ptr(p), size(n) { } const Char *ptr; size_t size; }; struct Units { Units(long i) : n(i) { } long n; }; private: OutputCharStream &os() { return *curOs_; } void outputIcs(); void startSimpleFlowObj(const char *name); void simpleFlowObj(const char *name); void startPortFlow(const char *name); void endFlow(const char *name); void characterNIC(const CharacterNIC &nic); void displayNIC(const DisplayNIC &nic); void inlineNIC(const InlineNIC &nic); void boolC(const char *, bool); void lengthC(const char *, Length); void lengthSpecC(const char *, const LengthSpec &); void optLengthSpecC(const char *, const OptLengthSpec &); void symbolC(const char *name, Symbol sym); void integerC(const char *, long); void publicIdC(const char *, PublicId); void inlineSpaceC(const char *name, const InlineSpace &); void optInlineSpaceC(const char*, const OptInlineSpace &); void displaySpaceNIC(const char *name, const DisplaySpace &); void flushPendingElements(); void outputElementName(unsigned long groveIndex, const Char *, size_t); void outputElementName(const NodePtr &node); static bool nodeIsElement(const NodePtr &node) { GroveString gi; return node->getGi(gi) == accessOK; } Owner os_; StrOutputCharStream ics_; StrOutputCharStream hfs_; OutputCharStream *curOs_; Vector multiModeHasPrincipalMode_; Vector glyphSubstTableDefined_; Vector pendingElements_; Vector pendingElementLevels_; unsigned nPendingElementsNonEmpty_; unsigned nodeLevel_; bool suppressAnchors_; StringC hf_[nHF]; }; const char RE = '\r'; const char quot = '"'; const char *const trueString = "true"; const char *const falseString = "false"; // May change this to "null" const char *const nullString = "false"; typedef SgmlFOTBuilder::Units Units; inline OutputCharStream &operator<<(OutputCharStream &os, #ifdef GROVE_NAMESPACE GROVE_NAMESPACE:: #endif GroveString &str) { return os.write(str.data(), str.size()); } inline OutputCharStream &operator<<(OutputCharStream &os, long n) { if (n < 0) return os << '-' << (unsigned long)-n; else return os << (unsigned long)n; } inline const char *boolString(bool b) { return b ? trueString : falseString; } inline OutputCharStream &operator<<(OutputCharStream &os, FOTBuilder::Symbol sym) { switch (sym) { case FOTBuilder::symbolFalse: os << falseString; break; case FOTBuilder::symbolTrue: os << trueString; break; default: os << FOTBuilder::symbolName(sym); break; } return os; } inline OutputCharStream &operator<<(OutputCharStream &os, double d) { char buf[128]; sprintf(buf, "%g", d); return os << buf; } OutputCharStream &operator<<(OutputCharStream &os, Units u) { char buf[32]; sprintf(buf, "%03d", u.n); int len = strlen(buf); int i = 0; for (; i < 3 && buf[len - i - 1] == '0'; i++) ; if (i == 3) { i = len - 3; if (i == 0) buf[i++] = '0'; } else { int j = len + 1 - i; for (; i < 3; i++) buf[len - i] = buf[len - i - 1]; buf[len - 3] = '.'; i = j; } strcpy(buf + i, "pt"); return os << buf; } inline OutputCharStream &operator<<(OutputCharStream &os, const FOTBuilder::LengthSpec &ls) { if (ls.displaySizeFactor != 0.0) { // 100+20% if (ls.length) { os << Units(ls.length); if (ls.displaySizeFactor >= 0.0) os << '+'; } char buf[128]; sprintf(buf, "%.2f%%", ls.displaySizeFactor * 100.0); } else os << Units(ls.length); return os; } OutputCharStream &operator<<(OutputCharStream &os, const FOTBuilder::TableLengthSpec &ls) { if (ls.displaySizeFactor != 0.0 || ls.tableUnitFactor != 0.0) { // 100+20% bool needSign = 0; if (ls.length) { os << Units(ls.length); needSign = 1; } char buf[128]; if (ls.displaySizeFactor != 0.0) { if (needSign && ls.displaySizeFactor >= 0.0) os << '+'; sprintf(buf, "%.2f%%", ls.displaySizeFactor * 100.0); needSign = 1; os << buf; } if (ls.tableUnitFactor != 0.0) { if (needSign && ls.tableUnitFactor >= 0.0) os << '+'; sprintf(buf, "%.2f*", ls.tableUnitFactor); os << buf; } } else os << Units(ls.length); return os; } OutputCharStream &operator<<(OutputCharStream &os, SgmlFOTBuilder::Data data) { const Char *s = data.ptr; size_t n = data.size; for (; n > 0; n--, s++) { switch (*s) { case '&': os << "&"; break; case '<': os << "<"; break; case '>': os << ">"; break; case '"': os << """; break; default: if (*s < 0x80) os.put(*s); else os << "&#" << (unsigned long)*s << ';'; break; } } return os; } inline OutputCharStream &operator<<(OutputCharStream &os, const FOTBuilder::GlyphId &gid) { if (gid.publicId) { os << gid.publicId; if (gid.suffix) os << "::" << gid.suffix; } else os << falseString; return os; } FOTBuilder *makeSgmlFOTBuilder(OutputCharStream *os, const FOTBuilder::Description *&descr) { static const FOTBuilder::Feature features[] = { { "sideline", 0}, { "side-by-side", 0}, { "table", 0}, { "math", 0}, { "simple-page", 0}, { "online", 0}, { 0, 0} }; static const char *media[] = { 0 }; static FOTBuilder::Description description = { 0, // Extension features, false, media }; descr = &description; return new SgmlFOTBuilder(os); } static void outputNumericCharRef(OutputCharStream &os, Char c) { os << "&#" << (unsigned long)c << ';'; } SgmlFOTBuilder::SgmlFOTBuilder(OutputCharStream *os) : os_(os), curOs_(os), nodeLevel_(0), nPendingElementsNonEmpty_(0), suppressAnchors_(0) { os->setEscaper(outputNumericCharRef); *os_ << "" << RE; #if 0 *os_ << "" << RE; #endif *os_ << "" << RE; } SgmlFOTBuilder::~SgmlFOTBuilder() { os() << "" << RE; } void SgmlFOTBuilder::characters(const Char *s, size_t n) { if (n == 0) return; flushPendingElements(); os() << "" << Data(s, n) << "" << RE; } void SgmlFOTBuilder::charactersFromNode(const NodePtr &nd, const Char *s, size_t n) { GroveString name; GroveString text; NodePtr entity; if (n == 1 && *s == 0xFFFD && nd->getEntityName(name) == accessOK && nd->getEntity(entity) == accessOK && entity->getText(text) == accessOK) os() << "" << RE; else SgmlFOTBuilder::characters(s, n); } void SgmlFOTBuilder::characterNIC(const CharacterNIC &nic) { if (nic.specifiedC) { if (nic.specifiedC & (1 << CharacterNIC::cChar)) os() << " char=" << quot << "&#" << (unsigned long)nic.ch << ";" << quot; if (nic.specifiedC & (1 << CharacterNIC::cGlyphId)) os() << " glyph-id=" << quot << nic.glyphId << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsDropAfterLineBreak)) os() << " drop-after-line-break=" << quot << boolString(nic.isDropAfterLineBreak) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsDropUnlessBeforeLineBreak)) os() << " drop-unless-before-line-break=" << quot << boolString(nic.isDropUnlessBeforeLineBreak) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsPunct)) os() << " punct=" << quot << boolString(nic.isPunct) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsInputWhitespace)) os() << " input-whitespace=" << quot << boolString(nic.isInputWhitespace) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsInputTab)) os() << " input-tab=" << quot << boolString(nic.isInputTab) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsRecordEnd)) os() << " record-end=" << quot << boolString(nic.isRecordEnd) << quot; if (nic.specifiedC & (1 << CharacterNIC::cIsSpace)) os() << " space=" << quot << boolString(nic.isSpace) << quot; if (nic.specifiedC & (1 << CharacterNIC::cScript)) { if (nic.script) os() << " script=" << quot << nic.script << quot; else os() << " script=" << quot << falseString << quot; } if (nic.specifiedC & (1 << CharacterNIC::cMathClass)) os() << " math-class=" << quot << nic.mathClass << quot; if (nic.specifiedC & (1 << CharacterNIC::cMathFontPosture)) os() << " math-font-posture=" << quot << nic.mathFontPosture << quot; if (nic.specifiedC & (1 << CharacterNIC::cBreakBeforePriority)) os() << " break-before-priority=" << quot << nic.breakBeforePriority << quot; if (nic.specifiedC & (1 << CharacterNIC::cBreakAfterPriority)) os() << " break-after-priority=" << quot << nic.breakAfterPriority << quot; } if (nic.stretchFactor != 1.0) os() << " stretch-factor=" << quot << nic.stretchFactor << quot; } void SgmlFOTBuilder::character(const CharacterNIC &nic) { flushPendingElements(); os() << ""; } void SgmlFOTBuilder::outputIcs() { StringC str; ics_.extractString(str); os() << str; } void SgmlFOTBuilder::setFontSize(Length n) { lengthC("font-size", n); } void SgmlFOTBuilder::setFontFamilyName(const StringC &str) { ics_ << " font-family-name=" << quot << str << quot; } void SgmlFOTBuilder::setFontWeight(Symbol weight) { symbolC("font-weight", weight); } void SgmlFOTBuilder::setFontPosture(Symbol posture) { symbolC("font-posture", posture); } void SgmlFOTBuilder::setStartIndent(const LengthSpec &ls) { lengthSpecC("start-indent", ls); } void SgmlFOTBuilder::setEndIndent(const LengthSpec &ls) { lengthSpecC("end-indent", ls); } void SgmlFOTBuilder::setFirstLineStartIndent(const LengthSpec &ls) { lengthSpecC("first-line-start-indent", ls); } void SgmlFOTBuilder::setLastLineEndIndent(const LengthSpec &ls) { lengthSpecC("last-line-end-indent", ls); } void SgmlFOTBuilder::setLineSpacing(const LengthSpec &ls) { lengthSpecC("line-spacing", ls); } void SgmlFOTBuilder::setFieldWidth(const LengthSpec &ls) { lengthSpecC("field-width", ls); } void SgmlFOTBuilder::setPositionPointShift(const LengthSpec &ls) { lengthSpecC("position-point-shift", ls); } void SgmlFOTBuilder::setStartMargin(const LengthSpec &ls) { lengthSpecC("start-margin", ls); } void SgmlFOTBuilder::setEndMargin(const LengthSpec &ls) { lengthSpecC("end-margin", ls); } void SgmlFOTBuilder::setSidelineSep(const LengthSpec &ls) { lengthSpecC("sideline-sep", ls); } void SgmlFOTBuilder::setAsisWrapIndent(const LengthSpec &ls) { lengthSpecC("asis-wrap-indent", ls); } void SgmlFOTBuilder::setLineNumberSep(const LengthSpec &ls) { lengthSpecC("line-number-sep", ls); } void SgmlFOTBuilder::setLastLineJustifyLimit(const LengthSpec &ls) { lengthSpecC("last-line-justify-limit", ls); } void SgmlFOTBuilder::setJustifyGlyphSpaceMaxAdd(const LengthSpec &ls) { lengthSpecC("justify-glyph-space-max-add", ls); } void SgmlFOTBuilder::setJustifyGlyphSpaceMaxRemove(const LengthSpec &ls) { lengthSpecC("justify-glyph-space-max-remove", ls); } void SgmlFOTBuilder::setTableCornerRadius(const LengthSpec &ls) { lengthSpecC("table-corner-radius", ls); } void SgmlFOTBuilder::setBoxCornerRadius(const LengthSpec &ls) { lengthSpecC("box-corner-radius", ls); } void SgmlFOTBuilder::setMarginaliaSep(const LengthSpec &ls) { lengthSpecC("marginalia-sep", ls); } void SgmlFOTBuilder::lengthSpecC(const char *s, const LengthSpec &ls) { ics_ << ' ' << s << '=' << quot << ls << quot; } void SgmlFOTBuilder::setMinPreLineSpacing(const OptLengthSpec &ols) { optLengthSpecC("min-pre-line-spacing", ols); } void SgmlFOTBuilder::setMinPostLineSpacing(const OptLengthSpec &ols) { optLengthSpecC("min-post-line-spacing", ols); } void SgmlFOTBuilder::setMinLeading(const OptLengthSpec &ols) { optLengthSpecC("min-leading", ols); } void SgmlFOTBuilder::optLengthSpecC(const char *s, const OptLengthSpec &ols) { if (ols.hasLength) lengthSpecC(s, ols.length); else ics_ << ' ' << s << quot << falseString << quot; } void SgmlFOTBuilder::setLines(Symbol sym) { symbolC("lines", sym); } void SgmlFOTBuilder::setQuadding(Symbol sym) { symbolC("quadding", sym); } void SgmlFOTBuilder::setDisplayAlignment(Symbol sym) { symbolC("display-alignment", sym); } void SgmlFOTBuilder::setFieldAlign(Symbol sym) { symbolC("field-align", sym); } void SgmlFOTBuilder::setLineJoin(Symbol sym) { symbolC("line-join", sym); } void SgmlFOTBuilder::setLineCap(Symbol sym) { symbolC("line-cap", sym); } void SgmlFOTBuilder::setLineNumberSide(Symbol sym) { symbolC("line-number-side", sym); } void SgmlFOTBuilder::setKernMode(Symbol sym) { symbolC("kern-mode", sym); } void SgmlFOTBuilder::setInputWhitespaceTreatment(Symbol sym) { symbolC("input-whitespace-treatment", sym); } void SgmlFOTBuilder::setFillingDirection(Symbol sym) { symbolC("filling-direction", sym); } void SgmlFOTBuilder::setWritingMode(Symbol sym) { symbolC("writing-mode", sym); } void SgmlFOTBuilder::setLastLineQuadding(Symbol sym) { symbolC("last-line-quadding", sym); } void SgmlFOTBuilder::setMathDisplayMode(Symbol sym) { symbolC("math-display-mode", sym); } void SgmlFOTBuilder::setScriptPreAlign(Symbol sym) { symbolC("script-pre-align", sym); } void SgmlFOTBuilder::setScriptPostAlign(Symbol sym) { symbolC("script-post-align", sym); } void SgmlFOTBuilder::setScriptMidSupAlign(Symbol sym) { symbolC("script-mid-sup-align", sym); } void SgmlFOTBuilder::setScriptMidSubAlign(Symbol sym) { symbolC("script-mid-sub-align", sym); } void SgmlFOTBuilder::setNumeratorAlign(Symbol sym) { symbolC("numerator-align", sym); } void SgmlFOTBuilder::setDenominatorAlign(Symbol sym) { symbolC("denominator-align", sym); } void SgmlFOTBuilder::setGridPositionCellType(Symbol sym) { symbolC("grid-position-cell-type", sym); } void SgmlFOTBuilder::setGridColumnAlignment(Symbol sym) { symbolC("grid-column-alignment", sym); } void SgmlFOTBuilder::setGridRowAlignment(Symbol sym) { symbolC("grid-row-alignment", sym); } void SgmlFOTBuilder::setBoxType(Symbol sym) { symbolC("box-type", sym); } void SgmlFOTBuilder::setSideBySideOverlapControl(Symbol sym) { symbolC("side-by-side-overlap-control", sym); } void SgmlFOTBuilder::setSideBySidePreAlign(Symbol sym) { symbolC("side-by-side-pre-align", sym); } void SgmlFOTBuilder::setSideBySidePostAlign(Symbol sym) { symbolC("side-by-side-post-align", sym); } void SgmlFOTBuilder::setGlyphAlignmentMode(Symbol sym) { symbolC("glyph-alignment-mode", sym); } void SgmlFOTBuilder::setBoxBorderAlignment(Symbol sym) { symbolC("box-border-alignment", sym); } void SgmlFOTBuilder::setCellRowAlignment(Symbol sym) { symbolC("cell-row-alignment", sym); } void SgmlFOTBuilder::setBorderAlignment(Symbol sym) { symbolC("border-alignment", sym); } void SgmlFOTBuilder::setSidelineSide(Symbol sym) { symbolC("sideline-side", sym); } void SgmlFOTBuilder::setHyphenationKeep(Symbol sym) { symbolC("hyphenation-keep", sym); } void SgmlFOTBuilder::setFontStructure(Symbol sym) { symbolC("font-structure", sym); } void SgmlFOTBuilder::setFontProportionateWidth(Symbol sym) { symbolC("font-proportionate-width", sym); } void SgmlFOTBuilder::setCellCrossed(Symbol sym) { symbolC("cell-crossed", sym); } void SgmlFOTBuilder::setMarginaliaSide(Symbol sym) { symbolC("marginalia-side", sym); } void SgmlFOTBuilder::symbolC(const char *name, Symbol sym) { ics_ << ' ' << name << '=' << quot << sym << quot; } inline void hex2(OutputCharStream &os, unsigned char c) { static const char hexDigits[] = "0123456789ABCDEF"; os << hexDigits[c >> 4] << hexDigits[c & 0xF]; } inline OutputCharStream &operator<<(OutputCharStream &os, const FOTBuilder::DeviceRGBColor &color) { os << '#'; hex2(os, color.red); hex2(os, color.green); hex2(os, color.blue); return os; } void SgmlFOTBuilder::setColor(const DeviceRGBColor &color) { ics_ << " color=" << quot << color << quot; } void SgmlFOTBuilder::setBackgroundColor() { ics_ << " background-color=" << quot << falseString << quot; } void SgmlFOTBuilder::setBackgroundColor(const DeviceRGBColor &color) { ics_ << " background-color=" << quot << color << quot; } void SgmlFOTBuilder::setPageWidth(Length units) { lengthC("page-width", units); } void SgmlFOTBuilder::setPageHeight(Length units) { lengthC("page-height", units); } void SgmlFOTBuilder::setLeftMargin(Length units) { lengthC("left-margin", units); } void SgmlFOTBuilder::setRightMargin(Length units) { lengthC("right-margin", units); } void SgmlFOTBuilder::setTopMargin(Length units) { lengthC("top-margin", units); } void SgmlFOTBuilder::setBottomMargin(Length units) { lengthC("bottom-margin", units); } void SgmlFOTBuilder::setHeaderMargin(Length units) { lengthC("header-margin", units); } void SgmlFOTBuilder::setFooterMargin(Length units) { lengthC("footer-margin", units); } void SgmlFOTBuilder::setLineThickness(Length units) { lengthC("line-thickness", units); } void SgmlFOTBuilder::setCellBeforeRowMargin(Length units) { lengthC("cell-before-row-margin", units); } void SgmlFOTBuilder::setCellAfterRowMargin(Length units) { lengthC("cell-after-row-margin", units); } void SgmlFOTBuilder::setCellBeforeColumnMargin(Length units) { lengthC("cell-before-column-margin", units); } void SgmlFOTBuilder::setCellAfterColumnMargin(Length units) { lengthC("cell-after-column-margin", units); } void SgmlFOTBuilder::setLineSep(Length units) { lengthC("line-sep", units); } void SgmlFOTBuilder::setBoxSizeBefore(Length units) { lengthC("box-size-before", units); } void SgmlFOTBuilder::setBoxSizeAfter(Length units) { lengthC("box-size-after", units); } void SgmlFOTBuilder::lengthC(const char *s, Length units) { ics_ << ' ' << s << '=' << quot << Units(units) << quot; } void SgmlFOTBuilder::setLayer(long n) { integerC("layer", n); } void SgmlFOTBuilder::setBackgroundLayer(long n) { integerC("background-layer", n); } void SgmlFOTBuilder::setBorderPriority(long n) { integerC("border-priority", n); } void SgmlFOTBuilder::setLineRepeat(long n) { integerC("line-repeat", n); } void SgmlFOTBuilder::setSpan(long n) { integerC("span", n); } void SgmlFOTBuilder::setMinLeaderRepeat(long n) { integerC("min-leader-repeat", n); } void SgmlFOTBuilder::setHyphenationRemainCharCount(long n) { integerC("hyphenation-remain-char-count", n); } void SgmlFOTBuilder::setHyphenationPushCharCount(long n) { integerC("hyphenation-push-char-count", n); } void SgmlFOTBuilder::setWidowCount(long n) { integerC("widow-count", n); } void SgmlFOTBuilder::setOrphanCount(long n) { integerC("orphan-count", n); } void SgmlFOTBuilder::integerC(const char *s, long n) { ics_ << ' ' << s << '=' << quot << n << quot; } void SgmlFOTBuilder::setExpandTabs(long n) { integerC("expand-tabs", n); } void SgmlFOTBuilder::setHyphenationLadderCount(long n) { integerC("hyphenation-ladder-count", n); } void SgmlFOTBuilder::setCountry(Letter2 code) { ics_ << " country=" << quot; if (code) ics_ << char((code >> 8) & 0xff) << char(code & 0xff); else ics_ << falseString; ics_ << quot; } void SgmlFOTBuilder::setLanguage(Letter2 code) { ics_ << " language=" << quot; if (code) ics_ << char((code >> 8) & 0xff) << char(code & 0xff); else ics_ << falseString; ics_ << quot; } void SgmlFOTBuilder::setBackgroundTile(PublicId pubid) { publicIdC("background-tile", pubid); } void SgmlFOTBuilder::setLineBreakingMethod(PublicId pubid) { publicIdC("line-breaking-method", pubid); } void SgmlFOTBuilder::setLineCompositionMethod(PublicId pubid) { publicIdC("line-composition-method", pubid); } void SgmlFOTBuilder::setImplicitBidiMethod(PublicId pubid) { publicIdC("implicit-bidi-method", pubid); } void SgmlFOTBuilder::setGlyphSubstMethod(PublicId pubid) { publicIdC("glyph-subst-method", pubid); } void SgmlFOTBuilder::setGlyphReorderMethod(PublicId pubid) { publicIdC("glyph-reorder-method", pubid); } void SgmlFOTBuilder::setHyphenationMethod(PublicId pubid) { publicIdC("hyphenation-method", pubid); } void SgmlFOTBuilder::setTableAutoWidthMethod(PublicId pubid) { publicIdC("table-auto-width-method", pubid); } void SgmlFOTBuilder::setFontName(PublicId pubid) { publicIdC("font-name", pubid); } void SgmlFOTBuilder::publicIdC(const char *s, PublicId pubid) { ics_ << ' ' << s << '=' << quot; if (pubid) ics_ << pubid; else ics_ << falseString; ics_ << quot; } void SgmlFOTBuilder::setBorderPresent(bool b) { boolC("border-present", b); } void SgmlFOTBuilder::setInhibitLineBreaks(bool b) { boolC("border-present", b); } void SgmlFOTBuilder::setHyphenate(bool b) { boolC("hyphenate", b); } void SgmlFOTBuilder::setKern(bool b) { boolC("kern", b); } void SgmlFOTBuilder::setLigature(bool b) { boolC("ligature", b); } void SgmlFOTBuilder::setScoreSpaces(bool b) { boolC("score-spaces", b); } void SgmlFOTBuilder::setFloatOutMarginalia(bool b) { boolC("float-out-marginalia", b); } void SgmlFOTBuilder::setFloatOutSidelines(bool b) { boolC("float-out-sidelines", b); } void SgmlFOTBuilder::setFloatOutLineNumbers(bool b) { boolC("float-out-line-numbers", b); } void SgmlFOTBuilder::setCellBackground(bool b) { boolC("cell-background", b); } void SgmlFOTBuilder::setSpanWeak(bool b) { boolC("span-weak", b); } void SgmlFOTBuilder::setIgnoreRecordEnd(bool b) { boolC("ignore-record-end", b); } void SgmlFOTBuilder::setNumberedLines(bool b) { boolC("numbered-lines", b); } void SgmlFOTBuilder::setHangingPunct(bool b) { boolC("hanging-punct", b); } void SgmlFOTBuilder::setBoxOpenEnd(bool b) { boolC("box-open-end", b); } void SgmlFOTBuilder::setTruncateLeader(bool b) { boolC("truncate-leader", b); } void SgmlFOTBuilder::setAlignLeader(bool b) { boolC("align-leader", b); } void SgmlFOTBuilder::setTablePartOmitMiddleHeader(bool b) { boolC("table-part-omit-middle-header", b); } void SgmlFOTBuilder::setTablePartOmitMiddleFooter(bool b) { boolC("table-part-omit-middle-footer", b); } void SgmlFOTBuilder::setBorderOmitAtBreak(bool b) { boolC("border-omit-at-break", b); } void SgmlFOTBuilder::setPrincipalModeSimultaneous(bool b) { boolC("principal-mode-simultaneous", b); } void SgmlFOTBuilder::setMarginaliaKeepWithPrevious(bool b) { boolC("marginalia-keep-with-previous", b); } void SgmlFOTBuilder::setGridEquidistantRows(bool b) { boolC("grid-equidistant-rows", b); } void SgmlFOTBuilder::setGridEquidistantColumns(bool b) { boolC("grid-equidistant-columns", b); } void SgmlFOTBuilder::boolC(const char *s, bool b) { ics_ << ' ' << s << '=' << quot << boolString(b) << quot; } void SgmlFOTBuilder::setEscapementSpaceBefore(const InlineSpace &is) { inlineSpaceC("escapement-space-before", is); } void SgmlFOTBuilder::setEscapementSpaceAfter(const InlineSpace &is) { inlineSpaceC("escapement-space-after", is); } void SgmlFOTBuilder::setInlineSpaceSpace(const OptInlineSpace &s) { optInlineSpaceC("inline-space-space", s); } void SgmlFOTBuilder::setCharMap(Symbol sym) { symbolC("char-map", sym); } void SgmlFOTBuilder::setGlyphSubstTable(const Vector > &tables) { if (tables.size() == 0) { ics_ << " glyph-subst-table=" << quot << quot; return; } static const char idPrefix[] = "gst"; ics_ << " glyph-subst-table=" << quot; for (size_t i = 0; i < tables.size(); i++) { unsigned long n = tables[i]->uniqueId; if (n >= glyphSubstTableDefined_.size()) { for (size_t j = glyphSubstTableDefined_.size(); j < n + 1; j++) glyphSubstTableDefined_.push_back(0); } if (!glyphSubstTableDefined_[n]) { glyphSubstTableDefined_[n] = 1; os() << "" << RE; os() << ""; } if (i > 0) ics_ << ' '; ics_ << idPrefix << n; } ics_ << quot; } void SgmlFOTBuilder::inlineSpaceC(const char *s, const InlineSpace &is) { if (is.nominal || is.min || is.max) { ics_ << ' ' << s << '=' << quot << is.nominal; if (is.min.length != is.nominal.length || is.min.displaySizeFactor != is.nominal.displaySizeFactor || is.max.length != is.nominal.length || is.max.displaySizeFactor != is.nominal.displaySizeFactor) ics_ << ',' << is.min << ',' << is.max; } } void SgmlFOTBuilder::optInlineSpaceC(const char *ch, const OptInlineSpace &ois) { if (ois.hasSpace) inlineSpaceC(ch, ois.space); else ics_ << ' ' << ch << "=" << quot << falseString << quot; } void SgmlFOTBuilder::displayNIC(const DisplayNIC &nic) { if (nic.keepWithPrevious) os() << " keep-with-previous=" << quot << trueString << quot; if (nic.keepWithNext) os() << " keep-with-next=" << quot << trueString << quot; if (nic.mayViolateKeepBefore) os() << " may-violate-keep-before=" << quot << trueString << quot; if (nic.mayViolateKeepAfter) os() << " may-violate-keep-after=" << quot << trueString << quot; if (nic.positionPreference != symbolFalse) os() << " position-preference=" << quot << nic.positionPreference << quot; if (nic.keep != symbolFalse) os() << " keep=" << quot << nic.keep << quot; if (nic.breakBefore != symbolFalse) os() << " break-before=" << quot << nic.breakBefore << quot; if (nic.breakAfter != symbolFalse) os() << " break-after=" << quot << nic.breakAfter << quot; displaySpaceNIC("space-before", nic.spaceBefore); displaySpaceNIC("space-after", nic.spaceAfter); } void SgmlFOTBuilder::displaySpaceNIC(const char *s, const DisplaySpace &ds) { if (ds.nominal || ds.min || ds.max) { os() << ' ' << s << '=' << quot << ds.nominal; if (ds.min.length != ds.nominal.length || ds.min.displaySizeFactor != ds.nominal.displaySizeFactor || ds.max.length != ds.nominal.length || ds.max.displaySizeFactor != ds.nominal.displaySizeFactor) os() << ',' << ds.min << ',' << ds.max; os() << quot; } if (ds.force) os() << ' ' << s << "-priority=" << quot << "force" << quot; else if (ds.priority) os() << ' ' << s << "-priority=" << quot << ds.priority << quot; if (!ds.conditional) os() << ' ' << s << "-conditional=" << quot << falseString << quot; } void SgmlFOTBuilder::inlineNIC(const InlineNIC &nic) { if (nic.breakBeforePriority) os() << " break-before-priority=" << quot << nic.breakBeforePriority << quot; if (nic.breakAfterPriority) os() << " break-after-priority=" << quot << nic.breakAfterPriority << quot; } void SgmlFOTBuilder::startParagraph(const ParagraphNIC &nic) { os() << "" << RE; } void SgmlFOTBuilder::endParagraph() { endFlow("paragraph"); } void SgmlFOTBuilder::paragraphBreak(const ParagraphNIC &nic) { os() << "" << RE; } void SgmlFOTBuilder::startDisplayGroup(const DisplayGroupNIC &nic) { os() << "" << RE; } void SgmlFOTBuilder::endDisplayGroup() { endFlow("display-group"); } void SgmlFOTBuilder::simpleFlowObj(const char *name) { os() << '<' << name; outputIcs(); os() << "/>" << RE; } void SgmlFOTBuilder::startSimpleFlowObj(const char *name) { os() << '<' << name; outputIcs(); os() << ">" << RE; } void SgmlFOTBuilder::startPortFlow(const char *name) { os() << "<" << name << ">" << RE; } void SgmlFOTBuilder::endFlow(const char *name) { os() << "" << RE; } void SgmlFOTBuilder::startSequence() { startSimpleFlowObj("sequence"); } void SgmlFOTBuilder::endSequence() { endFlow("sequence"); } void SgmlFOTBuilder::startLineField(const LineFieldNIC &) { flushPendingElements(); startSimpleFlowObj("line-field"); } void SgmlFOTBuilder::endLineField() { endFlow("line-field"); } void SgmlFOTBuilder::startScroll() { startSimpleFlowObj("scroll"); } void SgmlFOTBuilder::endScroll() { endFlow("scroll"); } void SgmlFOTBuilder::startLink(const Address &addr) { os() << "hasDesc) os() << " desc=" << quot << Data(principalMode->desc) << quot; os() << '>' << RE; } multiModeHasPrincipalMode_.push_back(principalMode != 0); } void SgmlFOTBuilder::endMultiModeSerial() { if (multiModeHasPrincipalMode_.back()) endFlow("multi-mode.mode"); multiModeHasPrincipalMode_.resize(multiModeHasPrincipalMode_.size() - 1); endFlow("multi-mode"); } void SgmlFOTBuilder::startMultiModeMode(const MultiMode &mode) { if (multiModeHasPrincipalMode_.back()) { endFlow("multi-mode.mode"); multiModeHasPrincipalMode_.back() = 0; } os() << "' << RE; } } } } } void SgmlFOTBuilder::pageNumber() { os() << "" << RE; } void SgmlFOTBuilder::startMathSequence() { startSimpleFlowObj("math-sequence"); } void SgmlFOTBuilder::endMathSequence() { endFlow("math-sequence"); } void SgmlFOTBuilder::startFractionSerial() { startSimpleFlowObj("fraction"); } void SgmlFOTBuilder::endFractionSerial() { endFlow("fraction"); } void SgmlFOTBuilder::startFractionNumerator() { startPortFlow("fraction.numerator"); } void SgmlFOTBuilder::endFractionNumerator() { endFlow("fraction.numerator"); } void SgmlFOTBuilder::startFractionDenominator() { startPortFlow("fraction.denominator"); } void SgmlFOTBuilder::endFractionDenominator() { endFlow("fraction.denominator"); } void SgmlFOTBuilder::fractionBar() { simpleFlowObj("fraction.fraction-bar"); } void SgmlFOTBuilder::startUnmath() { startSimpleFlowObj("unmath"); } void SgmlFOTBuilder::endUnmath() { endFlow("unmath"); } void SgmlFOTBuilder::startSuperscript() { startSimpleFlowObj("superscript"); } void SgmlFOTBuilder::endSuperscript() { endFlow("superscript"); } void SgmlFOTBuilder::startSubscript() { startSimpleFlowObj("subscript"); } void SgmlFOTBuilder::endSubscript() { endFlow("subscript"); } void SgmlFOTBuilder::startScriptSerial() { startSimpleFlowObj("script"); startPortFlow("script.principal"); } void SgmlFOTBuilder::endScriptSerial() { endFlow("script"); } void SgmlFOTBuilder::startScriptPreSup() { endFlow("script.principal"); startPortFlow("script.pre-sup"); } void SgmlFOTBuilder::endScriptPreSup() { endFlow("script.pre-sup"); } void SgmlFOTBuilder::startScriptPreSub() { startPortFlow("script.pre-sub"); } void SgmlFOTBuilder::endScriptPreSub() { endFlow("script.pre-sub"); } void SgmlFOTBuilder::startScriptPostSup() { startPortFlow("script.post-sup"); } void SgmlFOTBuilder::endScriptPostSup() { endFlow("script.post-sup"); } void SgmlFOTBuilder::startScriptPostSub() { startPortFlow("script.post-sub"); } void SgmlFOTBuilder::endScriptPostSub() { endFlow("script.post-sub"); } void SgmlFOTBuilder::startScriptMidSup() { startPortFlow("script.mid-sup"); } void SgmlFOTBuilder::endScriptMidSup() { endFlow("script.mid-sup"); } void SgmlFOTBuilder::startScriptMidSub() { startPortFlow("script.mid-sub"); } void SgmlFOTBuilder::endScriptMidSub() { endFlow("script.mid-sub"); } void SgmlFOTBuilder::startMarkSerial() { startSimpleFlowObj("mark"); startPortFlow("mark.principal"); } void SgmlFOTBuilder::endMarkSerial() { endFlow("mark"); } void SgmlFOTBuilder::startMarkOver() { endFlow("mark.principal"); startPortFlow("mark.over-mark"); } void SgmlFOTBuilder::endMarkOver() { endFlow("mark.over-mark"); } void SgmlFOTBuilder::startMarkUnder() { startPortFlow("mark.under-mark"); } void SgmlFOTBuilder::endMarkUnder() { endFlow("mark.under-mark"); } void SgmlFOTBuilder::startFenceSerial() { startSimpleFlowObj("fence"); startPortFlow("fence.principal"); } void SgmlFOTBuilder::endFenceSerial() { endFlow("fence"); } void SgmlFOTBuilder::startFenceOpen() { endFlow("fence.principal"); startPortFlow("fence.open"); } void SgmlFOTBuilder::endFenceOpen() { endFlow("fence.open"); } void SgmlFOTBuilder::startFenceClose() { startPortFlow("fence.close"); } void SgmlFOTBuilder::endFenceClose() { endFlow("fence.close"); } void SgmlFOTBuilder::startRadicalSerial() { startSimpleFlowObj("radical"); } void SgmlFOTBuilder::endRadicalSerial() { endFlow("radical"); } void SgmlFOTBuilder::startRadicalDegree() { endFlow("radical.principal"); startPortFlow("radical.degree"); } void SgmlFOTBuilder::endRadicalDegree() { endFlow("radical.degree"); } void SgmlFOTBuilder::radicalRadical(const CharacterNIC &nic) { os() << "" << RE; startPortFlow("radical.principal"); } void SgmlFOTBuilder::radicalRadicalDefaulted() { startPortFlow("radical.principal"); } void SgmlFOTBuilder::startMathOperatorSerial() { startSimpleFlowObj("math-operator"); startPortFlow("math-operator.principal"); } void SgmlFOTBuilder::endMathOperatorSerial() { endFlow("math-operator"); } void SgmlFOTBuilder::startMathOperatorOperator() { endFlow("math-operator.principal"); startPortFlow("math-operator.operator"); } void SgmlFOTBuilder::endMathOperatorOperator() { endFlow("math-operator.operator"); } void SgmlFOTBuilder::startMathOperatorLowerLimit() { startPortFlow("math-operator.lower-limit"); } void SgmlFOTBuilder::endMathOperatorLowerLimit() { endFlow("math-operator.lower-limit"); } void SgmlFOTBuilder::startMathOperatorUpperLimit() { startPortFlow("math-operator.upper-limit"); } void SgmlFOTBuilder::endMathOperatorUpperLimit() { endFlow("math-operator.upper-limit"); } void SgmlFOTBuilder::startGrid(const GridNIC &nic) { os() << "" << RE; } void SgmlFOTBuilder::rule(const RuleNIC &nic) { flushPendingElements(); const char *s = symbolName(nic.orientation); if (!s) return; os() << "" << RE; } void SgmlFOTBuilder::startLeader(const LeaderNIC &nic) { flushPendingElements(); os() << "' << RE; } void SgmlFOTBuilder::endSideBySide() { endFlow("side-by-side"); } void SgmlFOTBuilder::startSideBySideItem() { os() << "' << RE; } void SgmlFOTBuilder::endSideBySideItem() { endFlow("side-by-side-item"); } void SgmlFOTBuilder::alignmentPoint() { simpleFlowObj("alignment-point"); } void SgmlFOTBuilder::startTable(const TableNIC &nic) { flushPendingElements(); os() << "" << RE; } void SgmlFOTBuilder::startTablePartSerial(const TablePartNIC &nic) { os() << "' << RE; startPortFlow("table-part.principal"); } void SgmlFOTBuilder::endTablePartSerial() { endFlow("table-part"); } void SgmlFOTBuilder::startTablePartHeader() { endFlow("table-part.principal"); os() << "" << RE; } void SgmlFOTBuilder::endTablePartHeader() { endFlow("table-part.header"); } void SgmlFOTBuilder::startTablePartFooter() { os() << "" << RE; } void SgmlFOTBuilder::endTablePartFooter() { endFlow("table-part.footer"); } void SgmlFOTBuilder::startTableRow() { startSimpleFlowObj("table-row"); } void SgmlFOTBuilder::endTableRow() { endFlow("table-row"); } void SgmlFOTBuilder::startTableCell(const TableCellNIC &nic) { if (nic.missing) os() << " 0 && pendingElementLevels_.back() == nodeLevel_ && nPendingElementsNonEmpty_ < pendingElements_.size()) { pendingElementLevels_.resize(pendingElements_.size() - 1); pendingElements_.resize(pendingElements_.size() - 1); } nodeLevel_--; } void SgmlFOTBuilder::currentNodePageNumber(const NodePtr &node) { if (!nodeIsElement(node)) return; os() << "" << RE; } void SgmlFOTBuilder::outputElementName(unsigned long groveIndex, const Char *idData, size_t idSize) { if (groveIndex) os() << groveIndex << '.'; os() << Data(idData, idSize); } void SgmlFOTBuilder::outputElementName(const NodePtr &node) { GroveString id; if (node->getId(id) == accessOK) outputElementName(node->groveIndex(), id.data(), id.size()); else { unsigned long n; n = node->groveIndex(); if (n) os() << n << '.'; if (node->elementIndex(n) == accessOK) os() << n; } } void SgmlFOTBuilder::flushPendingElements() { if (suppressAnchors_) return; for (size_t i = 0; i < pendingElements_.size(); i++) { const NodePtr &node = pendingElements_[i]; os() << "" << RE; } nPendingElementsNonEmpty_ = 0; pendingElements_.resize(0); pendingElementLevels_.resize(0); } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/jade/RtfFOTBuilder.cxx0000644000021000000240000035361707063210272013603 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #include "RtfFOTBuilder.h" #include "TmpOutputByteStream.h" #include "RtfMessages.h" #include #include #include #include #include #include #include #include #include #ifdef WIN32 #include "RtfOle.h" #endif #include #include "dsssl_ns.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class NullOutputByteStream : public OutputByteStream { public: NullOutputByteStream() { ptr_ = end_ = 0; } void flush() { } void flushBuf(char) { } }; class ElementSet { public: ElementSet(); void add(unsigned long, unsigned long); bool contains(unsigned long, unsigned long) const; private: Vector > v_; }; class RtfFOTBuilder : public SerialFOTBuilder { public: RtfFOTBuilder(OutputByteStream *, const Vector &, const Ptr &, const CharsetInfo &, Messenger *); ~RtfFOTBuilder(); void characters(const Char *, size_t); void paragraphBreak(const ParagraphNIC &); void externalGraphic(const ExternalGraphicNIC &); void rule(const RuleNIC &); void setFontSize(long n); void setFontFamilyName(const StringC &); void setFontWeight(Symbol); void setFontPosture(Symbol); void setGlyphSubstTable(const Vector > &); void setPositionPointShift(const LengthSpec &); void setLanguage(Letter2); void setCountry(Letter2); void setStartIndent(const LengthSpec &); void setEndIndent(const LengthSpec &); void setFirstLineStartIndent(const LengthSpec &); void setLineSpacing(const LengthSpec &); void setMinLeading(const OptLengthSpec &); void setFieldWidth(const LengthSpec &); void setLines(Symbol); void setInputWhitespaceTreatment(Symbol); void setExpandTabs(long); void setQuadding(Symbol); void setDisplayAlignment(Symbol); void setFieldAlign(Symbol); void setHyphenate(bool); void setKern(bool); void setHyphenationLadderCount(long); void setWidowCount(long); void setOrphanCount(long); void setHeadingLevel(long); void setColor(const DeviceRGBColor &); void setBackgroundColor(const DeviceRGBColor &); void setBackgroundColor(); void setLineThickness(Length); void setLineRepeat(long); void setScoreSpaces(bool); void setBoxType(Symbol); void setBorderPresent(bool); void setBorderPriority(long); void setBorderOmitAtBreak(bool); void setPageWidth(long units); void setPageHeight(long units); void setLeftMargin(long units); void setRightMargin(long units); void setTopMargin(long units); void setBottomMargin(long units); void setHeaderMargin(long units); void setFooterMargin(long units); void setPageNumberRestart(bool); void setPageNumberFormat(const StringC &); void setPageNColumns(long); void setPageColumnSep(Length); void setPageBalanceColumns(bool); void setSpan(long); enum { nHF = FOTBuilder::nHF }; void startSimplePageSequenceSerial(); void endSimplePageSequenceSerial(); void startSimplePageSequenceHeaderFooter(unsigned); void endSimplePageSequenceHeaderFooter(unsigned); void endAllSimplePageSequenceHeaderFooter(); void pageNumber(); void startLink(const Address &); void endLink(); void startScore(Symbol); void startBox(const BoxNIC &); void endBox(); void startParagraph(const ParagraphNIC &); void endParagraph(); void startDisplayGroup(const DisplayGroupNIC &); void endDisplayGroup(); void startLineField(const LineFieldNIC &); void endLineField(); void startLeader(const LeaderNIC &); void endLeader(); void startTable(const TableNIC &); void endTable(); void startTablePartSerial(const TablePartNIC &); void endTablePartSerial(); void startTablePartHeader(); void endTablePartHeader(); void startTablePartFooter(); void endTablePartFooter(); void tableColumn(const TableColumnNIC &); void startTableRow(); void endTableRow(); void startTableCell(const TableCellNIC &); void endTableCell(); void tableBeforeRowBorder(); void tableAfterRowBorder(); void tableBeforeColumnBorder(); void tableAfterColumnBorder(); void tableCellBeforeRowBorder(); void tableCellAfterRowBorder(); void tableCellBeforeColumnBorder(); void tableCellAfterColumnBorder(); void setCellBeforeRowMargin(Length); void setCellAfterRowMargin(Length); void setCellBeforeColumnMargin(Length); void setCellAfterColumnMargin(Length); void setCellBackground(bool); void setCellRowAlignment(Symbol); // math void startMathSequence(); void endMathSequence(); void startFractionSerial(); void endFractionSerial(); void startFractionNumerator(); void endFractionNumerator(); void startFractionDenominator(); void endFractionDenominator(); void startSubscript(); void endSubscript(); void startSuperscript(); void endSuperscript(); void startRadicalSerial(); void endRadicalSerial(); void startRadicalDegree(); void endRadicalDegree(); void startFenceSerial(); void endFenceSerial(); void startFenceOpen(); void endFenceOpen(); void startFenceClose(); void endFenceClose(); void startMathOperatorSerial(); void endMathOperatorSerial(); void startMathOperatorOperator(); void endMathOperatorOperator(); void startMathOperatorLowerLimit(); void endMathOperatorLowerLimit(); void startMathOperatorUpperLimit(); void endMathOperatorUpperLimit(); void startMarkSerial(); void endMarkSerial(); void startMarkOver(); void endMarkOver(); void startMarkUnder(); void endMarkUnder(); void startScriptSerial(); void endScriptSerial(); void startScriptPreSup(); void startScriptPreSub(); void startScriptPostSup(); void startScriptPostSub(); void startScriptMidSup(); void startScriptMidSub(); void startGrid(const GridNIC &); void endGrid(); void startGridCell(const GridCellNIC &); void endGridCell(); void setMathDisplayMode(Symbol); void setGridPositionCellType(Symbol); void setGridColumnAlignment(Symbol); void setGridRowSep(Length); void setGridColumnSep(Length); void setSubscriptDepth(Length); void setSuperscriptHeight(Length); void setUnderMarkDepth(Length); void setOverMarkHeight(Length); void startNode(const NodePtr &, const StringC &); void endNode(); void currentNodePageNumber(const NodePtr &); struct WinCharset { unsigned char charsetCode; const char *fontSuffix; Char mapping[128]; }; enum { jisCharset = 5, nWinCharsets = 7 }; static const WinCharset winCharsets[nWinCharsets]; struct SymbolFont { const char *name; Char mapping[256]; }; enum { nSymbolFonts = 3 }; static const SymbolFont symbolFonts[nSymbolFonts]; enum { topBorder, bottomBorder, leftBorder, rightBorder }; struct Border { Border() : priority(0), flags(0) { } long priority; enum { isPresent = 01, isDouble = 02, omitAtBreak = 04 }; unsigned char flags; unsigned char thickness; unsigned short color; }; enum BreakType { breakNone, breakPage, breakColumn }; private: OutputByteStream &os() { return *osp_; } void start(); void end(); void atomic(); void syncCharFormat(); void setCharset(int); void inlinePrepare(); void flushPendingElements(); void doStartLink(const Address &); void flushFields() { if (!suppressBookmarks_) flushPendingElements(); if (havePendingLink_) { havePendingLink_ = 0; doStartLink(pendingLink_); } } void startDisplay(const DisplayNIC &); void endDisplay(); void newPar(bool allowSpaceBefore = 1); bool includePicture(const ExternalGraphicNIC &); bool embedObject(const ExternalGraphicNIC &); bool systemIdNotation(const StringC &systemId, const char *, StringC &); bool systemIdFilename(const StringC &systemId, StringC &filename); int systemIdFilename1(const StringC &systemId, StringC &filename); int makeColor(const DeviceRGBColor &); void outputBookmarkName(unsigned long groveIndex, const Char *, size_t); void outputBookmarkName(unsigned long groveIndex, unsigned long elementIndex); static unsigned convertLanguage(unsigned language, unsigned country, unsigned &langCharsets); void idrefButton(unsigned long groveIndex, const Char *s, size_t n); void outputTable(); void storeBorder(Border &); void resolveBorder(Border &, Border &); void resolveOutsideBorder(Border &, const Border &); void outputTableBorder(const Border &); void outputHeaderFooter(const char *suffix, unsigned flags); long computeLengthSpec(const LengthSpec &); void displaySizeChanged(); void symbolChar(int ff, unsigned code); void initJIS(); void enterMathMode(); void exitMathMode(); static int points(Length n) { if (n >= 0) return (n + 10)/20; else return (n - 10)/20; } enum InlineState { inlineFirst, // never had an inline FO inlineStart, // must emit \par before next inline FO inlineField, // in a line field inlineFieldEnd, // in a line field with align=end inlineMiddle, // had some inline FOs inlineTable // just after \row }; InlineState inlineState_; bool continuePar_; enum UnderlineType { noUnderline, underlineSingle, underlineDouble, underlineWords }; // What the RTF reader thinks the format is. struct CommonFormat { CommonFormat(); bool isBold; bool isItalic; bool isSmallCaps; // UnderlineType char underline; bool isStrikethrough; int fontFamily; int fontSize; int color; int charBackgroundColor; int positionPointShift; unsigned language; unsigned country; bool kern; bool charBorder; int charBorderColor; long charBorderThickness; bool charBorderDouble; }; struct OutputFormat : CommonFormat { OutputFormat(); int charset; unsigned lang; // the RTF language code // bitmap of charsets that can be used for the lang unsigned langCharsets; }; enum { widowControl = 01, orphanControl = 02 }; struct ParaFormat { ParaFormat(); int leftIndent; int rightIndent; int firstLineIndent; int lineSpacing; bool lineSpacingAtLeast; char quadding; // 'l', 'c', 'r', 'j' Symbol lines; char widowOrphanControl; char headingLevel; }; enum { gridPosRowMajor, gridPosColumnMajor, gridPosExplicit }; struct Format : ParaFormat, CommonFormat { Format(); bool hyphenate; int fieldWidth; Symbol fieldAlign; Symbol inputWhitespaceTreatment; long expandTabs; char displayAlignment; // 'l', 'c', 'r' long lineThickness; bool lineDouble; bool scoreSpaces; bool boxHasBorder; bool boxHasBackground; int backgroundColor; // 0 for none bool borderPresent; bool borderOmitAtBreak; bool cellBackground; long borderPriority; long cellTopMargin; long cellBottomMargin; long cellLeftMargin; long cellRightMargin; char cellVerticalAlignment; char gridPosType; char gridColumnAlignment; bool mathInline; bool mathPosture; int superscriptHeight; // in points int subscriptDepth; // in points int overMarkHeight; // in points int underMarkDepth; // in points int gridRowSep; // in points int gridColumnSep; // in points bool span; // These are needed for handling LengthSpecs LengthSpec positionPointShiftSpec; LengthSpec leftIndentSpec; LengthSpec rightIndentSpec; LengthSpec firstLineIndentSpec; LengthSpec lineSpacingSpec; LengthSpec fieldWidthSpec; }; struct PageFormat { PageFormat(); long pageWidth; long pageHeight; long leftMargin; long rightMargin; long headerMargin; long footerMargin; long topMargin; long bottomMargin; bool pageNumberRestart; const char *pageNumberFormat; long nColumns; long columnSep; bool balance; }; // This is for a nested displayed flow object struct DisplayInfo { int spaceAfter; bool keepWithNext; bool saveKeep; BreakType breakAfter; }; OutputFormat outputFormat_; Format specFormat_; ParaFormat paraFormat_; Vector paraStack_; Vector displayStack_; Vector specFormatStack_; Vector pendingElements_; Vector pendingElementLevels_; unsigned nPendingElementsNonEmpty_; bool suppressBookmarks_; unsigned nodeLevel_; Vector displayBoxLevels_; bool boxFirstPara_; // not yet had a paragraph in the outermost displayed box long boxLeftSep_; long boxRightSep_; long boxTopSep_; long accumSpaceBox_; HashTable fontFamilyNameTable_; struct FontFamilyCharsets { FontFamilyCharsets(); int rtfFontNumber[nWinCharsets]; }; Vector fontFamilyCharsetsTable_; int nextRtfFontNumber_; int accumSpace_; bool keepWithNext_; bool hyphenateSuppressed_; long maxConsecHyphens_; OutputByteStream *osp_; OutputByteStream *finalos_; TmpOutputByteStream tempos_; StrOutputByteStream cellos_; long tableWidth_; char tableAlignment_; long tableDisplaySize_; int tableLeftIndent_; int tableRightIndent_; long addLeftIndent_; long addRightIndent_; Border tableBorder_[4]; unsigned cellIndex_; struct Cell { Cell() : present(0), hasBackground(0), span(1), vspan(1), valign('t') { } bool present; bool hasBackground; unsigned short backgroundColor; char valign; String content; unsigned span; unsigned vspan; Border border[4]; }; struct Column { Column() : hasWidth(0) { } bool hasWidth; TableLengthSpec width; }; Vector > cells_; bool inTableHeader_; unsigned nHeaderRows_; Vector columns_; unsigned tableLevel_; StrOutputByteStream fieldos_; int fieldTabPos_; long displaySize_; bool hadSection_; bool doBalance_; unsigned spanDisplayLevels_; unsigned currentCols_; BreakType doBreak_; bool keep_; bool hadParInKeep_; unsigned linkDepth_; unsigned inSimplePageSequence_; PageFormat pageFormat_; Vector pageFormatStack_; OutputFormat saveOutputFormat_; OutputFormat leaderSaveOutputFormat_; Vector colorTable_; Ptr entityManager_; Messenger *mgr_; const CharsetInfo *systemCharset_; bool followWhitespaceChar_; unsigned currentColumn_; ElementSet elementsRefed_; // Leaders unsigned leaderDepth_; NullOutputByteStream nullos_; OutputByteStream *preLeaderOsp_; enum { CHAR_TABLE_CHAR_BITS = 16 }; enum { CHAR_TABLE_SYMBOL_FLAG = 1U << 31, CHAR_TABLE_DB_FLAG = 1U << 30 }; CharMap charTable_; String hfPart_[nHF]; StrOutputByteStream hfos_; enum RTFVersion { word95, word97 }; RTFVersion rtfVersion_; Address pendingLink_; bool havePendingLink_; // Charaction for separating arguments in an EQ field; must be ',' or ';' char eqArgSep_; unsigned mathLevel_; enum MathSpecial { mathNormal, mathFence, mathIntegral }; MathSpecial mathSpecial_; OutputFormat mathSaveOutputFormat_; struct ReorderFlowObject; friend struct ReorderFlowObject; struct ReorderFlowObject : public Link { OutputByteStream *saveOsp; StrOutputByteStream buf; OutputFormat saveOutputFormat; Vector > streams; }; struct Grid; friend struct Grid; struct Grid : public Link { OutputByteStream *saveOsp; StrOutputByteStream buf; OutputFormat saveOutputFormat; size_t nRows; size_t nColumns; char posType; String *curCellPtr; Vector > > cells; }; IList reorderStack_; IList gridStack_; #ifdef WIN32 Vector oleObject_; #endif void startReorderFlowObject(); void endReorderFlowObjectPort(); void endReorderFlowObject(); friend struct OutputFormat; friend struct Format; friend struct CommonFormat; friend struct ParaFormat; }; inline long RtfFOTBuilder::computeLengthSpec(const LengthSpec &spec) { if (spec.displaySizeFactor == 0.0) return spec.length; else { double tem = displaySize_ * spec.displaySizeFactor; return spec.length + long(tem >= 0.0 ? tem +.5 : tem - .5); } } // Use a line-spacing of 12pt for the header and footer // and assume 2.5pt of it occur after the baseline. const int hfPreSpace = 190; const int hfPostSpace = 50; const char INSERTION_CHAR = '\0'; const int SYMBOL_FONT_PAGE = 0xf000; const unsigned DEFAULT_LANG = 0x400; inline int halfPoints(long n) { return n/10; } TmpOutputByteStream::TmpOutputByteStream() : head_(0), last_(0), nFullBlocks_(0) { } TmpOutputByteStream::~TmpOutputByteStream() { while (head_) { Block *tem = head_; head_ = head_->next; delete tem; } } void TmpOutputByteStream::flushBuf(char ch) { Block *tem = new Block; char *p = tem->buf; *p++ = ch; ptr_ = p; end_ = tem->buf + bufSize; tem->next = 0; if (last_) { nFullBlocks_++; last_->next = tem; } else head_ = tem; last_ = tem; } void TmpOutputByteStream::flush() { } FOTBuilder *makeRtfFOTBuilder(OutputByteStream *os, const Vector &options, const Ptr &entityManager, const CharsetInfo &systemCharset, Messenger *mgr, const FOTBuilder::Description *&descr) { static const FOTBuilder::Extension extensions[] = { { "UNREGISTERED::James Clark//Characteristic::page-number-format", 0, (void (FOTBuilder::*)(const StringC &))&RtfFOTBuilder::setPageNumberFormat, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-number-restart?", (void (FOTBuilder::*)(bool))&RtfFOTBuilder::setPageNumberRestart, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-n-columns", 0, 0, (void (FOTBuilder::*)(long))&RtfFOTBuilder::setPageNColumns, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-column-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setPageColumnSep, }, { "UNREGISTERED::James Clark//Characteristic::page-balance-columns?", (void (FOTBuilder::*)(bool))&RtfFOTBuilder::setPageBalanceColumns, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::subscript-depth", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setSubscriptDepth, }, { "UNREGISTERED::James Clark//Characteristic::over-mark-height", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setOverMarkHeight, }, { "UNREGISTERED::James Clark//Characteristic::under-mark-depth", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setUnderMarkDepth, }, { "UNREGISTERED::James Clark//Characteristic::superscript-height", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setSuperscriptHeight, }, { "UNREGISTERED::James Clark//Characteristic::grid-row-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setGridRowSep, }, { "UNREGISTERED::James Clark//Characteristic::grid-column-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&RtfFOTBuilder::setGridColumnSep, }, { "UNREGISTERED::James Clark//Characteristic::heading-level", 0, 0, (void (FOTBuilder::*)(long))&RtfFOTBuilder::setHeadingLevel, 0 }, { 0, 0, 0} }; static const FOTBuilder::Feature features[] = { { "table", 0}, { "math", 1}, { "simple-page", 0}, { "online", 1}, { 0, 0} }; static const char *media[] = { "print", 0 }; static const FOTBuilder::Description description = { extensions, features, false, media }; descr = &description; return new RtfFOTBuilder(os, options, entityManager, systemCharset, mgr); } RtfFOTBuilder::RtfFOTBuilder(OutputByteStream *os, const Vector &options, const Ptr &entityManager, const CharsetInfo &systemCharset, Messenger *mgr) : finalos_(os), entityManager_(entityManager), systemCharset_(&systemCharset), mgr_(mgr), inlineState_(inlineFirst), continuePar_(0), osp_(&tempos_), accumSpace_(0), keepWithNext_(0), hadSection_(0), linkDepth_(0), tableLevel_(0), nodeLevel_(0), nPendingElementsNonEmpty_(0), suppressBookmarks_(0), followWhitespaceChar_(0), currentColumn_(0), boxFirstPara_(0), leaderDepth_(0), fontFamilyCharsetsTable_(1 + nSymbolFonts), nextRtfFontNumber_(1), inTableHeader_(0), nHeaderRows_(0), displaySize_(72*10*17), addLeftIndent_(0), addRightIndent_(0), inSimplePageSequence_(0), doBalance_(0), spanDisplayLevels_(0), currentCols_(1), hyphenateSuppressed_(0), maxConsecHyphens_(0), doBreak_(breakNone), keep_(0), hadParInKeep_(0), charTable_(0), rtfVersion_(word97), havePendingLink_(0), eqArgSep_(','), mathLevel_(0), mathSpecial_(mathNormal) { specFormat_.fontSize = 20; // 10 points specFormatStack_.push_back(specFormat_); pageFormatStack_.push_back(pageFormat_); StringC times; for (const char *s = "Times New Roman"; *s; s++) times += *s; fontFamilyNameTable_.insert(times, 0); fontFamilyCharsetsTable_[0].rtfFontNumber[0] = 0; for (int i = 0; i < nWinCharsets; i++) { for (int j = 0; j < 128; j++) { Char c = winCharsets[i].mapping[j]; if (c) { if (!charTable_[c]) charTable_.setChar(c, (j + 0x80) | (1 << (i + CHAR_TABLE_CHAR_BITS))); else if ((charTable_[c] & ((1 << CHAR_TABLE_CHAR_BITS) - 1)) == (j + 0x80)) charTable_.setChar(c, charTable_[c] | (1 << (i + CHAR_TABLE_CHAR_BITS))); } } } for (int i = 0; i < nSymbolFonts; i++) { for (int j = 0; j < 256; j++) { Char c = symbolFonts[i].mapping[j]; if (c && !charTable_[c]) charTable_.setChar(c, j | (i << CHAR_TABLE_CHAR_BITS) | CHAR_TABLE_SYMBOL_FLAG); } StringC tem; for (const char *s = symbolFonts[i].name; *s; s++) tem += *s; fontFamilyNameTable_.insert(tem, i + 1); } // We want characters like right arrow to come from the symbol font, not using // charset 128. initJIS(); for (size_t i = 0; i < options.size(); i++) { if (options[i] == systemCharset.execToDesc("95")) rtfVersion_ = word95; } } void RtfFOTBuilder::initJIS() { WideChar min, max; UnivChar univ; Owner jis(CharsetRegistry::makeIter(CharsetRegistry::JIS0208)); while (jis->next(min, max, univ)) { do { if (!charTable_[univ]) { unsigned char c1 = min >> 8; unsigned char c2 = min & 0x7f; unsigned char out1; if (c1 < 33) out1 = 0; else if (c1 < 95) out1 = ((c1 + 1) >> 1) + 112; else if (c1 < 127) out1 = ((c1 + 1) >> 1) + 176; else out1 = 0; if (out1) { unsigned char out2; if (c1 & 1) { if (c2 < 33) out2 = 0; else if (c2 <= 95) out2 = c2 + 31; else if (c2 <= 126) out2 = c2 + 32; else out2 = 0; } else { if (33 <= c2 && c2 <= 126) out2 = c2 + 126; else out2 = 0; } if (out2) charTable_.setChar(univ, (out1 << 8) | out2 | (1 << (jisCharset + CHAR_TABLE_CHAR_BITS)) | CHAR_TABLE_DB_FLAG); } } univ++; } while (min++ != max); } } inline void outputWord(OutputByteStream &os, unsigned long n) { os << char((n >> 24) & 0xff) << char((n >> 16) & 0xff) << char((n >> 8) & 0xff) << char(n & 0xff); } inline unsigned long readWord(const char *&s, size_t &n, TmpOutputByteStream::Iter &sbIter) { unsigned long result = 0; for (int i = 0; i < 4; i++, n--) { if (n == 0) { bool gotSome = sbIter.next(s, n); ASSERT(gotSome); } result = (result << 8) | (unsigned char)*s++; } return result; } RtfFOTBuilder::~RtfFOTBuilder() { if (doBalance_) { os() << "\\sect\\sbknone\\par"; doBalance_ = 0; } os() << "}\n"; os().flush(); osp_ = finalos_; os() << "{\\rtf1\\ansi\\deff0\n"; os() << "{\\fonttbl"; HashTableIter iter(fontFamilyNameTable_); for (;;) { const StringC *key; const int *ip; if (!iter.next(key, ip)) break; const int *charsets = fontFamilyCharsetsTable_[*ip].rtfFontNumber; for (int i = 0; i < nWinCharsets; i++) { if (charsets[i] >= 0) { os() << "{\\f" << charsets[i] << "\\fnil\\fcharset" << int(winCharsets[i].charsetCode) << ' '; for (size_t j = 0; j < key->size(); j++) os() << (char)(*key)[j]; os() << winCharsets[i].fontSuffix; os() << ";}\n"; } } } os() << "}\n"; os() << "{\\colortbl;"; for (size_t i = 0; i < colorTable_.size(); i++) { unsigned n = colorTable_[i]; os() << "\\red" << (n >> 16) << "\\green" << ((n >> 8) & 0xff) << "\\blue" << (n & 0xff) << ';'; } os() << "}{\\stylesheet"; os() << "{\\s0 \"Normal;}"; for (int i = 1; i <= 9; i++) os() << "{\\s" << i << " Heading " << i << ";}"; os() << "}\n"; if (maxConsecHyphens_ > 0) os() << "\\hyphconsec" << maxConsecHyphens_; os() << "\\deflang" << DEFAULT_LANG << "\\notabind\\facingp\\hyphauto1\\widowctrl\n"; TmpOutputByteStream::Iter sbIter(tempos_); const char *s; size_t n; while (sbIter.next(s, n)) { while (n > 0) { const char *p = (char *)memchr(s, INSERTION_CHAR, n); if (!p) { os().sputn(s, n); break; } os().sputn(s, p - s); n -= (p - s); s = p; --n; s++; if (n == 0) { bool gotSome = sbIter.next(s, n); ASSERT(gotSome); } char kind = *s++; n--; switch (kind) { case 'b': { unsigned long grovei = readWord(s, n, sbIter); unsigned long ei = readWord(s, n, sbIter); if (elementsRefed_.contains(grovei, ei)) { os() << "{\\*\\bkmkstart "; outputBookmarkName(grovei, ei); os() << '}'; os() << "{\\*\\bkmkend "; outputBookmarkName(grovei, ei); os() << '}'; } break; } #ifdef WIN32 case 'o': { unsigned long oi = readWord(s, n, sbIter); StringC filename(oleObject_[oi]); filename += 0; StringC clsid(oleObject_[oi + 1]); clsid += 0; if (!outputObject(filename.data(), clsid.data(), os())) mgr_->message(RtfMessages::cannotEmbedFilename, StringMessageArg(oleObject_[oi]), StringMessageArg(oleObject_[oi + 1])); break; } #endif /* WIN32 */ default: CANNOT_HAPPEN(); } } } } void RtfFOTBuilder::syncCharFormat() { bool changed = 0; if (outputFormat_.isBold != specFormat_.isBold) { os() << "\\b"; if (!specFormat_.isBold) os() << '0'; outputFormat_.isBold = specFormat_.isBold; changed = 1; } if (outputFormat_.isItalic != specFormat_.isItalic) { os() << "\\i"; if (!specFormat_.isItalic) os() << '0'; outputFormat_.isItalic = specFormat_.isItalic; changed = 1; } if (outputFormat_.underline != specFormat_.underline) { switch (specFormat_.underline) { case noUnderline: os() << "\\ul0"; break; case underlineSingle: os() << "\\ul"; break; case underlineDouble: os() << "\\uldb"; break; case underlineWords: os() << "\\ulw"; break; } outputFormat_.underline = specFormat_.underline; changed = 1; } if (outputFormat_.isSmallCaps != specFormat_.isSmallCaps) { os() << "\\scaps"; if (!specFormat_.isSmallCaps) os() << '0'; outputFormat_.isSmallCaps = specFormat_.isSmallCaps; changed = 1; } if (outputFormat_.isStrikethrough != specFormat_.isStrikethrough) { os() << "\\strike"; if (!specFormat_.isStrikethrough) os() << '0'; outputFormat_.isStrikethrough = specFormat_.isStrikethrough; changed = 1; } if (outputFormat_.positionPointShift != specFormat_.positionPointShift) { if (specFormat_.positionPointShift >= 0) os() << "\\up" << specFormat_.positionPointShift; else os() << "\\dn" << -specFormat_.positionPointShift; outputFormat_.positionPointShift = specFormat_.positionPointShift; changed = 1; } if (outputFormat_.fontSize != specFormat_.fontSize) { os() << "\\fs" << specFormat_.fontSize; outputFormat_.fontSize = specFormat_.fontSize; changed = 1; } if (outputFormat_.country != specFormat_.country || outputFormat_.language != specFormat_.language) { outputFormat_.country = specFormat_.country; outputFormat_.language = specFormat_.language; unsigned lang = convertLanguage(outputFormat_.language, outputFormat_.country, outputFormat_.langCharsets); if (lang != outputFormat_.lang) { outputFormat_.lang = lang; os() << "\\lang" << lang; changed = 1; } } bool charsetOk = ((1 << outputFormat_.charset) & outputFormat_.langCharsets); if (outputFormat_.fontFamily != specFormat_.fontFamily || !charsetOk) { outputFormat_.fontFamily = specFormat_.fontFamily; // Make sure the charset is compatible with the language if (!charsetOk) { for (outputFormat_.charset = 0; !(outputFormat_.langCharsets & (1 << outputFormat_.charset)); outputFormat_.charset++) ; } int &n = fontFamilyCharsetsTable_[outputFormat_.fontFamily].rtfFontNumber[outputFormat_.charset]; if (n < 0) n = nextRtfFontNumber_++; os() << "\\f" << n; changed = 1; } if (outputFormat_.color != specFormat_.color) { os() << "\\cf" << specFormat_.color; outputFormat_.color = specFormat_.color; changed = 1; } if (outputFormat_.charBackgroundColor != specFormat_.charBackgroundColor) { os() << "\\highlight" << specFormat_.charBackgroundColor; outputFormat_.charBackgroundColor = specFormat_.charBackgroundColor; changed = 1; } if (specFormat_.charBorder) { if (!outputFormat_.charBorder || specFormat_.charBorderColor != outputFormat_.charBorderColor || specFormat_.charBorderThickness != outputFormat_.charBorderThickness || specFormat_.charBorderDouble != outputFormat_.charBorderDouble) { outputFormat_.charBorder = 1; os() << "\\chbrdr"; if (specFormat_.charBorderDouble) os() << "\\brdrdb"; else os() << "\\brdrs"; os() << "\\brdrw" << specFormat_.charBorderThickness; if (specFormat_.charBorderColor) os() << "\\brdrcf" << specFormat_.charBorderColor; changed = 1; outputFormat_.charBorderColor = specFormat_.charBorderColor; outputFormat_.charBorderThickness = specFormat_.charBorderThickness; outputFormat_.charBorderDouble = specFormat_.charBorderDouble; } } else { if (outputFormat_.charBorder) { os() << "\\chbrdr"; changed = 1; outputFormat_.charBorder = 0; } } if (!specFormat_.hyphenate) hyphenateSuppressed_ = 1; if (outputFormat_.kern != specFormat_.kern) { os() << "\\kerning" << (specFormat_.kern ? '1' : '0'); outputFormat_.kern = specFormat_.kern; changed = 1; } if (changed) os() << ' '; } void RtfFOTBuilder::setCharset(int cs) { outputFormat_.charset = cs; int &n = fontFamilyCharsetsTable_[outputFormat_.fontFamily].rtfFontNumber[cs]; if (n < 0) n = nextRtfFontNumber_++; os() << "\\f" << n; } inline void hexChar(OutputByteStream &os, unsigned code) { static const char hex[] = "0123456789abcdef"; os << "\\'" << hex[(code >> 4) & 0xf] << hex[code & 0xf]; } void RtfFOTBuilder::symbolChar(int ff, unsigned code) { #if 0 os() << "{\\field{\\*\\fldinst SYMBOL " << (unsigned long)code << " \\\\f \"" << symbolFonts[ff - 1].name << "\"}{\\fldrslt "; #endif int &n = fontFamilyCharsetsTable_[ff].rtfFontNumber[nWinCharsets - 1]; if (n < 0) n = nextRtfFontNumber_++; os() << "{\\f" << n; hexChar(os(), code); os() << "}"; #if 0 os() << "}}"; #endif } void RtfFOTBuilder::characters(const Char *s, size_t n) { // Ignore record ends at the start of continuation paragraphs. if (continuePar_ && (inlineState_ == inlineStart || inlineState_ == inlineFirst) && paraFormat_.lines == symbolWrap) { for (; n > 0 && *s == '\r'; s++, n--) ; if (n == 0) return; } // This avoids clearing followWhitespaceChar_. if (inlineState_ != inlineMiddle) inlinePrepare(); else flushFields(); syncCharFormat(); if (mathLevel_ && mathSpecial_ == mathIntegral && n > 0) { switch (*s) { case 0x222b: // integral return; case 0x2211: // sum os() << "\\\\su"; return; case 0x220f: // product os() << "\\\\pr"; return; default: os() << "\\\\vc\\\\"; break; } } for (; n > 0; s++, n--) { bool prevWhitespaceChar = followWhitespaceChar_; followWhitespaceChar_ = 0; currentColumn_++; switch (*s) { case '\n': currentColumn_--; followWhitespaceChar_ = prevWhitespaceChar; break; case '\r': followWhitespaceChar_ = 1; switch (paraFormat_.lines) { case symbolNone: // FIXME case symbolWrap: switch (specFormat_.inputWhitespaceTreatment) { case symbolIgnore: currentColumn_--; break; case symbolCollapse: if (prevWhitespaceChar) { currentColumn_--; break; } // fall through default: os() << ' '; } break; default: os() << "\\sa0\\par\\fi0\\sb0\n"; currentColumn_ = 0; break; } break; case '\t': if (specFormat_.expandTabs && specFormat_.inputWhitespaceTreatment == symbolPreserve) { unsigned col = --currentColumn_ + specFormat_.expandTabs; col = (col / specFormat_.expandTabs) * specFormat_.expandTabs; for (; currentColumn_ < col; currentColumn_++) os() << ' '; followWhitespaceChar_ = 1; break; } // fall through case ' ': followWhitespaceChar_ = 1; switch (specFormat_.inputWhitespaceTreatment) { case symbolIgnore: currentColumn_--; break; case symbolCollapse: if (prevWhitespaceChar) { currentColumn_--; break; } // fall through default: os() << ' '; } break; case 0x2002: os() << "\\u8194\\'20"; break; case 0x2003: os() << "\\u8195\\'20"; break; case 0x2010: os() << '-'; break; case 0x2011: os() << "\\_"; break; case 0x200c: os() << "\\zwnj "; break; case 0x200d: os() << "\\zwj "; break; case 0xa0: os() << "\\~"; break; case 0xad: os() << "\\-"; break; case '\0': break; case ';': case ',': if (mathLevel_ && *s == eqArgSep_ && mathSpecial_ == mathNormal) os() << "\\\\"; os() << char(*s); break; case '(': case ')': if (mathLevel_ && mathSpecial_ == mathNormal) os() << "\\\\"; os() << char(*s); break; case '\\': if (outputFormat_.charset == jisCharset) setCharset(0); if (mathLevel_ && mathSpecial_ == mathNormal) { // quote once to get through RTF // quote again to get through field // quote again to get through C++ os() << "\\\\\\\\"; break; } // fall through case '{': case '}': os() << '\\' << char(*s); break; case '|': case '~': if (outputFormat_.charset == jisCharset) setCharset(0); // fall through default: if (*s < 0x80) { if (specFormat_.mathPosture && (('a' <= *s && *s <= 'z') || ('A' <= *s && *s <= 'Z'))) os() << "{\\i " << char(*s) << '}'; else os() << char(*s); } else { unsigned long code = charTable_[*s]; if (code & CHAR_TABLE_SYMBOL_FLAG) symbolChar(((code & ~CHAR_TABLE_SYMBOL_FLAG) >> CHAR_TABLE_CHAR_BITS) + 1, code & 0xff); else if (code) { if (!(code & (1 << (outputFormat_.charset + CHAR_TABLE_CHAR_BITS)))) { // If possible, choose a charset compatible with the language if (code & (outputFormat_.langCharsets << CHAR_TABLE_CHAR_BITS)) code &= ((outputFormat_.langCharsets << CHAR_TABLE_CHAR_BITS) | ((1 << CHAR_TABLE_CHAR_BITS) - 1)); int i = 0; for (unsigned mask = 1 << CHAR_TABLE_CHAR_BITS; !(code & mask); mask <<= 1, i++) ; setCharset(i); } if (code & CHAR_TABLE_DB_FLAG) { os() << "{\\dbch\\uc2\\u" << int(short(*s)); hexChar(os(), (code >> 8) & 0xff); hexChar(os(), code & 0xff); os() << "}"; } else hexChar(os(), code & 0xff); } else { if (*s >= SYMBOL_FONT_PAGE + 0x20 && *s <= SYMBOL_FONT_PAGE + 0xff) symbolChar(outputFormat_.fontFamily, *s & 0xff); else { os() << "\\u" << int(short(*s)); hexChar(os(), '?'); } } } break; } } } void RtfFOTBuilder::setFontSize(long n) { specFormat_.fontSize = halfPoints(n); } void RtfFOTBuilder::setFontFamilyName(const StringC &name) { const int *p = fontFamilyNameTable_.lookup(name); if (!p) { specFormat_.fontFamily = fontFamilyCharsetsTable_.size(); fontFamilyNameTable_.insert(name, specFormat_.fontFamily); fontFamilyCharsetsTable_.resize(fontFamilyCharsetsTable_.size() + 1); } else specFormat_.fontFamily = *p; } void RtfFOTBuilder::setFontWeight(Symbol weight) { specFormat_.isBold = (weight > symbolMedium); } void RtfFOTBuilder::setFontPosture(Symbol posture) { switch (posture) { case symbolOblique: case symbolItalic: specFormat_.isItalic = 1; specFormat_.mathPosture = 0; break; case symbolMath: specFormat_.isItalic = 0; specFormat_.mathPosture = 1; break; default: specFormat_.isItalic = 0; specFormat_.mathPosture = 0; break; } } void RtfFOTBuilder::setGlyphSubstTable(const Vector > &tables) { static const int smallCapAfiiSignature = 0375; specFormat_.isSmallCaps = 0; for (size_t i = 0; i < tables.size(); i++) { const Vector &pairs = tables[i]->pairs; for (size_t j = 0; j < pairs.size(); j += 2) { if (pairs[j].suffix + (smallCapAfiiSignature << 8) == pairs[j + 1].suffix && pairs[j].suffix >= 'a' && pairs[j].suffix <= 'z' && pairs[j].publicId == pairs[j + 1].publicId && strcmp(pairs[j].publicId, "ISO/IEC 10036/RA//Glyphs") == 0) { specFormat_.isSmallCaps = 1; break; } } } } void RtfFOTBuilder::setHyphenate(bool b) { specFormat_.hyphenate = b; } void RtfFOTBuilder::setKern(bool b) { specFormat_.kern = b; } void RtfFOTBuilder::setHyphenationLadderCount(long n) { if (n > 0 && (maxConsecHyphens_ == 0 || n < maxConsecHyphens_)) maxConsecHyphens_ = n; } void RtfFOTBuilder::setWidowCount(long n) { if (n > 1) specFormat_.widowOrphanControl |= widowControl; else specFormat_.widowOrphanControl &= orphanControl; } void RtfFOTBuilder::setOrphanCount(long n) { if (n > 1) specFormat_.widowOrphanControl |= orphanControl; else specFormat_.widowOrphanControl &= widowControl; } void RtfFOTBuilder::setHeadingLevel(long n) { specFormat_.headingLevel = (n >= 1 && n <= 9) ? char(n) : 0; } void RtfFOTBuilder::setColor(const DeviceRGBColor &color) { specFormat_.color = makeColor(color); } void RtfFOTBuilder::setBackgroundColor(const DeviceRGBColor &color) { specFormat_.backgroundColor = makeColor(color); } void RtfFOTBuilder::setBackgroundColor() { specFormat_.backgroundColor = 0; } int RtfFOTBuilder::makeColor(const DeviceRGBColor &color) { unsigned n = (color.red << 16) | (color.green << 8) | color.blue; for (int i = 0; i < colorTable_.size(); i++) if (colorTable_[i] == n) return i + 1; colorTable_.push_back(n); return colorTable_.size(); } void RtfFOTBuilder::setBoxType(Symbol sym) { switch (sym) { case symbolBorder: specFormat_.boxHasBorder = 1; specFormat_.boxHasBackground = 0; break; case symbolBackground: specFormat_.boxHasBorder = 0; specFormat_.boxHasBackground = 1; break; case symbolBoth: specFormat_.boxHasBorder = 1; specFormat_.boxHasBackground = 1; break; default: break; } } void RtfFOTBuilder::setLineThickness(Length len) { specFormat_.lineThickness = (len > 150 ? 150 : len); } void RtfFOTBuilder::setLineRepeat(long n) { specFormat_.lineDouble = (n > 1); } void RtfFOTBuilder::setScoreSpaces(bool b) { specFormat_.scoreSpaces = b; } void RtfFOTBuilder::setBorderPresent(bool b) { specFormat_.borderPresent = b; } void RtfFOTBuilder::setBorderPriority(long n) { specFormat_.borderPriority = n; } void RtfFOTBuilder::setBorderOmitAtBreak(bool b) { specFormat_.borderOmitAtBreak = b; } void RtfFOTBuilder::newPar(bool allowSpaceBefore) { long boxExtraTopSep = 0; if (boxFirstPara_) { boxFirstPara_ = 0; boxLeftSep_ = paraFormat_.leftIndent; boxRightSep_ = paraFormat_.rightIndent; for (size_t i = 1; i < displayBoxLevels_.size(); i++) { boxLeftSep_ += specFormatStack_[displayBoxLevels_[i]].leftIndent; boxRightSep_ += specFormatStack_[displayBoxLevels_[i]].rightIndent; } // RTF doesn't include space before or after a paragraph inside // the box. boxTopSep_ = accumSpace_; accumSpace_ = accumSpaceBox_; accumSpaceBox_ = 0; } if (inlineState_ != inlineFirst) { if (!allowSpaceBefore) { os() << "\\sa" << accumSpace_; accumSpace_ = 0; } if (keep_) { if (hadParInKeep_ || continuePar_) keepWithNext_ = 1; hadParInKeep_ = 1; } if (!doBreak_ && keepWithNext_) os() << "\\keepn"; keepWithNext_ = 0; if (hyphenateSuppressed_) { os() << "\\hyphpar0"; hyphenateSuppressed_ = 0; } os() << "\\par"; } switch (doBreak_) { case breakPage: os() << "\\page"; doBreak_ = breakNone; break; case breakColumn: os() << "\\column"; doBreak_ = breakNone; break; default: break; } if (currentCols_ > 1) { if (spanDisplayLevels_) { os() << "\\sect\\sbknone\\cols1"; currentCols_ = 1; } } else if (spanDisplayLevels_ == 0 && currentCols_ == 1 && pageFormat_.nColumns > 1) { if (inlineState_ != inlineFirst) os() << "\\sect\\sbknone"; os() << "\\cols" << pageFormat_.nColumns << "\\colsx" << pageFormat_.columnSep; currentCols_ = pageFormat_.nColumns; } os() << "\\pard"; if (tableLevel_) os() << "\\intbl"; if (accumSpace_) { os() << "\\sb" << accumSpace_; accumSpace_ = 0; } if (keep_) os() << "\\keep"; if (!paraFormat_.widowOrphanControl) os() << "\\nowidctlpar"; if (paraFormat_.headingLevel) os() << "\\s" << int(paraFormat_.headingLevel); if (displayBoxLevels_.size() > 0) { const Format &boxFormat = specFormatStack_[displayBoxLevels_[0]]; for (const char *s = "tlbr"; *s; s++) { os() << "\\brdr" << *s; if (boxFormat.lineThickness > 75) os() << "\\brdrth\\brdrw" << boxFormat.lineThickness/2; else { if (boxFormat.lineDouble) os() << "\\brdrdb"; else os() << "\\brdrs"; os() << "\\brdrw" << boxFormat.lineThickness; } long sep; switch (*s) { case 't': sep = boxTopSep_; break; case 'l': sep = boxLeftSep_; break; case 'r': sep = boxRightSep_; break; default: sep = 0; break; } os() << "\\brsp" << sep; if (boxFormat.color) os() << "\\brdrcf" << boxFormat.color; if (boxLeftSep_ + boxFormat.leftIndent + addLeftIndent_) os() << "\\li" << boxLeftSep_ + boxFormat.leftIndent + addLeftIndent_; if (boxRightSep_ + boxFormat.rightIndent + addRightIndent_) os() << "\\ri" << boxRightSep_ + boxFormat.rightIndent + addRightIndent_; } } else { if (paraFormat_.leftIndent || addLeftIndent_) os() << "\\li" << paraFormat_.leftIndent + addLeftIndent_; if (paraFormat_.rightIndent || addRightIndent_) os() << "\\ri" << paraFormat_.rightIndent + addRightIndent_; } } // This must be called before any inline flow object. void RtfFOTBuilder::inlinePrepare() { followWhitespaceChar_ = 0; if (inlineState_ == inlineMiddle || inlineState_ == inlineField || inlineState_ == inlineFieldEnd) { flushFields(); return; } newPar(); os() << "\\sl" << (paraFormat_.lineSpacingAtLeast ? paraFormat_.lineSpacing : - paraFormat_.lineSpacing); int fli = continuePar_ ? 0 : paraFormat_.firstLineIndent; if (fli) os() << "\\fi" << fli; if (paraFormat_.quadding != 'l') os() << "\\q" << paraFormat_.quadding; inlineState_ = inlineMiddle; os() << ' '; flushFields(); } void RtfFOTBuilder::setPositionPointShift(const LengthSpec &val) { specFormat_.positionPointShiftSpec = val; specFormat_.positionPointShift = halfPoints(computeLengthSpec(val)); } void RtfFOTBuilder::setStartIndent(const LengthSpec &val) { specFormat_.leftIndentSpec = val; specFormat_.leftIndent = computeLengthSpec(val); } void RtfFOTBuilder::setLanguage(Letter2 code) { specFormat_.language = code; } void RtfFOTBuilder::setCountry(Letter2 code) { specFormat_.country = code; } void RtfFOTBuilder::setEndIndent(const LengthSpec &val) { specFormat_.rightIndentSpec = val; specFormat_.rightIndent = computeLengthSpec(val); } void RtfFOTBuilder::setFirstLineStartIndent(const LengthSpec &val) { specFormat_.firstLineIndentSpec = val; specFormat_.firstLineIndent = computeLengthSpec(val); } void RtfFOTBuilder::setLineSpacing(const LengthSpec &val) { specFormat_.lineSpacingSpec = val; specFormat_.lineSpacing = computeLengthSpec(val); } void RtfFOTBuilder::setMinLeading(const OptLengthSpec &ols) { specFormat_.lineSpacingAtLeast = ols.hasLength; } void RtfFOTBuilder::setFieldWidth(const LengthSpec &val) { specFormat_.fieldWidthSpec = val; specFormat_.fieldWidth = computeLengthSpec(val); } void RtfFOTBuilder::displaySizeChanged() { specFormat_.positionPointShift = computeLengthSpec(specFormat_.positionPointShiftSpec); specFormat_.leftIndent = computeLengthSpec(specFormat_.leftIndentSpec); specFormat_.rightIndent = computeLengthSpec(specFormat_.rightIndentSpec); specFormat_.firstLineIndent = computeLengthSpec(specFormat_.firstLineIndentSpec); specFormat_.lineSpacing = computeLengthSpec(specFormat_.lineSpacingSpec); specFormat_.fieldWidth = computeLengthSpec(specFormat_.fieldWidthSpec); } void RtfFOTBuilder::setQuadding(Symbol quadding) { switch (quadding) { case symbolStart: default: specFormat_.quadding = 'l'; break; case symbolEnd: specFormat_.quadding = 'r'; break; case symbolCenter: specFormat_.quadding = 'c'; break; case symbolJustify: specFormat_.quadding = 'j'; break; } } void RtfFOTBuilder::setDisplayAlignment(Symbol displayAlignment) { switch (displayAlignment) { case symbolStart: specFormat_.displayAlignment = 'l'; break; case symbolEnd: specFormat_.displayAlignment = 'r'; break; case symbolCenter: specFormat_.displayAlignment = 'c'; break; case symbolInside: case symbolOutside: default: specFormat_.displayAlignment = 'l'; break; } } void RtfFOTBuilder::setFieldAlign(Symbol fieldAlign) { specFormat_.fieldAlign = fieldAlign; } void RtfFOTBuilder::setLines(Symbol lines) { specFormat_.lines = lines; } void RtfFOTBuilder::setInputWhitespaceTreatment(Symbol sym) { specFormat_.inputWhitespaceTreatment = sym; } void RtfFOTBuilder::setExpandTabs(long n) { specFormat_.expandTabs = n; } void RtfFOTBuilder::startParagraph(const ParagraphNIC &nic) { startDisplay(nic); start(); paraStack_.resize(paraStack_.size() + 1); paraStack_.back() = paraFormat_; paraFormat_ = specFormat_; } void RtfFOTBuilder::endParagraph() { paraFormat_ = paraStack_.back(); paraStack_.resize(paraStack_.size() - 1); endDisplayGroup(); } void RtfFOTBuilder::paragraphBreak(const ParagraphNIC &nic) { if (paraStack_.size() > 0) { endDisplay(); startDisplay(nic); paraFormat_ = specFormat_; } atomic(); } void RtfFOTBuilder::startBox(const BoxNIC &nic) { if (nic.isDisplay) { startDisplay(nic); if (displayBoxLevels_.size() == 0) { accumSpaceBox_ = accumSpace_; accumSpace_ = 0; boxFirstPara_ = 1; } displayBoxLevels_.push_back(specFormatStack_.size()); } else { if (specFormat_.boxHasBackground && specFormat_.backgroundColor) specFormat_.charBackgroundColor = specFormat_.backgroundColor; if (specFormat_.boxHasBorder && !specFormat_.charBorder) { specFormat_.charBorder = 1; specFormat_.charBorderColor = specFormat_.color; specFormat_.charBorderThickness = specFormat_.lineThickness; specFormat_.charBorderDouble = specFormat_.lineDouble; } inlinePrepare(); } start(); } void RtfFOTBuilder::endBox() { if (displayBoxLevels_.size() > 0 && displayBoxLevels_.back() + 1 == specFormatStack_.size()) { // We're ending a displayed box. if (displayBoxLevels_.size() == 1) { // It was the outermost box. if (boxFirstPara_) { boxFirstPara_ = 0; boxLeftSep_ = boxRightSep_ = boxTopSep_ = 0; long boxHeight = accumSpace_; if (boxHeight <= 0) boxHeight = 1; accumSpace_ = accumSpaceBox_; newPar(1); os() << "\\sl-" << boxHeight; } else if (accumSpace_) { long extra = accumSpace_; accumSpace_ = 0; keepWithNext_ = 1; newPar(1); os() << "\\sl-" << extra; } else accumSpace_ = 0; // This prevents an adjacent box being merged by RTF. displayBoxLevels_.resize(displayBoxLevels_.size() - 1); os() << "\\keepn\\par\\pard\\sl-1"; if (tableLevel_) os() << "\\intbl"; } end(); endDisplay(); } else end(); } void RtfFOTBuilder::startDisplayGroup(const DisplayGroupNIC &nic) { startDisplay(nic); start(); } void RtfFOTBuilder::startDisplay(const DisplayNIC &nic) { if (spanDisplayLevels_) spanDisplayLevels_++; else if (specFormat_.span && pageFormat_.nColumns > 1 && tableLevel_ == 0) { spanDisplayLevels_ = 1; displaySize_ = pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin; displaySizeChanged(); } long spaceBefore = computeLengthSpec(nic.spaceBefore.nominal); if (spaceBefore > accumSpace_) accumSpace_ = spaceBefore; if (nic.keepWithPrevious) keepWithNext_ = 1; if (inlineState_ != inlineFirst && inlineState_ != inlineTable) inlineState_ = inlineStart; continuePar_ = 0; switch (nic.breakBefore) { case symbolPage: case symbolPageRegion: case symbolColumnSet: doBreak_ = breakPage; break; case symbolColumn: if (doBreak_ != breakPage) doBreak_ = breakColumn; break; default: break; } displayStack_.resize(displayStack_.size() + 1); long spaceAfter = computeLengthSpec(nic.spaceAfter.nominal); displayStack_.back().spaceAfter = spaceAfter; displayStack_.back().keepWithNext = nic.keepWithNext; displayStack_.back().saveKeep = keep_; switch (nic.keep) { case symbolTrue: case symbolPage: case symbolColumnSet: case symbolColumn: if (!keep_) { hadParInKeep_ = 0; keep_ = 1; } break; default: break; } switch (nic.breakAfter) { case symbolPage: case symbolPageRegion: case symbolColumnSet: displayStack_.back().breakAfter = breakPage; break; case symbolColumn: displayStack_.back().breakAfter = breakColumn; break; default: displayStack_.back().breakAfter = breakNone; break; } } void RtfFOTBuilder::endDisplayGroup() { end(); endDisplay(); } void RtfFOTBuilder::endDisplay() { doBreak_ = displayStack_.back().breakAfter; keep_ = displayStack_.back().saveKeep; if (inlineState_ != inlineTable) { if (inlineState_ != inlineFirst) inlineState_ = inlineStart; continuePar_ = 1; } if (displayStack_.back().spaceAfter > accumSpace_) accumSpace_ = displayStack_.back().spaceAfter; if (displayStack_.back().keepWithNext) keepWithNext_ = 1; displayStack_.resize(displayStack_.size() - 1); if (spanDisplayLevels_) { if (--spanDisplayLevels_ == 0) { displaySize_ = pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin; displaySize_ -= pageFormat_.columnSep * (pageFormat_.nColumns - 1); displaySize_ /= pageFormat_.nColumns; displaySizeChanged(); } } } void RtfFOTBuilder::startLineField(const LineFieldNIC &) { start(); if (inlineState_ == inlineStart || inlineState_ == inlineFirst) { fieldTabPos_ = specFormat_.fieldWidth + paraFormat_.leftIndent; if (!continuePar_) fieldTabPos_ += paraFormat_.firstLineIndent; inlinePrepare(); inlineState_ = inlineField; // Empirically-determined minimum possible distance between tabs. static const int minTabSep = 26; switch (specFormat_.fieldAlign) { case symbolStart: default: os() << "\\tx" << fieldTabPos_ << ' '; break; case symbolEnd: osp_ = &fieldos_; inlineState_ = inlineFieldEnd; break; case symbolCenter: { int sep = specFormat_.fieldWidth / 2; if (sep < minTabSep) sep = minTabSep; os() << "\\tqc\\tx" << fieldTabPos_ - sep << "\\tx" << fieldTabPos_ << "\\tab "; } break; } } } void RtfFOTBuilder::endLineField() { if (inlineState_ == inlineFieldEnd) { osp_ = &tempos_; // Strip trailing spaces and adjust position of // tab stop accordingly. String str; fieldos_.extractString(str); size_t i = str.size(); for (; i > 0; i--) if (str[i - 1] != ' ') break; // Assume each space is .25 em. int sep = (str.size() - i)*outputFormat_.fontSize*5/2; str.resize(i); static const int minTabSep = 26; if (sep < minTabSep) sep = minTabSep; os() << "\\tqr\\tx" << fieldTabPos_ - sep << "\\tx" << fieldTabPos_ << "\\tab "; os() << str; os() << "\\tab "; } else if (inlineState_ == inlineField) { os() << "\\tab "; inlineState_ = inlineMiddle; } end(); } void RtfFOTBuilder::startLeader(const LeaderNIC &) { start(); inlinePrepare(); syncCharFormat(); if (leaderDepth_++ == 0) { leaderSaveOutputFormat_ = outputFormat_; preLeaderOsp_ = osp_; osp_ = &nullos_; } } void RtfFOTBuilder::endLeader() { if (--leaderDepth_ == 0) { outputFormat_ = leaderSaveOutputFormat_; osp_ = preLeaderOsp_; // MS Word doesn't mind if tabs aren't set at the beginning of the paragraph. os() << "\\tqr\\tldot\\tx" << (displaySize_ - paraFormat_.rightIndent) << "\\tab "; } end(); } void RtfFOTBuilder::setPageWidth(long units) { if (!inSimplePageSequence_) pageFormat_.pageWidth = units; } void RtfFOTBuilder::setPageHeight(long units) { if (!inSimplePageSequence_) pageFormat_.pageHeight = units; } void RtfFOTBuilder::setLeftMargin(long units) { if (!inSimplePageSequence_) pageFormat_.leftMargin = units; } void RtfFOTBuilder::setRightMargin(long units) { if (!inSimplePageSequence_) pageFormat_.rightMargin = units; } void RtfFOTBuilder::setTopMargin(long units) { if (!inSimplePageSequence_) pageFormat_.topMargin = units; } void RtfFOTBuilder::setBottomMargin(long units) { if (!inSimplePageSequence_) pageFormat_.bottomMargin = units; } void RtfFOTBuilder::setHeaderMargin(long units) { if (!inSimplePageSequence_) pageFormat_.headerMargin = units; } void RtfFOTBuilder::setFooterMargin(long units) { if (!inSimplePageSequence_) pageFormat_.footerMargin = units; } void RtfFOTBuilder::setPageNumberRestart(bool b) { if (!inSimplePageSequence_) pageFormat_.pageNumberRestart = b; } void RtfFOTBuilder::setPageNumberFormat(const StringC &str) { if (inSimplePageSequence_) return; pageFormat_.pageNumberFormat = "dec"; if (str.size() == 1) { switch (str[0]) { case 'A': pageFormat_.pageNumberFormat = "ucltr"; break; case 'a': pageFormat_.pageNumberFormat = "lcltr"; break; case 'I': pageFormat_.pageNumberFormat = "ucrm"; break; case 'i': pageFormat_.pageNumberFormat = "lcrm"; break; } } } void RtfFOTBuilder::setPageNColumns(long n) { if (!inSimplePageSequence_) pageFormat_.nColumns = n > 0 ? n : 1; } void RtfFOTBuilder::setPageColumnSep(Length n) { if (!inSimplePageSequence_) pageFormat_.columnSep = n >= 0 ? n : 0; } void RtfFOTBuilder::setPageBalanceColumns(bool b) { if (!inSimplePageSequence_) pageFormat_.balance = b; } void RtfFOTBuilder::setSpan(long n) { specFormat_.span = n > 1; } void RtfFOTBuilder::startSimplePageSequenceSerial() { inSimplePageSequence_++; start(); if (doBalance_) { os() << "\\sect\\sbknone"; doBalance_ = 0; } if (hadSection_) os() << "\\sect"; else hadSection_ = 1; if (pageFormat_.headerMargin < hfPreSpace) pageFormat_.headerMargin = hfPreSpace; if (pageFormat_.footerMargin < hfPostSpace) pageFormat_.footerMargin = hfPostSpace; // Word 97 seems to get very confused by top or bottom margins less than this. static const int minVMargin = 12*20; if (pageFormat_.topMargin < minVMargin) pageFormat_.topMargin = minVMargin; if (pageFormat_.bottomMargin < minVMargin) pageFormat_.bottomMargin = minVMargin; os() << "\\sectd\\plain"; if (pageFormat_.pageWidth > pageFormat_.pageHeight) os() << "\\lndscpsxn"; os() << "\\pgwsxn" << pageFormat_.pageWidth << "\\pghsxn" << pageFormat_.pageHeight << "\\marglsxn" << pageFormat_.leftMargin << "\\margrsxn" << pageFormat_.rightMargin << "\\margtsxn" << pageFormat_.topMargin << "\\margbsxn" << pageFormat_.bottomMargin << "\\headery" << 0 << "\\footery" << 0 << "\\pgn" << pageFormat_.pageNumberFormat; if (pageFormat_.pageNumberRestart) os() << "\\pgnrestart"; displaySize_ = pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin; currentCols_ = 1; if (pageFormat_.nColumns > 1) { displaySize_ -= pageFormat_.columnSep * (pageFormat_.nColumns - 1); displaySize_ /= pageFormat_.nColumns; } if (pageFormat_.balance) doBalance_ = 1; displaySizeChanged(); outputFormat_ = OutputFormat(); doBreak_ = breakNone; suppressBookmarks_ = 1; accumSpace_ = 0; } void RtfFOTBuilder::endSimplePageSequenceSerial() { if (inlineState_ != inlineFirst) { if (hyphenateSuppressed_) { os() << "\\hyphpar0"; hyphenateSuppressed_ = 0; } os() << "\\par"; } inlineState_ = inlineFirst; continuePar_ = 0; end(); --inSimplePageSequence_; if (!inSimplePageSequence_) pageFormat_ = pageFormatStack_.back(); doBreak_ = breakNone; } void RtfFOTBuilder::startSimplePageSequenceHeaderFooter(unsigned) { inlineState_ = inlineMiddle; saveOutputFormat_ = outputFormat_; outputFormat_ = OutputFormat(); osp_ = &hfos_; } void RtfFOTBuilder::endSimplePageSequenceHeaderFooter(unsigned i) { outputFormat_ = saveOutputFormat_; hfos_.extractString(hfPart_[i]); osp_ = &tempos_; } void RtfFOTBuilder::endAllSimplePageSequenceHeaderFooter() { bool titlePage = 0; for (int i = 0; i < nHF; i += nHF/6) { if (hfPart_[i | frontHF | firstHF] != hfPart_[i | frontHF | otherHF] || hfPart_[i | backHF | firstHF] != hfPart_[i | backHF | otherHF]) { titlePage = 1; break; } } if (titlePage) { os() << "\\titlepg"; outputHeaderFooter("f", frontHF|firstHF); } outputHeaderFooter("l", backHF|otherHF); outputHeaderFooter("r", frontHF|otherHF); for (size_t i = 0; i < nHF; i++) hfPart_[i].resize(0); inlineState_ = inlineFirst; continuePar_ = 0; suppressBookmarks_ = 0; } void RtfFOTBuilder::outputHeaderFooter(const char *suffix, unsigned flags) { os() << "{\\header" << suffix << "\\pard\\sl" << -(hfPreSpace + hfPostSpace) << "\\sb" << (pageFormat_.headerMargin - hfPreSpace) << "\\sa" << (pageFormat_.topMargin - hfPostSpace - pageFormat_.headerMargin) << "\\plain\\tqc\\tx" << (pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin)/2 << "\\tqr\\tx" << (pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin) << ' ' << '{' << hfPart_[flags | headerHF | leftHF] << '}' << "\\tab " << '{' << hfPart_[flags | headerHF | centerHF] << '}' << "\\tab " << '{' << hfPart_[flags | headerHF | rightHF] << '}' << "\\par}" << "{\\footer" << suffix << "\\pard\\sl" << -(hfPreSpace + hfPostSpace) << "\\sb" << (pageFormat_.bottomMargin - hfPreSpace - pageFormat_.footerMargin) << "\\sa" << (pageFormat_.footerMargin - hfPostSpace) << "\\plain\\tqc\\tx" << (pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin)/2 << "\\tqr\\tx" << (pageFormat_.pageWidth - pageFormat_.leftMargin - pageFormat_.rightMargin) << ' ' << '{' << hfPart_[flags | footerHF | leftHF] << '}' << "\\tab " << '{' << hfPart_[flags | footerHF | centerHF] << '}' << "\\tab " << '{' << hfPart_[flags | footerHF | rightHF] << '}' << "\\par}"; } void RtfFOTBuilder::pageNumber() { inlinePrepare(); syncCharFormat(); os() << "\\chpgn "; } void RtfFOTBuilder::startScore(Symbol type) { switch (type) { case symbolAfter: if (specFormat_.lineDouble) specFormat_.underline = underlineDouble; else if (!specFormat_.scoreSpaces) specFormat_.underline = underlineWords; else specFormat_.underline = underlineSingle; break; case symbolThrough: specFormat_.isStrikethrough = 1; break; default: break; } start(); } void RtfFOTBuilder::idrefButton(unsigned long groveIndex, const Char *s, size_t n) { os() << "{\\field"; os() << "{\\*\\fldinst "; // doesn't work without the trailing spaces! os() << (rtfVersion_ >= word97 ? "HYPERLINK \\\\l " : "GOTOBUTTON "); outputBookmarkName(groveIndex, s, n); if (rtfVersion_ >= word97) os() << "}{\\fldrslt"; os() << ' '; } void RtfFOTBuilder::startLink(const Address &addr) { start(); if (linkDepth_++ == 0) { if (inlineState_ == inlineMiddle) doStartLink(addr); else { pendingLink_ = addr; havePendingLink_ = 1; } } } void RtfFOTBuilder::doStartLink(const Address &addr) { switch (addr.type) { case Address::resolvedNode: { GroveString id; if (addr.node->getId(id) == accessOK) idrefButton(addr.node->groveIndex(), id.data(), id.size()); else { unsigned long n; if (addr.node->elementIndex(n) == accessOK) { os() << "{\\field"; os() << "{\\*\\fldinst "; // doesn't work without the trailing spaces! os() << (rtfVersion_ >= word97 ? "HYPERLINK \\\\l " : "GOTOBUTTON "); unsigned long g = addr.node->groveIndex(); outputBookmarkName(g, n); os() << ' '; if (rtfVersion_ >= word97) os() << "}{\\fldrslt "; elementsRefed_.add(g, n); } else os() << "{{"; } break; } case Address::idref: { const StringC &id = addr.params[0]; size_t i = 0; for (; i < id.size(); i++) { // If they use multiple IDREFs, they'll only get // the first. if (id[i] == ' ') break; } idrefButton(addr.node->groveIndex(), id.data(), i); break; } default: os() << "{{"; break; } saveOutputFormat_ = outputFormat_; } void RtfFOTBuilder::endLink() { if (--linkDepth_ == 0) { if (havePendingLink_) havePendingLink_ = 0; else { os() << (rtfVersion_ >= word97 ? "}}" : "}{\\fldrslt }}"); outputFormat_ = saveOutputFormat_; } } end(); } void RtfFOTBuilder::rule(const RuleNIC &nic) { switch (nic.orientation) { case symbolHorizontal: { long lineOffset; long lineLength; if (nic.hasLength && (lineLength = computeLengthSpec(nic.length)) >= 0) { switch (specFormat_.displayAlignment) { default: case 'l': lineOffset = specFormat_.leftIndent; break; case 'c': lineOffset = (displaySize_ + specFormat_.leftIndent - specFormat_.rightIndent - lineLength)/2; break; case 'r': lineOffset = displaySize_ - specFormat_.rightIndent - lineLength; break; } } else { lineOffset = specFormat_.leftIndent; lineLength = displaySize_ - specFormat_.leftIndent - specFormat_.rightIndent; } startDisplay(nic); // We can't allow spaceBefore on this paragraph, because the y position // is measured from the start of the space before, but this space will // disappear on a page break. newPar(0); os() << "\\sl-1{\\*\\do\\dobxcolumn\\dobypara\\dodhgt0\\dpline\\dpptx0\\dppty0" << "\\dpptx" << lineLength << "\\dppty0" << "\\dpx" << lineOffset << "\\dpy0" << "\\dpxsize" << lineLength << "\\dpysize0"; if (specFormat_.color) { unsigned n = colorTable_[specFormat_.color - 1]; os() << "\\dplinecor" << (n >> 16) << "\\dplinecog" << ((n >> 8) & 0xff) << "\\dplinecob" << (n & 0xff); } os() << "\\dplinew" << specFormat_.lineThickness; os() << "}"; endDisplay(); } break; case symbolVertical: startDisplay(nic); newPar(); if (nic.hasLength) { long lineLength = computeLengthSpec(nic.length); if (lineLength > 0) os() << "\\sl-" << lineLength; // FIXME handle other display alignments } endDisplay(); break; case symbolEscapement: // if we don't have a length, can handle this with a leader tab. // If we do have a length, perhaps underline a blank space. inlinePrepare(); break; case symbolLineProgression: inlinePrepare(); break; default: break; } atomic(); } void RtfFOTBuilder::externalGraphic(const ExternalGraphicNIC &nic) { if (nic.isDisplay) { startDisplay(nic); newPar(); if (specFormat_.displayAlignment != 'l') os() << "\\q" << specFormat_.displayAlignment; flushFields(); } else inlinePrepare(); if (!embedObject(nic)) includePicture(nic); if (nic.isDisplay) endDisplay(); atomic(); } bool RtfFOTBuilder::includePicture(const ExternalGraphicNIC &nic) { StringC filename; if (systemIdFilename(nic.entitySystemId, filename)) { os() << "{\\field\\flddirty{\\*\\fldinst INCLUDEPICTURE \""; // FIXME non-ascii characters for (size_t i = 0; i < filename.size(); i++) { if (filename[i] == '\\') os() << "\\\\\\\\"; else os() << char(filename[i]); } os() << "\" }{\\fldrslt }}"; return 1; } return 0; } #ifdef WIN32 bool RtfFOTBuilder::embedObject(const ExternalGraphicNIC &nic) { if (nic.notationSystemId.size() == 0) return 0; StringC clsid; if (!systemIdNotation(nic.notationSystemId, "CLSID", clsid)) return 0; StringC filename; if (systemIdFilename(nic.entitySystemId, filename)) { os() << INSERTION_CHAR << 'o'; outputWord(os(), oleObject_.size()); oleObject_.push_back(filename); oleObject_.push_back(clsid); } return 1; } #else /* not WIN32 */ bool RtfFOTBuilder::embedObject(const ExternalGraphicNIC &) { return 0; } #endif /* not WIN32 */ bool RtfFOTBuilder::systemIdFilename(const StringC &systemId, StringC &filename) { int res = systemIdFilename1(systemId, filename); if (res < 0) { mgr_->message(RtfMessages::systemIdNotFilename, StringMessageArg(systemId)); return 0; } return res; } // Return -1 if an error should be generated // FIXME in some cases should copy the entity into a file in the same // directory as the output file. int RtfFOTBuilder::systemIdFilename1(const StringC &systemId, StringC &filename) { if (systemId.size() == 0) return -1; Owner in(entityManager_->open(systemId, *systemCharset_, InputSourceOrigin::make(), 0, *mgr_)); if (!in) return 0; Xchar c = in->get(*mgr_); StorageObjectLocation soLoc; ParsedSystemId parsedBuf; if (c == InputSource::eE && in->accessError()) { if (!entityManager_->parseSystemId(systemId, *systemCharset_, 0, 0, *mgr_, parsedBuf)) return 0; if (parsedBuf.size() != 1 || parsedBuf[0].baseId.size()) return 0; soLoc.storageObjectSpec = &parsedBuf[0]; soLoc.actualStorageId = parsedBuf[0].specId; } else { const Location &loc = in->currentLocation(); if (loc.origin().isNull()) return -1; const InputSourceOrigin *tem = loc.origin()->asInputSourceOrigin(); if (!tem) return -1; const ParsedSystemId *psi = ExtendEntityManager::externalInfoParsedSystemId(tem->externalInfo()); if (!psi || psi->size() != 1) return -1; if (!ExtendEntityManager::externalize(tem->externalInfo(), 0, soLoc)) return -1; } if (strcmp(soLoc.storageObjectSpec->storageManager->type(), "OSFILE") != 0) return -1; filename = soLoc.actualStorageId; return 1; } bool RtfFOTBuilder::systemIdNotation(const StringC &systemId, const char *notation, StringC &id) { ParsedSystemId parsedBuf; if (!entityManager_->parseSystemId(systemId, *systemCharset_, 0, 0, *mgr_, parsedBuf)) return 0; if (parsedBuf.size() != 1) return 0; if (strcmp(parsedBuf[0].storageManager->type(), notation) != 0) return 0; id = parsedBuf[0].specId; return 1; } void RtfFOTBuilder::startTable(const TableNIC &nic) { startDisplay(nic); start(); if (tableLevel_++) { mgr_->message(RtfMessages::nestedTable); return; } if (nic.widthType == TableNIC::widthExplicit) tableWidth_ = computeLengthSpec(nic.width); else tableWidth_ = (displaySize_ - specFormat_.leftIndent - specFormat_.rightIndent); tableDisplaySize_ = displaySize_; tableLeftIndent_ = specFormat_.leftIndent; tableRightIndent_ = specFormat_.rightIndent; tableAlignment_ = specFormat_.displayAlignment; switch (tableAlignment_) { case 'r': if (tableRightIndent_ != 0) { tableAlignment_ = 'l'; tableLeftIndent_ = tableDisplaySize_ - tableWidth_ - tableRightIndent_; } break; case 'c': if (tableLeftIndent_ != 0 || tableRightIndent_ != 0) { tableAlignment_ = 'l'; tableLeftIndent_ = (tableDisplaySize_ - tableWidth_ + tableLeftIndent_ - tableRightIndent_)/2; } break; default: break; } } void RtfFOTBuilder::endTable() { if (--tableLevel_ == 0) { if (cells_.size()) outputTable(); if (inlineState_ == inlineTable) { outputFormat_ = OutputFormat(); os() << "\\pard\\plain\\sl-1"; inlineState_ = inlineStart; } displaySize_ = tableDisplaySize_; } end(); endDisplay(); } // FIXME How should borders between table-parts be handled? // This treats them like outside borders, which probably isn't right. void RtfFOTBuilder::startTablePartSerial(const TablePartNIC &nic) { startDisplay(nic); start(); } void RtfFOTBuilder::endTablePartSerial() { if (tableLevel_ == 1 && cells_.size()) { outputTable(); nHeaderRows_ = 0; } end(); endDisplay(); } void RtfFOTBuilder::startTablePartHeader() { if (tableLevel_ == 1) inTableHeader_ = 1; } void RtfFOTBuilder::endTablePartHeader() { if (tableLevel_ == 1) inTableHeader_ = 0; } void RtfFOTBuilder::startTablePartFooter() { } void RtfFOTBuilder::endTablePartFooter() { } void RtfFOTBuilder::tableColumn(const TableColumnNIC &nic) { if (tableLevel_ == 1 && nic.nColumnsSpanned == 1) { if (nic.columnIndex >= columns_.size()) columns_.resize(nic.columnIndex + 1); columns_[nic.columnIndex].hasWidth = nic.hasWidth; if (nic.hasWidth) columns_[nic.columnIndex].width = nic.width; } atomic(); } void RtfFOTBuilder::outputTable() { for (size_t i = 0; i < cells_.size(); i++) { size_t j; bool lastIsDummy = 0; // last cell should be a dummy cell for (j = 0; j < cells_[i].size(); j += cells_[i][j].span) lastIsDummy = !cells_[i][j].present; if (lastIsDummy) j--; if (j > columns_.size()) columns_.resize(j); } for (size_t i = 0; i < cells_.size(); i++) { size_t oldSize = cells_[i].size(); if (oldSize != columns_.size()) { cells_[i].resize(columns_.size()); if (oldSize > 0 && oldSize < cells_[i].size() && !cells_[i][oldSize - 1].present) { for (size_t j = oldSize; j < cells_[i].size(); j++) cells_[i][j] = cells_[i][oldSize - 1]; } } } // Deal the best we can with vertical spanning for (size_t i = 0; i < cells_.size(); i++) { for (size_t j = 0; j < cells_[i].size(); j += cells_[i][j].span) { if (cells_[i][j].vspan > 1) { if (i + cells_[i][j].vspan > cells_.size()) cells_[i][j].vspan = cells_.size() - i; for (size_t k = 1; k < cells_[i][j].vspan; k++) { if (cells_[i + k][j].present) { cells_[i][j].vspan = k; break; } cells_[i + k][j].vspan = 0; cells_[i + k][j].present = 1; cells_[i + k][j].span = cells_[i][j].span; cells_[i + k][j].border[leftBorder] = cells_[i][j].border[leftBorder]; cells_[i + k][j].border[rightBorder] = cells_[i][j].border[rightBorder]; } cells_[i + cells_[i][j].vspan - 1][j].border[bottomBorder] = cells_[i][j].border[bottomBorder]; cells_[i][j].border[bottomBorder].flags = 0; } } } Vector columnWidths(columns_.size()); int nExplicitWidth = 0; int totalExplicitWidth = 0; double totalTableUnits = 0; displaySize_ = tableDisplaySize_; for (size_t i = 0; i < columns_.size(); i++) if (columns_[i].hasWidth) { columnWidths[i] = computeLengthSpec(columns_[i].width); nExplicitWidth++; totalExplicitWidth += columnWidths[i]; totalTableUnits += columns_[i].width.tableUnitFactor; } double tableUnitWidth = 0.0; totalTableUnits += columns_.size() - nExplicitWidth; if (totalTableUnits) tableUnitWidth = ((tableWidth_ - totalExplicitWidth)/totalTableUnits); for (size_t i = 0; i < columns_.size(); i++) if (!columns_[i].hasWidth) columnWidths[i] = long(tableUnitWidth); else if (columns_[i].width.tableUnitFactor > 0.0) columnWidths[i] += long(columns_[i].width.tableUnitFactor * tableUnitWidth); if (cells_.size() > 0) { for (size_t i = 0; i < cells_[0].size(); i += cells_[0][i].span) resolveOutsideBorder(cells_[0][i].border[topBorder], tableBorder_[topBorder]); for (size_t i = 0; i < cells_.back().size(); i += cells_.back()[i].span) resolveOutsideBorder(cells_.back()[i].border[bottomBorder], tableBorder_[bottomBorder]); } for (size_t i = 0; i < cells_.size(); i++) { // Resolve the column borders if (cells_[i].size()) { resolveOutsideBorder(cells_[i][0].border[leftBorder], tableBorder_[leftBorder]); size_t prev = 0; size_t j; for (j = cells_[i][0].span; j < cells_[i].size(); j += cells_[i][j].span) { resolveBorder(cells_[i][prev].border[rightBorder], cells_[i][j].border[leftBorder]); prev = j; } if (j == columns_.size()) resolveOutsideBorder(cells_[i][prev].border[rightBorder], tableBorder_[rightBorder]); } // Resolve the borders adjacent to the next row if (i + 1 < cells_.size()) { size_t j2 = 0; for (size_t j1 = 0; j1 < cells_[i].size(); j1 += cells_[i][j1].span) { while (j2 < j1 && j2 < cells_[i + 1].size()) j2 += cells_[i + 1][j2].span; if (j1 == j2 && j2 < cells_[i + 1].size() && cells_[i][j1].span == cells_[i + 1][j2].span) resolveBorder(cells_[i][j1].border[bottomBorder], cells_[i + 1][j2].border[topBorder]); } } os() << "\\trowd"; if (tableAlignment_ == 'l' && tableLeftIndent_ != 0) os() << "\\trleft" << tableLeftIndent_; else os() << "\\trq" << char(tableAlignment_); if (keep_) os() << "\\trkeep"; if (i < nHeaderRows_) os() << "\\trhdr"; #if 0 // Including this causes Word to leave out rules seemingly at random else if (i > 0) { // This is necessary to get borders on table-breaks. // Putting it on the first row confuses Word. const Border &brdr = tableBorder_[bottomBorder]; if ((brdr.flags & RtfFOTBuilder::Border::isPresent) && !(brdr.flags & RtfFOTBuilder::Border::omitAtBreak)) { os() << "\\trbrdrb"; outputTableBorder(brdr); } } #endif os() << ' '; long pos = tableLeftIndent_; for (unsigned j = 0; j < cells_[i].size(); j += cells_[i][j].span) { if (cells_[i][j].vspan == 0) os() << "\\clvmrg"; else { if (cells_[i][j].vspan > 1) os() << "\\clvmgf"; os() << "\\clvertal" << cells_[i][j].valign; } for (int k = 0; k < 4; k++) { const Border &brdr = cells_[i][j].border[k]; if (brdr.flags & RtfFOTBuilder::Border::isPresent) { os() << "\\clbrdr" << "tblr"[k]; outputTableBorder(brdr); } } if (cells_[i][j].hasBackground && cells_[i][j].backgroundColor) os() << "\\clshdng10000\\clcfpat" << cells_[i][j].backgroundColor; for (int k = 0; k < cells_[i][j].span; k++) pos += columnWidths[j + k]; os() << "\\cellx" << pos; } os() << ' '; for (unsigned j = 0; j < cells_[i].size(); j += cells_[i][j].span) { if (cells_[i][j].content.size() == 0) { if (j == 0) os() << "\\intbl"; } else { os() << cells_[i][j].content; if (keep_) os() << "\\keepn"; } os() << "\\cell "; } os() << "\\row "; } columns_.resize(0); cells_.resize(0); } void RtfFOTBuilder::outputTableBorder(const Border &brdr) { if (brdr.thickness > 75) os() << "\\brdrth\\brdrw" << long(brdr.thickness)/2; else if (brdr.flags & Border::isDouble) os() << "\\brdrdb\\brdrw" << long(brdr.thickness); else os() << "\\brdrs\\brdrw" << long(brdr.thickness); if (brdr.color) os() << "\\brdrcf" << long(brdr.color); } void RtfFOTBuilder::startTableRow() { if (tableLevel_ != 1) { start(); return; } if (inlineState_ == inlineStart) { if (accumSpace_) os() << "\\sa" << accumSpace_; if (keepWithNext_) os() << "\\keepn"; os() << "\\par"; } // FIXME if state is inlineTable and there's some accumSpace_, must add blank row keepWithNext_ = 0; accumSpace_ = 0; cells_.resize(cells_.size() + 1); start(); } void RtfFOTBuilder::endTableRow() { if (tableLevel_ != 1) { end(); return; } if (inTableHeader_) { Vector headerRow; cells_.back().swap(headerRow); for (size_t i = cells_.size() - 1; i > nHeaderRows_; i--) cells_[i - 1].swap(cells_[i]); headerRow.swap(cells_[nHeaderRows_++]); } end(); inlineState_ = inlineTable; } void RtfFOTBuilder::startTableCell(const TableCellNIC &nic) { if (tableLevel_ != 1) { start(); return; } if (nic.columnIndex >= cells_.back().size()) cells_.back().resize(nic.columnIndex + 1); cellIndex_ = nic.columnIndex; cells_.back()[cellIndex_].present = !nic.missing; cells_.back()[cellIndex_].span = nic.nColumnsSpanned; cells_.back()[cellIndex_].vspan = nic.nRowsSpanned; cells_.back()[cellIndex_].hasBackground = specFormat_.cellBackground; if (specFormat_.cellBackground) cells_.back()[cellIndex_].backgroundColor = specFormat_.backgroundColor; cells_.back()[cellIndex_].valign = specFormat_.cellVerticalAlignment; // Make a guess at the display-size. bool hasWidth = 1; long newDisplaySize = 0; displaySize_ = tableDisplaySize_; for (unsigned i = cellIndex_; i < cellIndex_ + nic.nColumnsSpanned; i++) { if (i >= columns_.size() || !columns_[i].hasWidth) { hasWidth = 0; break; } newDisplaySize += computeLengthSpec(columns_[i].width); } if (!hasWidth) newDisplaySize = (tableWidth_*nic.nColumnsSpanned) /(columns_.size() ? columns_.size() : 2); osp_ = &cellos_; inlineState_ = inlineFirst; continuePar_ = 0; addLeftIndent_ = specFormat_.cellLeftMargin; addRightIndent_ = specFormat_.cellRightMargin; accumSpace_ = specFormat_.cellTopMargin; displaySize_ = newDisplaySize; displaySizeChanged(); start(); os() << "\\plain "; outputFormat_ = OutputFormat(); } void RtfFOTBuilder::endTableCell() { if (tableLevel_ != 1) { end(); return; } accumSpace_ += specFormat_.cellBottomMargin; if (accumSpace_ > 0) { if (inlineState_ == inlineFirst) os() << "\\pard\\intbl\\sl-" << accumSpace_ << "\\par"; else os() << "\\sa" << accumSpace_; } else if (inlineState_ == inlineFirst) os() << "\\intbl"; accumSpace_ = 0; cellos_.extractString(cells_.back()[cellIndex_].content); end(); osp_ = &tempos_; accumSpace_ = 0; addLeftIndent_ = 0; addRightIndent_ = 0; keepWithNext_ = 0; } void RtfFOTBuilder::tableBeforeRowBorder() { if (tableLevel_ == 1) storeBorder(tableBorder_[topBorder]); } void RtfFOTBuilder::tableAfterRowBorder() { if (tableLevel_ == 1) storeBorder(tableBorder_[bottomBorder]); } void RtfFOTBuilder::tableBeforeColumnBorder() { if (tableLevel_ == 1) storeBorder(tableBorder_[leftBorder]); } void RtfFOTBuilder::tableAfterColumnBorder() { if (tableLevel_ == 1) storeBorder(tableBorder_[rightBorder]); } void RtfFOTBuilder::tableCellBeforeRowBorder() { if (tableLevel_ == 1) storeBorder(cells_.back()[cellIndex_].border[topBorder]); } void RtfFOTBuilder::tableCellAfterRowBorder() { if (tableLevel_ == 1) storeBorder(cells_.back()[cellIndex_].border[bottomBorder]); } void RtfFOTBuilder::tableCellBeforeColumnBorder() { if (tableLevel_ == 1) storeBorder(cells_.back()[cellIndex_].border[leftBorder]); } void RtfFOTBuilder::tableCellAfterColumnBorder() { if (tableLevel_ == 1) storeBorder(cells_.back()[cellIndex_].border[rightBorder]); } void RtfFOTBuilder::storeBorder(Border &b) { b.flags = 0; if (specFormat_.borderPresent) { b.flags |= Border::isPresent; b.thickness = specFormat_.lineThickness; b.color = specFormat_.color; if (specFormat_.lineDouble) b.flags |= Border::isDouble; } if (specFormat_.borderOmitAtBreak) b.flags |= Border::omitAtBreak; b.priority = specFormat_.borderPriority; atomic(); } void RtfFOTBuilder::resolveBorder(Border &b1, Border &b2) { if (b1.priority != b2.priority) { if (b1.priority > b2.priority) b2 = b1; else b1 = b2; } else if ((b1.flags ^ b2.flags) & Border::isPresent) { if (b1.flags & Border::isPresent) b2 = b1; else b1 = b2; } } void RtfFOTBuilder::resolveOutsideBorder(Border &cellBorder, const Border &tableBorder) { // The standard doesn't say this, but otherwise table-border: #t wouldn't work. if (tableBorder.priority > cellBorder.priority || (tableBorder.priority == cellBorder.priority && (tableBorder.flags & Border::isPresent))) cellBorder = tableBorder; } void RtfFOTBuilder::setCellBeforeRowMargin(Length n) { specFormat_.cellTopMargin = n; } void RtfFOTBuilder::setCellAfterRowMargin(Length n) { specFormat_.cellBottomMargin = n; } void RtfFOTBuilder::setCellBeforeColumnMargin(Length n) { specFormat_.cellLeftMargin = n; } void RtfFOTBuilder::setCellAfterColumnMargin(Length n) { specFormat_.cellRightMargin = n; } void RtfFOTBuilder::setCellBackground(bool b) { specFormat_.cellBackground = b; } void RtfFOTBuilder::setCellRowAlignment(Symbol align) { switch (align) { case symbolStart: specFormat_.cellVerticalAlignment = 't'; break; case symbolCenter: specFormat_.cellVerticalAlignment = 'c'; break; case symbolEnd: specFormat_.cellVerticalAlignment = 'b'; break; default: break; } } void RtfFOTBuilder::enterMathMode() { if (mathLevel_++ == 0) { mathSaveOutputFormat_ = outputFormat_; os() << "{\\field{\\*\\fldinst EQ "; } } void RtfFOTBuilder::exitMathMode() { if (--mathLevel_ == 0) { os() << "}{\\fldrslt}}"; outputFormat_ = mathSaveOutputFormat_; } } void RtfFOTBuilder::setSubscriptDepth(Length n) { specFormat_.subscriptDepth = points(n); } void RtfFOTBuilder::setSuperscriptHeight(Length n) { specFormat_.superscriptHeight = points(n); } void RtfFOTBuilder::setUnderMarkDepth(Length n) { specFormat_.underMarkDepth = points(n); } void RtfFOTBuilder::setOverMarkHeight(Length n) { specFormat_.overMarkHeight = points(n); } void RtfFOTBuilder::startSubscript() { start(); inlinePrepare(); enterMathMode(); os() << "\\\\s\\\\do" << specFormat_.subscriptDepth << '('; } void RtfFOTBuilder::endSubscript() { os() << ")"; exitMathMode(); end(); } void RtfFOTBuilder::startSuperscript() { start(); inlinePrepare(); enterMathMode(); os() << "\\\\s\\\\up" << specFormat_.superscriptHeight << '('; } void RtfFOTBuilder::endSuperscript() { os() << ")"; exitMathMode(); end(); } void RtfFOTBuilder::startMathSequence() { start(); inlinePrepare(); enterMathMode(); } void RtfFOTBuilder::endMathSequence() { exitMathMode(); end(); } void RtfFOTBuilder::startFractionSerial() { start(); inlinePrepare(); enterMathMode(); os() << "\\\\f"; } void RtfFOTBuilder::endFractionSerial() { exitMathMode(); end(); } void RtfFOTBuilder::startFractionNumerator() { os() << '('; } void RtfFOTBuilder::endFractionNumerator() { } void RtfFOTBuilder::startFractionDenominator() { os() << eqArgSep_; } void RtfFOTBuilder::endFractionDenominator() { os() << ')'; } void RtfFOTBuilder::startRadicalSerial() { start(); inlinePrepare(); enterMathMode(); startReorderFlowObject(); } void RtfFOTBuilder::endRadicalSerial() { Vector > &v = reorderStack_.head()->streams; *reorderStack_.head()->saveOsp << "\\\\r(" << v[1] << eqArgSep_ << v[0] << ')'; endReorderFlowObject(); end(); exitMathMode(); } void RtfFOTBuilder::startRadicalDegree() { endReorderFlowObjectPort(); } void RtfFOTBuilder::endRadicalDegree() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startFenceSerial() { start(); inlinePrepare(); enterMathMode(); startReorderFlowObject(); } void RtfFOTBuilder::endFenceSerial() { Vector > &v = reorderStack_.head()->streams; *reorderStack_.head()->saveOsp << "\\\\b\\\\lc\\\\" << v[1] << "\\\\rc\\\\" << v[2] <<'(' << v[0] << ')'; endReorderFlowObject(); end(); exitMathMode(); } void RtfFOTBuilder::startFenceOpen() { endReorderFlowObjectPort(); mathSpecial_ = mathFence; } void RtfFOTBuilder::endFenceOpen() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startFenceClose() { } void RtfFOTBuilder::endFenceClose() { endReorderFlowObjectPort(); mathSpecial_ = mathNormal; } void RtfFOTBuilder::setMathDisplayMode(Symbol sym) { switch (sym) { case symbolDisplay: specFormat_.mathInline = 0; break; case symbolInline: specFormat_.mathInline = 1; break; default: break; } } void RtfFOTBuilder::startMathOperatorSerial() { start(); inlinePrepare(); enterMathMode(); os() << "\\\\i"; if (specFormat_.mathInline) os() << "\\\\in"; startReorderFlowObject(); } void RtfFOTBuilder::endMathOperatorSerial() { Vector > &v = reorderStack_.head()->streams; // FIXME handle sum, product, integral specially *reorderStack_.head()->saveOsp << v[1] << '(' << v[2] << eqArgSep_ << v[3] << eqArgSep_ << v[0] << ')'; endReorderFlowObject(); end(); exitMathMode(); } void RtfFOTBuilder::startMathOperatorOperator() { endReorderFlowObjectPort(); mathSpecial_ = mathIntegral; } void RtfFOTBuilder::endMathOperatorOperator() { mathSpecial_ = mathNormal; endReorderFlowObjectPort(); } void RtfFOTBuilder::startMathOperatorLowerLimit() { } void RtfFOTBuilder::endMathOperatorLowerLimit() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startMathOperatorUpperLimit() { } void RtfFOTBuilder::endMathOperatorUpperLimit() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startMarkSerial() { start(); inlinePrepare(); enterMathMode(); startReorderFlowObject(); } void RtfFOTBuilder::endMarkSerial() { Vector > &v = reorderStack_.head()->streams; OutputByteStream &o = *reorderStack_.head()->saveOsp; o << "\\\\o(" << v[0]; if (v[1].size() > 2) o << eqArgSep_ << "\\\\s\\\\up" << specFormat_.overMarkHeight << '(' << v[1] << ')'; if (v[2].size() > 2) o << eqArgSep_ << "\\\\s\\\\do" << specFormat_.underMarkDepth << '(' << v[2] << ')'; o << ')'; endReorderFlowObject(); end(); exitMathMode(); } void RtfFOTBuilder::startMarkOver() { endReorderFlowObjectPort(); } void RtfFOTBuilder::endMarkOver() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startMarkUnder() { } void RtfFOTBuilder::endMarkUnder() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptSerial() { start(); inlinePrepare(); enterMathMode(); startReorderFlowObject(); } void RtfFOTBuilder::endScriptSerial() { endReorderFlowObjectPort(); Vector > &v = reorderStack_.head()->streams; ASSERT(v.size() == 7); OutputByteStream &o = *reorderStack_.head()->saveOsp; const String &preSup = v[1]; const String &preSub = v[2]; const String &postSup = v[3]; const String &postSub = v[4]; const String &midSup = v[5]; const String &midSub = v[6]; o << "\\\\o("; if (preSup.size() > 2) o << "\\\\s\\\\up" << specFormat_.superscriptHeight << '(' << preSup << ')'; o << eqArgSep_; if (preSub.size() > 2) o << "\\\\s\\\\do" << specFormat_.subscriptDepth << '(' << preSub << ')'; o << ')'; o << "\\\\o("; o << v[0]; if (midSup.size() > 2) o << eqArgSep_ << "\\\\s\\\\up" << specFormat_.overMarkHeight << '(' << midSup << ')'; if (midSub.size() > 2) o << eqArgSep_ << "\\\\s\\\\do" << specFormat_.underMarkDepth << '(' << midSub << ')'; o << ')'; o << "\\\\o("; if (postSup.size() > 2) o << "\\\\s\\\\up" << specFormat_.superscriptHeight << '(' << postSup << ')'; o << eqArgSep_; if (postSub.size() > 2) o << "\\\\s\\\\do" << specFormat_.subscriptDepth << '(' << postSub << ')'; o << ')'; endReorderFlowObject(); end(); exitMathMode(); } void RtfFOTBuilder::startScriptPreSup() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptPreSub() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptPostSup() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptPostSub() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptMidSup() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startScriptMidSub() { endReorderFlowObjectPort(); } void RtfFOTBuilder::startReorderFlowObject() { reorderStack_.insert(new ReorderFlowObject); ReorderFlowObject &r = *reorderStack_.head(); r.saveOsp = osp_; r.saveOutputFormat = outputFormat_; osp_ = &r.buf; os() << '{'; } void RtfFOTBuilder::endReorderFlowObjectPort() { os() << '}'; ReorderFlowObject &r = *reorderStack_.head(); r.streams.resize(r.streams.size() + 1); r.buf.extractString(r.streams.back()); os() << '{'; outputFormat_ = r.saveOutputFormat; } void RtfFOTBuilder::endReorderFlowObject() { osp_ = reorderStack_.head()->saveOsp; delete reorderStack_.get(); } void RtfFOTBuilder::setGridPositionCellType(Symbol sym) { switch (sym) { case symbolRowMajor: specFormat_.gridPosType = gridPosRowMajor; break; case symbolColumnMajor: specFormat_.gridPosType = gridPosColumnMajor; break; case symbolExplicit: specFormat_.gridPosType = gridPosExplicit; break; default: break; } } void RtfFOTBuilder::setGridColumnAlignment(Symbol sym) { switch (sym) { case symbolStart: specFormat_.gridColumnAlignment = 'l'; break; case symbolCenter: specFormat_.gridColumnAlignment = 'c'; break; case symbolEnd: specFormat_.gridColumnAlignment = 'r'; break; default: break; } } void RtfFOTBuilder::setGridRowSep(Length n) { specFormat_.gridRowSep = points(n); } void RtfFOTBuilder::setGridColumnSep(Length n) { specFormat_.gridColumnSep = points(n); } void RtfFOTBuilder::startGrid(const GridNIC &nic) { start(); inlinePrepare(); enterMathMode(); gridStack_.insert(new Grid); Grid &g = *gridStack_.head(); g.saveOsp = osp_; g.saveOutputFormat = outputFormat_; g.posType = specFormat_.gridPosType; g.nColumns = nic.nColumns; if (!g.nColumns) g.nColumns = 1; g.nRows = nic.nRows; if (!g.nRows) g.nRows = 1; osp_ = &g.buf; } void RtfFOTBuilder::endGrid() { osp_ = gridStack_.head()->saveOsp; Grid &g = *gridStack_.head(); for (size_t i = 0; i < g.cells.size(); i++) { if (g.cells[i].size() > g.nColumns) g.nColumns = g.cells[i].size(); } if (g.cells.size() > g.nRows) g.nRows = g.cells.size(); os() << "\\\\a" << "\\\\hs" << specFormat_.gridColumnSep << "\\\\vs" << specFormat_.gridRowSep << "\\\\a" << specFormat_.gridColumnAlignment << "\\\\co" << g.nColumns << '('; for (size_t i = 0; i < g.cells.size(); i++) { size_t j = 0; for (; j < g.cells[i].size(); j++) { if (i || j) os() << eqArgSep_; os() << g.cells[i][j]; } if (!j) j++; for (; j < g.nColumns; j++) os() << eqArgSep_; } os() << ')'; delete gridStack_.get(); end(); exitMathMode(); } void RtfFOTBuilder::startGridCell(const GridCellNIC &nic) { if (!gridStack_.empty()) { os() << '{'; Grid &g = *gridStack_.head(); g.curCellPtr = 0; switch (g.posType) { case gridPosExplicit: if (nic.rowNumber > 0 && nic.columnNumber > 0) { if (nic.columnNumber > g.cells.size()) g.cells.resize(nic.columnNumber); Vector > &column = g.cells[nic.columnNumber - 1]; if (nic.rowNumber > column.size()) column.resize(nic.rowNumber); g.curCellPtr = &column[nic.rowNumber - 1]; } break; case gridPosRowMajor: if (g.cells.size() == 0 || g.cells.back().size() >= g.nColumns) g.cells.resize(g.cells.size() + 1); g.cells.back().resize(g.cells.back().size() + 1); g.curCellPtr = &g.cells.back().back(); break; case gridPosColumnMajor: if (g.cells.size() < g.nRows) g.cells.resize(g.nRows); if (g.cells[g.nRows - 1].size() == g.cells[0].size()) { g.cells[0].resize(g.cells[0].size() + 1); g.curCellPtr = &g.cells[0].back(); } else { for (size_t i = 1;; i++) { ASSERT(i < g.cells.size()); if (g.cells[i].size() < g.cells[0].size()) { g.cells[i].resize(g.cells[i].size() + 1); g.curCellPtr = &g.cells[i].back(); break; } } } break; default: CANNOT_HAPPEN(); } } start(); } void RtfFOTBuilder::endGridCell() { if (!gridStack_.empty()) { os() << '}'; Grid &g = *gridStack_.head(); if (g.curCellPtr) g.buf.extractString(*g.curCellPtr); else { String tem; g.buf.extractString(tem); } outputFormat_ = g.saveOutputFormat; } end(); } void RtfFOTBuilder::outputBookmarkName(unsigned long groveIndex, const Char *s, size_t n) { os() << "ID"; if (groveIndex) os() << groveIndex; os() << '_'; for (; n > 0; n--, s++) { Char c = *s; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': os() << char(c); break; default: os() << '_' << (unsigned long)c << '_'; break; } } } void RtfFOTBuilder::outputBookmarkName(unsigned long groveIndex, unsigned long n) { os() << (rtfVersion_ >= word97 ? "_" : "E_"); if (groveIndex) os() << groveIndex << '_'; os() << n; } void RtfFOTBuilder::flushPendingElements() { for (size_t i = 0; i < pendingElements_.size(); i++) { const NodePtr &node = pendingElements_[i]; GroveString id; if (node->getId(id) == accessOK) { unsigned long g = node->groveIndex(); os() << "{\\*\\bkmkstart "; outputBookmarkName(g, id.data(), id.size()); os() << '}'; os() << "{\\*\\bkmkend "; outputBookmarkName(g, id.data(), id.size()); os() << '}'; } else { unsigned long n; if (node->elementIndex(n) == accessOK) { os() << INSERTION_CHAR << 'b'; outputWord(os(), node->groveIndex()); outputWord(os(), n); } } } nPendingElementsNonEmpty_ = 0; pendingElements_.resize(0); pendingElementLevels_.resize(0); } void RtfFOTBuilder::startNode(const NodePtr &node, const StringC &mode) { nodeLevel_++; if (mode.size() == 0) { pendingElements_.push_back(node); pendingElementLevels_.push_back(nodeLevel_); } } void RtfFOTBuilder::endNode() { // The idea is not to put out a bookmark if there were // no flow objects associated with the node. // The flow objects might have been labeled, in which case // we will get a startNode for the node later. if (pendingElements_.size() > 0 && pendingElementLevels_.back() == nodeLevel_ && nPendingElementsNonEmpty_ < pendingElements_.size()) { pendingElementLevels_.resize(pendingElements_.size() - 1); pendingElements_.resize(pendingElements_.size() - 1); } nodeLevel_--; } void RtfFOTBuilder::currentNodePageNumber(const NodePtr &node) { inlinePrepare(); syncCharFormat(); GroveString id; unsigned long n; if (node->getId(id) == accessOK) { os() << "{\\field\\flddirty{\\*\\fldinst PAGEREF "; outputBookmarkName(node->groveIndex(), id.data(), id.size()); os() << "}{\\fldrslt 000}}"; } else if (node->elementIndex(n) == accessOK) { os() << "{\\field\\flddirty{\\*\\fldinst PAGEREF "; unsigned long groveIndex = node->groveIndex(); outputBookmarkName(groveIndex, n); elementsRefed_.add(groveIndex, n); os() << "}{\\fldrslt 000}}"; } } void RtfFOTBuilder::start() { nPendingElementsNonEmpty_ = pendingElements_.size(); specFormatStack_.push_back(specFormat_); if (!inSimplePageSequence_) pageFormatStack_.push_back(pageFormat_); } void RtfFOTBuilder::end() { specFormatStack_.resize(specFormatStack_.size() - 1); specFormat_ = specFormatStack_.back(); if (!inSimplePageSequence_) { pageFormatStack_.resize(pageFormatStack_.size() - 1); pageFormat_ = pageFormatStack_.back(); } } void RtfFOTBuilder::atomic() { nPendingElementsNonEmpty_ = pendingElements_.size(); specFormat_ = specFormatStack_.back(); } RtfFOTBuilder::CommonFormat::CommonFormat() : isBold(0), isItalic(0), fontSize(24), fontFamily(0), language(0), country(0), color(0), charBackgroundColor(0), underline(noUnderline), isStrikethrough(0), positionPointShift(0), kern(0), isSmallCaps(0), charBorder(0) { } RtfFOTBuilder::OutputFormat::OutputFormat() : charset(0), lang(DEFAULT_LANG), langCharsets(0x1f) { } RtfFOTBuilder::Format::Format() : fieldWidth(0), fieldAlign(symbolStart), displayAlignment('l'), inputWhitespaceTreatment(symbolPreserve), expandTabs(8), lineThickness(20), lineDouble(0), backgroundColor(0), boxHasBorder(1), boxHasBackground(0), borderPresent(1), borderPriority(0), borderOmitAtBreak(0), cellLeftMargin(0), cellRightMargin(0), cellTopMargin(0), cellBottomMargin(0), cellVerticalAlignment('t'), lineSpacingSpec(240), cellBackground(0), scoreSpaces(1), hyphenate(0), gridPosType(gridPosRowMajor), gridColumnAlignment('c'), gridRowSep(2), gridColumnSep(2), mathInline(0), mathPosture(0), superscriptHeight(5), subscriptDepth(3), overMarkHeight(10), underMarkDepth(10), span(0) { } RtfFOTBuilder::ParaFormat::ParaFormat() : leftIndent(0), rightIndent(0), firstLineIndent(0), quadding('l'), lineSpacing(240), lines(symbolWrap), lineSpacingAtLeast(0), widowOrphanControl(widowControl|orphanControl), headingLevel(0) { } RtfFOTBuilder::PageFormat::PageFormat() : leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0), headerMargin(0), footerMargin(0), pageHeight(72*20*11), pageWidth(72*10*17), pageNumberFormat("dec"), pageNumberRestart(0), nColumns(1), columnSep(72*10), balance(0) { } RtfFOTBuilder::FontFamilyCharsets::FontFamilyCharsets() { for (int i = 0; i < nWinCharsets; i++) rtfFontNumber[i] = -1; } ElementSet::ElementSet() { } void ElementSet::add(unsigned long groveIndex, unsigned long n) { if (groveIndex >= v_.size()) v_.resize(groveIndex + 1); Vector &elems = v_[groveIndex]; if (n >= elems.size()) { for (size_t k = 1 + (n - elems.size()); k > 0; --k) elems.push_back(0); } elems[n] = 1; } bool ElementSet::contains(unsigned long groveIndex, unsigned long n) const { return groveIndex < v_.size() && n < v_[groveIndex].size() && v_[groveIndex][n] != 0; } // This was mostly automatically generated using GetLocaleInfo(). unsigned RtfFOTBuilder::convertLanguage(unsigned language, unsigned country, unsigned &langCharsets) { if (language == 0) { langCharsets = 0x1f; return DEFAULT_LANG; } switch (language) { case SP_LETTER2('B', 'G'): langCharsets = 0x4; return 0x402; case SP_LETTER2('C', 'A'): langCharsets = 0x3; return 0x403; case SP_LETTER2('C', 'S'): langCharsets = 0x13; return 0x405; case SP_LETTER2('D', 'A'): langCharsets = 0x13; return 0x406; case SP_LETTER2('D', 'E'): langCharsets = 0x13; switch (country) { case SP_LETTER2('D', 'E'): return 0x407; case SP_LETTER2('C', 'H'): return 0x807; case SP_LETTER2('A', 'T'): return 0xc07; case SP_LETTER2('L', 'U'): return 0x1007; case SP_LETTER2('L', 'I'): return 0x1407; } return 0x407; case SP_LETTER2('E', 'L'): langCharsets = 0x8; return 0x408; case SP_LETTER2('E', 'N'): langCharsets = 0x1f; switch (country) { case SP_LETTER2('U', 'S'): return 0x409; case SP_LETTER2('G', 'B'): return 0x809; case SP_LETTER2('A', 'U'): return 0xc09; case SP_LETTER2('C', 'A'): return 0x1009; case SP_LETTER2('N', 'Z'): return 0x1409; case SP_LETTER2('I', 'E'): return 0x1809; case SP_LETTER2('Z', 'A'): return 0x1c09; case SP_LETTER2('J', 'M'): return 0x2009; case SP_LETTER2('C', 'B'): return 0x2409; case SP_LETTER2('B', 'Z'): return 0x2809; case SP_LETTER2('T', 'T'): return 0x2c09; } return 0x409; case SP_LETTER2('E', 'S'): langCharsets = 0x13; switch (country) { case SP_LETTER2('E', 'S'): return 0x40a; case SP_LETTER2('M', 'X'): return 0x80a; case SP_LETTER2('G', 'T'): return 0x100a; case SP_LETTER2('C', 'R'): return 0x140a; case SP_LETTER2('P', 'A'): return 0x180a; case SP_LETTER2('D', 'O'): return 0x1c0a; case SP_LETTER2('V', 'E'): return 0x200a; case SP_LETTER2('C', 'O'): return 0x240a; case SP_LETTER2('P', 'E'): return 0x280a; case SP_LETTER2('A', 'R'): return 0x2c0a; case SP_LETTER2('E', 'C'): return 0x300a; case SP_LETTER2('C', 'L'): return 0x340a; case SP_LETTER2('U', 'Y'): return 0x380a; case SP_LETTER2('P', 'Y'): return 0x3c0a; case SP_LETTER2('B', 'O'): return 0x400a; case SP_LETTER2('S', 'V'): return 0x440a; case SP_LETTER2('H', 'N'): return 0x480a; case SP_LETTER2('N', 'I'): return 0x4c0a; case SP_LETTER2('P', 'R'): return 0x500a; } return 0x40a; case SP_LETTER2('F', 'I'): langCharsets = 0x13; return 0x40b; case SP_LETTER2('F', 'R'): langCharsets = 0x13; switch (country) { case SP_LETTER2('F', 'R'): return 0x40c; case SP_LETTER2('B', 'E'): return 0x80c; case SP_LETTER2('C', 'A'): return 0xc0c; case SP_LETTER2('C', 'H'): return 0x100c; case SP_LETTER2('L', 'U'): return 0x140c; } return 0x40c; case SP_LETTER2('H', 'U'): langCharsets = 0x12; return 0x40e; case SP_LETTER2('I', 'S'): langCharsets = 0x3; return 0x40f; case SP_LETTER2('I', 'T'): langCharsets = 0x13; switch (country) { case SP_LETTER2('I', 'T'): return 0x410; case SP_LETTER2('C', 'H'): return 0x810; } return 0x410; case SP_LETTER2('N', 'L'): langCharsets = 0x13; switch (country) { case SP_LETTER2('N', 'L'): return 0x413; case SP_LETTER2('B', 'E'): return 0x813; } return 0x413; case SP_LETTER2('N', 'O'): langCharsets = 0x13; return 0x414; case SP_LETTER2('P', 'L'): langCharsets = 0x12; return 0x415; case SP_LETTER2('P', 'T'): langCharsets = 0x13; switch (country) { case SP_LETTER2('B', 'R'): return 0x416; case SP_LETTER2('P', 'T'): return 0x816; } return 0x416; case SP_LETTER2('R', 'O'): langCharsets = 0x12; return 0x418; case SP_LETTER2('R', 'U'): langCharsets = 0x4; return 0x419; case SP_LETTER2('H', 'R'): langCharsets = 0x12; // FIXME are langCharsets different here? switch (country) { case SP_LETTER2('H', 'R'): return 0x41a; case SP_LETTER2('S', 'P'): return 0x81a; } return 0x41a; case SP_LETTER2('S', 'K'): langCharsets = 0x12; return 0x41b; case SP_LETTER2('S', 'Q'): langCharsets = 0x12; return 0x41c; case SP_LETTER2('S', 'V'): langCharsets = 0x13; switch (country) { case SP_LETTER2('S', 'E'): return 0x41d; case SP_LETTER2('F', 'I'): return 0x81d; } return 0x41d; case SP_LETTER2('T', 'R'): langCharsets = 0x12; return 0x41f; case SP_LETTER2('I', 'D'): langCharsets = 0x13; return 0x421; case SP_LETTER2('U', 'K'): langCharsets = 0x4; return 0x422; case SP_LETTER2('B', 'E'): langCharsets = 0x4; return 0x423; case SP_LETTER2('S', 'L'): langCharsets = 0x12; return 0x424; case SP_LETTER2('E', 'T'): langCharsets = 0x12; return 0x425; case SP_LETTER2('L', 'V'): langCharsets = 0x12; return 0x426; case SP_LETTER2('L', 'T'): langCharsets = 0x12; return 0x427; case SP_LETTER2('V', 'I'): langCharsets = 0x13; return 0x42a; case SP_LETTER2('E', 'U'): langCharsets = 0x13; return 0x42d; case SP_LETTER2('A', 'F'): langCharsets = 0x1f; return 0x436; case SP_LETTER2('F', 'O'): langCharsets = 0x13; return 0x438; case SP_LETTER2('J', 'A'): langCharsets = (1 << jisCharset); return 0x411; } langCharsets = 0x1f; return DEFAULT_LANG; } const RtfFOTBuilder::WinCharset RtfFOTBuilder::winCharsets[RtfFOTBuilder::nWinCharsets] = { // CP 1252 { 0, "", { 0x0000, 0x0000, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000, 0x0000, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x0000, 0x0000, 0x0178, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff } }, // CP 1250 { 238, " CE", { 0x0000, 0x0000, 0x201a, 0x0000, 0x201e, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179, 0x0000, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0161, 0x203a, 0x015b, 0x0165, 0x017e, 0x017a, 0x00a0, 0x02c7, 0x02d8, 0x0141, 0x00a4, 0x0104, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x015e, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x017b, 0x00b0, 0x00b1, 0x02db, 0x0142, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x0105, 0x015f, 0x00bb, 0x013d, 0x02dd, 0x013e, 0x017c, 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 } }, // CP 1251 { 204, " CYR", { 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f } }, // CP 1253 { 161, " Greek", { 0x0000, 0x0000, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0000, 0x203a, 0x0000, 0x0000, 0x0000, 0x0000, 0x00a0, 0x0385, 0x0386, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x2015, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x00b5, 0x00b6, 0x00b7, 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000 } }, // CP 1254 { 162, " TUR", { 0x0000, 0x0000, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000, 0x0000, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x0000, 0x0000, 0x0178, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff } }, // Shift JIS Katakana { 128, "", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67, 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f, 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77, 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f, 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87, 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f, 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97, 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f } }, // This is the Symbol charset which is treated specially. // It must be last in this table. { 2, "" } }; const RtfFOTBuilder::SymbolFont RtfFOTBuilder::symbolFonts[RtfFOTBuilder::nSymbolFonts] = { { "Symbol", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x2206, 0x0395, 0x03A6, 0x0393, 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0, 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x2126, 0x039E, 0x03A8, 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F, 0x203E, 0x03B1, 0x03B2, 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03D5, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BF, 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03D6, 0x03C9, 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, 0x223C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D2, 0x2032, 0x2264, 0x2215, 0x221E, 0x0192, 0x2663, 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x2033, 0x2265, 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, 0x0000, 0x0000, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209, 0x2220, 0x2207, 0x00AE, 0x00A9, 0x2122, 0x220F, 0x221A, 0x22C5, 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA, 0x2329, 0x00AE, 0x00A9, 0x2122, 0x2211, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x232A, 0x222B, 0x2320, 0x0000, 0x2321, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 } }, // I created this table by hand. It's sometimes not obvious what // the appropriate mapping is. { "Wingdings", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2702, 0x2701, 0x0000, 0x0000, 0x0000, 0x0000, 0x260e, 0x2706, 0x2709, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2328, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2707, 0x270d, 0x0000, 0x270c, 0x0000, 0x0000, 0x0000, 0x261c, 0x261e, 0x261d, 0x261f, 0x0000, 0x263a, 0x0000, 0x2639, 0x0000, 0x2620, 0x0000, 0x0000, 0x2708, 0x263c, 0x0000, 0x2744, 0x0000, 0x271e, 0x0000, 0x2720, 0x2721, 0x262a, 0x262f, 0x0950, 0x2638, 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f, 0x2650, 0x2651, 0x2652, 0x2653, 0x0000, 0x0000, 0x25cf, 0x274d, 0x25a0, 0x25a1, 0x0000, 0x2751, 0x2752, 0x0000, 0x0000, 0x25c6, 0x2756, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, 0x2788, 0x2789, 0x0000, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f, 0x2790, 0x2791, 0x2792, 0x2793, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25cb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25aa, 0x0000, 0x0000, 0x2726, 0x2605, 0x2736, 0x0000, 0x2739, 0x0000, 0x0000, 0x0000, 0x2727, 0x0000, 0x0000, 0x272a, 0x2730, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x232b, 0x2326, 0x0000, 0x27a2, 0x0000, 0x0000, 0x0000, 0x27b2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25ab, 0x2718, 0x2714, 0x2612, 0x2611, 0x0000 } }, { "ZapfDingbats", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2701, 0x2702, 0x2703, 0x2704, 0x260E, 0x2706, 0x2707, 0x2708, 0x2709, 0x261B, 0x261E, 0x270C, 0x270D, 0x270E, 0x270F, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E, 0x271F, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 0x273A, 0x273B, 0x273C, 0x273D, 0x273E, 0x273F, 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274A, 0x274B, 0x0000, 0x274D, 0x25A0, 0x274F, 0x2750, 0x2751, 0x2752, 0x25B2, 0x25BC, 0x25C6, 0x2756, 0x0000, 0x2758, 0x2759, 0x275A, 0x275B, 0x275C, 0x275D, 0x275E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x277F, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E, 0x278F, 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195, 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F, 0x27A0, 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7, 0x27A8, 0x27A9, 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF, 0x0000, 0x27B1, 0x27B2, 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7, 0x27B8, 0x27B9, 0x27BA, 0x27BB, 0x27BC, 0x27BD, 0x27BE, 0x0000 } }, }; #ifdef DSSSL_NAMESPACE } #endif #include "RtfFOTBuilder_inst.cxx" OpenJade-1.4devel/jade/HtmlFOTBuilder.cxx0000644000021000000240000010320607031473536013750 // Copyright (c) 1996, 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef JADE_HTML #include "HtmlFOTBuilder.h" #include "FOTBuilder.h" #include #include #include #include #include #include #include #include "HtmlMessages.h" #include #include #include #include #include #include #include "dsssl_ns.h" #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class DiscardOutputCharStream : public OutputCharStream { public: DiscardOutputCharStream() { } void flush() { } void flushBuf(Char) { } }; const char RE = '\r'; class HtmlFOTBuilder : public SerialFOTBuilder { public: class OutputState; struct CharProps { CharProps(); static unsigned long hash(const CharProps &) { return 17; } bool operator==(const CharProps &cp) const { return (fontWeight == cp.fontWeight && fontStyle == cp.fontStyle && fontSize == cp.fontSize && fontFamily == cp.fontFamily && color == cp.color && textTransform == cp.textTransform); } bool operator!=(const CharProps &cp) const { return !(*this == cp); } char fontWeight; enum { styleNormal, styleItalic, styleOblique }; char fontStyle; unsigned color; Length fontSize; StringC fontFamily; enum { ttNone, ttUppercase, ttLowercase, ttCapitalize }; char textTransform; }; struct InheritParaProps { InheritParaProps(); enum { alignLeft, alignCenter, alignRight, alignJustify }; Length leftMargin; Length rightMargin; Length lineHeight; Length textIndent; char align; }; struct ParaProps : public InheritParaProps { ParaProps(const InheritParaProps &props) : InheritParaProps(props), topMargin(0) { } static unsigned long hash(const ParaProps &) { return 17; } bool operator==(const ParaProps &pp) const { return (leftMargin == pp.leftMargin && rightMargin == pp.rightMargin && lineHeight == pp.lineHeight && textIndent == pp.textIndent && topMargin == pp.topMargin && align == pp.align); } bool operator!=(const ParaProps &pp) const { return !(*this == pp); } Length topMargin; }; struct ClassPrefix { ClassPrefix(const StringC &s) : prefix(s), nCharClasses(0), nParaClasses(0) { } StringC prefix; unsigned nCharClasses; unsigned nParaClasses; static const StringC &key(const ClassPrefix &cp) { return cp.prefix; } }; struct StyleClass : public Link { StyleClass(const StringC &, ClassPrefix *); void outputName(OutputCharStream &) const; StringC gi; const ClassPrefix *prefix; unsigned prefixIndex; }; struct CharStyle; struct CharStyleClass : public StyleClass { CharStyleClass(const StringC &, ClassPrefix *, const CharStyle *); const CharStyle *style; }; struct CharStyle : public CharProps { CharStyle(const CharProps &cp) : CharProps(cp) { } void output(OutputCharStream &) const; static const CharProps &key(const CharStyle &style) { return style; } IList classes; }; struct ParaStyle; struct ParaStyleClass : public StyleClass { ParaStyleClass(const StringC &, ClassPrefix *, const ParaStyle *); const ParaStyle *style; }; struct ParaStyle : public ParaProps { ParaStyle(const ParaProps &pp) : ParaProps(pp) { } void output(OutputCharStream &) const; static const ParaProps &key(const ParaStyle &style) { return style; } IList classes; }; struct FlowObjectInfo : public CharProps, public InheritParaProps { FlowObjectInfo(); unsigned docIndex; ConstPtr > scrollTitle; Length parentLeftMargin; Length parentRightMargin; }; // An address that has been referenced. class AddressRef { public: virtual void outputRef(bool end, OutputCharStream &, OutputState &) const = 0; virtual ~AddressRef(); }; class UriRefAddressRef : public AddressRef, public Link { public: UriRefAddressRef(const StringC &uriRef) : uriRef_(uriRef) { } void outputRef(bool end, OutputCharStream &, OutputState &) const; private: StringC uriRef_; }; class OutputState { public: OutputState(const String *outputFilename, const StringC &styleSheetFilename, CmdLineApp *app) : outputFilename_(outputFilename), styleSheetFilename_(styleSheetFilename), app_(app), curAref_(0), specAref_(0), curCharStyleClass_(0), outputDocIndex_(unsigned(-1)) { } unsigned setOutputDocIndex(unsigned i) { unsigned tem = outputDocIndex_; outputDocIndex_ = i; return tem; } const AddressRef *setAddress(const AddressRef *aref) { const AddressRef *tem = specAref_; specAref_ = aref; return tem; } void syncChar(const CharStyleClass *, OutputCharStream &); unsigned outputDocIndex() const { return outputDocIndex_; } String outputFilename(unsigned i) const; const String &outputFilename() const { return *outputFilename_; } CmdLineApp &app() { return *app_; } const StringC &styleSheetFilename() const { return styleSheetFilename_; } const OutputCodingSystem *codingSystem() const { return app_->outputCodingSystem(); } Messenger &messenger() { return *app_; } private: const String *outputFilename_; CmdLineApp *app_; unsigned outputDocIndex_; const AddressRef *curAref_; const AddressRef *specAref_; const CharStyleClass *curCharStyleClass_; StringC styleSheetFilename_; }; class Item : public Link { public: Item() { } virtual ~Item(); virtual void output(OutputCharStream &, OutputState &) { } private: void operator=(const Item &); Item(const Item &); }; // Corresponds to class Addressable : public Item, public AddressRef { public: Addressable(size_t g, size_t e) : groveIndex_(g), elementIndex_(e), referenced_(0), docIndex_(unsigned(-1)) { } void outputRef(bool end, OutputCharStream &, OutputState &) const; void output(OutputCharStream &, OutputState &); bool defined() const { return docIndex_ != unsigned(-1); } bool referenced() const { return referenced_; } void setDefined(unsigned docIndex, bool wholeDocument = 0) { docIndex_ = docIndex; if (wholeDocument) elementIndex_ = (unsigned)-1; } void setReferenced() { referenced_ = 1; } private: size_t groveIndex_; // -1 if the whole document size_t elementIndex_; // unsigned(-1) if not defined unsigned docIndex_; bool referenced_; }; class Markup : public Item { public: Markup(const StringC &str) : str_(str) { } void output(OutputCharStream &, OutputState &); private: StringC str_; }; class Pcdata : public Item { public: Pcdata(const CharStyleClass *styleClass) : styleClass_(styleClass) { } void output(OutputCharStream &, OutputState &); private: const CharStyleClass *styleClass_; virtual const Char *data(size_t &) const = 0; }; class ImmediatePcdata : public Pcdata { public: ImmediatePcdata(const Char *s, size_t n, const CharStyleClass *styleClass) : Pcdata(styleClass), str_(s, n) { } private: const Char *data(size_t &n) const { n = str_.size(); return str_.data(); } StringC str_; }; class NodePcdata : public Pcdata { public: NodePcdata(const NodePtr &node, const Char *s, size_t n, const CharStyleClass *styleClass) : Pcdata(styleClass), node_(node), s_(s), n_(n) { } private: const Char *data(size_t &n) const { n = n_; return s_; } NodePtr node_; const Char *s_; size_t n_; }; class Container : public Item { public: Container() { } IList *contentPtr() { return &content_; } void output(OutputCharStream &, OutputState &); protected: void reverse(); // In reverse order while being built. IList content_; private: Container(const Container &); void operator=(const Container &); }; class Ref : public Container { public: Ref(AddressRef *aref) : aref_(aref) { } void output(OutputCharStream &, OutputState &); private: AddressRef *aref_; }; class Block : public Container { public: Block(const ParaStyleClass *styleClass) : styleClass_(styleClass) { } void output(OutputCharStream &, OutputState &); private: const ParaStyleClass *styleClass_; }; class Document : public Container { public: Document(unsigned index, const ConstPtr > &title) : index_(index), title_(title) { } ~Document(); void output(OutputCharStream &, OutputState &); private: ConstPtr > title_; unsigned index_; }; HtmlFOTBuilder(const String &, CmdLineApp *); ~HtmlFOTBuilder(); void setFontWeight(Symbol); void setFontPosture(Symbol); void setFontFamilyName(const StringC &); void setFontSize(Length); void setColor(const DeviceRGBColor &); void setCharMap(Symbol); void setQuadding(Symbol); void setLineSpacing(const LengthSpec &); void setFirstLineStartIndent(const LengthSpec &); void setStartIndent(const LengthSpec &); void setEndIndent(const LengthSpec &); void setScrollTitle(const StringC &); void formattingInstruction(const StringC &); void start(); void end(); void atomic(); void characters(const Char *s, size_t n); void charactersFromNode(const NodePtr &, const Char *s, size_t n); void startParagraph(const ParagraphNIC &nic); void endParagraph(); void startLink(const Address &); void endLink(); void startScroll(); void endScroll(); void startNode(const NodePtr &, const StringC &); void endNode(); void flushPendingAddresses(); static void outputCdata(const Char *, size_t, OutputCharStream &); static void outputCdata(const StringC &s, OutputCharStream &os) { outputCdata(s.data(), s.size(), os); } static void outputLength(FOTBuilder::Length n, OutputCharStream &); private: HtmlFOTBuilder(const HtmlFOTBuilder &); void operator=(const HtmlFOTBuilder &); struct DestInfo : public Link { DestInfo(IList *p) : list(p) { } IList *list; }; void insertAddr(size_t, size_t); void outputStyleSheet(StringC &); void startDisplay(const DisplayNIC &); void endDisplay(); Addressable *elementAddress(size_t g, size_t e); const CharStyleClass *makeCharStyleClass(); const ParaStyleClass *makeParaStyleClass(); ClassPrefix *makeClassPrefix(const StringC &); OwnerTable charStyleTable_; OwnerTable paraStyleTable_; OwnerTable prefixTable_; Vector flowObjectStack_; FlowObjectInfo nextFlowObject_; IList destStack_; IList *dest_; Container root_; // Number of HTML documents unsigned nDocuments_; Vector > elements_; Vector > pendingAddr_; String outputFilename_; CmdLineApp *app_; Vector giStack_; Length topMargin_; Vector spaceAfterStack_; // For URI Ref links. This is just to get them deleted. IList uriRefs_; }; FOTBuilder *makeHtmlFOTBuilder(const String &outputFilename, CmdLineApp *app, const FOTBuilder::Description *&descr) { static const FOTBuilder::Extension extensions[] = { { "UNREGISTERED::James Clark//Characteristic::scroll-title", 0, (void (FOTBuilder::*)(const StringC &))&HtmlFOTBuilder::setScrollTitle }, { 0, 0, 0} }; static const FOTBuilder::Feature features[] = { { "online", 1}, { 0, 0} }; static const char *media[] = { "screen", 0 }; static const FOTBuilder::Description description = { extensions, features, false, media }; descr = &description; return new HtmlFOTBuilder(outputFilename, app); } static void reverse(IList &list) { IList tem; while (!list.empty()) tem.insert(list.get()); tem.swap(list); } HtmlFOTBuilder::HtmlFOTBuilder(const String &outputFilename, CmdLineApp *app) : outputFilename_(outputFilename), app_(app), nDocuments_(0), giStack_(1), topMargin_(0) { flowObjectStack_.push_back(nextFlowObject_); dest_ = root_.contentPtr(); giStack_[0] += 'S'; } HtmlFOTBuilder::~HtmlFOTBuilder() { reverse(*dest_); while (!destStack_.empty()) { reverse(*destStack_.head()->list); delete destStack_.get(); } StringC styleSheetFilename; outputStyleSheet(styleSheetFilename); OutputState state(&outputFilename_, styleSheetFilename, app_); DiscardOutputCharStream os; root_.output(os, state); for (size_t i = 0; i < elements_.size(); i++) { for (size_t j = 0; j < elements_[i].size(); j++) if (elements_[i][j] && !elements_[i][j]->defined()) delete elements_[i][j]; } } void HtmlFOTBuilder::outputStyleSheet(StringC &styleSheetFilename) { String filename(outputFilename_); for (size_t j = 0; j < 5; j++) { if (filename.size() < j + 1) break; Char c = filename[filename.size() - j - 1]; if (c == '/' || c == '\\') break; if (c == '.') { filename.resize(filename.size() - j - 1); break; } } filename += '.'; filename += 'c'; filename += 's'; filename += 's'; filename += 0; FileOutputByteStream file; if (!file.open(filename.data())) { app_->message(HtmlMessages::cannotOpenOutputError, StringMessageArg(app_->convertInput(filename.data())), ErrnoMessageArg(errno)); return; } styleSheetFilename = app_->convertInput(filename.data()); RecordOutputCharStream os(new EncodeOutputCharStream(&file, app_->outputCodingSystem())); { OwnerTableIter iter(charStyleTable_); for (;;) { const CharStyle *style = iter.next(); if (!style) break; style->output(os); } } os << "DIV { margin-top: 0pt; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt }" << RE; { OwnerTableIter iter(paraStyleTable_); for (;;) { const ParaStyle *style = iter.next(); if (!style) break; style->output(os); } } } void HtmlFOTBuilder::CharStyle::output(OutputCharStream &os) const { bool first = 1; for (IListIter iter(classes); !iter.done(); iter.next()) { if (first) first = 0; else os << ", "; os << "SPAN."; iter.cur()->outputName(os); } if (!first) { os << " {" << RE; static const char indent[] = " "; // Netscape Communicator preview release 2 can't handle quoted font family names. os << indent << "font-family: " << fontFamily << ';' << RE; os << indent << "font-weight: " << int(fontWeight) << "00;" << RE; static const char *styleNames[3] = { "normal", "italic", "oblique" }; os << indent << "font-style: " << styleNames[fontStyle] << ';' << RE; os << indent << "font-size: "; outputLength(fontSize, os); os << ';' << RE; os << indent << "color: #"; for (int i = 20; i >= 0; i -= 4) os << "0123456789abcdef"[(color >> i) & 0xf]; os << ';' << RE; static const char *textTransformNames[4] = { "none", "uppercase", "lowercase", "capitalize" }; os << indent << "text-transform: " << textTransformNames[textTransform] << ';' << RE; os << '}' << RE; } } void HtmlFOTBuilder::ParaStyle::output(OutputCharStream &os) const { bool first = 1; for (IListIter iter(classes); !iter.done(); iter.next()) { if (first) first = 0; else os << ", "; os << "DIV."; iter.cur()->outputName(os); } if (!first) { os << " {" << RE; static const char indent[] = " "; if (leftMargin) { os << indent << "margin-left: "; outputLength(leftMargin, os); os << ';' << RE; } if (rightMargin) { os << indent << "margin-right: "; outputLength(rightMargin, os); os << ';' << RE; } if (topMargin) { os << indent << "margin-top: "; outputLength(topMargin, os); os << ';' << RE; } static const char *alignNames[4] = { "left", "center", "right", "justify" }; os << indent << "text-align: " << alignNames[align] << ';' << RE; os << indent << "line-height: "; outputLength(lineHeight, os); os << ';' << RE; os << indent << "text-indent: "; outputLength(textIndent, os); os << ';' << RE; os << '}' << RE; } } void HtmlFOTBuilder::outputLength(FOTBuilder::Length n, OutputCharStream &os) { char buf[32]; sprintf(buf, "%04ld", long(n)); char *end = strchr(buf, '\0'); for (int i = 0; i < 4; i++) end[1 - i] = end[-i]; end[-3] = '.'; while (*end == '0') *end-- = '\0'; if (*end == '.') *end = '\0'; strcat(buf, "pt"); os << buf; } void HtmlFOTBuilder::start() { flowObjectStack_.push_back(nextFlowObject_); } void HtmlFOTBuilder::end() { flowObjectStack_.resize(flowObjectStack_.size() - 1); nextFlowObject_ = flowObjectStack_.back(); } void HtmlFOTBuilder::atomic() { nextFlowObject_ = flowObjectStack_.back(); } void HtmlFOTBuilder::formattingInstruction(const StringC &s) { dest_->insert(new Markup(s)); atomic(); } const HtmlFOTBuilder::CharStyleClass *HtmlFOTBuilder::makeCharStyleClass() { CharStyle *style = charStyleTable_.lookup(nextFlowObject_); if (!style) { style = new CharStyle(nextFlowObject_); charStyleTable_.insert(style); } for (IListIter iter(style->classes); !iter.done(); iter.next()) if (iter.cur()->gi == giStack_.back()) return iter.cur(); ClassPrefix *prefix = makeClassPrefix(giStack_.back()); CharStyleClass *sc = new CharStyleClass(giStack_.back(), prefix, style); style->classes.insert(sc); return sc; } const HtmlFOTBuilder::ParaStyleClass *HtmlFOTBuilder::makeParaStyleClass() { ParaProps props(nextFlowObject_); props.topMargin = topMargin_; topMargin_ = 0; ParaStyle *style = paraStyleTable_.lookup(props); if (!style) { style = new ParaStyle(props); paraStyleTable_.insert(style); } for (IListIter iter(style->classes); !iter.done(); iter.next()) if (iter.cur()->gi == giStack_.back()) return iter.cur(); ClassPrefix *prefix = makeClassPrefix(giStack_.back()); ParaStyleClass *sc = new ParaStyleClass(giStack_.back(), prefix, style); style->classes.insert(sc); return sc; } HtmlFOTBuilder::StyleClass::StyleClass(const StringC &g, ClassPrefix *pfx) : gi(g), prefix(pfx), prefixIndex(pfx->nCharClasses + pfx->nParaClasses + 1) { } HtmlFOTBuilder::CharStyleClass::CharStyleClass(const StringC &g, ClassPrefix *pfx, const CharStyle *s) : StyleClass(g, pfx), style(s) { pfx->nCharClasses += 1; } HtmlFOTBuilder::ParaStyleClass::ParaStyleClass(const StringC &g, ClassPrefix *pfx, const ParaStyle *s) : StyleClass(g, pfx), style(s) { pfx->nParaClasses += 1; } HtmlFOTBuilder::ClassPrefix *HtmlFOTBuilder::makeClassPrefix(const StringC &gi) { // FIXME strip illegal characters ClassPrefix *prefix = prefixTable_.lookup(gi); if (!prefix) { prefix = new ClassPrefix(gi); prefixTable_.insert(prefix); } return prefix; } void HtmlFOTBuilder::charactersFromNode(const NodePtr &node, const Char *s, size_t n) { flushPendingAddresses(); dest_->insert(new NodePcdata(node, s, n, makeCharStyleClass())); } void HtmlFOTBuilder::characters(const Char *s, size_t n) { flushPendingAddresses(); dest_->insert(new ImmediatePcdata(s, n, makeCharStyleClass())); } void HtmlFOTBuilder::startParagraph(const ParagraphNIC &nic) { startDisplay(nic); Block *block = new Block(makeParaStyleClass()); nextFlowObject_.parentLeftMargin += nextFlowObject_.leftMargin; nextFlowObject_.parentRightMargin += nextFlowObject_.rightMargin; nextFlowObject_.leftMargin = 0; nextFlowObject_.rightMargin = 0; dest_->insert(block); destStack_.insert(new DestInfo(dest_)); dest_ = block->contentPtr(); start(); } void HtmlFOTBuilder::endParagraph() { reverse(*dest_); dest_ = destStack_.head()->list; delete destStack_.get(); end(); endDisplay(); } void HtmlFOTBuilder::startDisplay(const DisplayNIC &nic) { Length spaceBefore = nic.spaceBefore.nominal.length; if (spaceBefore > topMargin_) topMargin_ = spaceBefore; spaceAfterStack_.push_back(nic.spaceAfter.nominal.length); } void HtmlFOTBuilder::endDisplay() { const Length &spaceAfter = spaceAfterStack_.back(); if (spaceAfter > topMargin_) topMargin_ = spaceAfter; spaceAfterStack_.resize(spaceAfterStack_.size() - 1); } void HtmlFOTBuilder::startScroll() { nextFlowObject_.docIndex = nDocuments_++; start(); Document *doc = new Document(nextFlowObject_.docIndex, nextFlowObject_.scrollTitle); dest_->insert(doc); destStack_.insert(new DestInfo(dest_)); dest_ = doc->contentPtr(); if (pendingAddr_.size()) { Vector &v = pendingAddr_.back(); for (size_t i = 0; i < v.size(); i += 2) { Addressable *tem = elementAddress(v[i], v[i + 1]); if (!tem->defined()) { dest_->insert(tem); tem->setDefined(nextFlowObject_.docIndex, 1); } } v.resize(0); } } void HtmlFOTBuilder::endScroll() { reverse(*dest_); dest_ = destStack_.head()->list; delete destStack_.get(); end(); } void HtmlFOTBuilder::startLink(const Address &addr) { start(); AddressRef *aref = 0; switch (addr.type) { case Address::resolvedNode: { unsigned long n; if (addr.node->elementIndex(n) == accessOK) { Addressable *tem = elementAddress(addr.node->groveIndex(), n); tem->setReferenced(); aref = tem; } break; } case Address::idref: { const StringC &id = addr.params[0]; size_t i; for (i = 0; i < id.size(); i++) if (id[i] == ' ') break; NodePtr node; NamedNodeListPtr elements; unsigned long n; if (addr.node->getGroveRoot(node) == accessOK && node->getElements(elements) == accessOK && elements->namedNode(GroveString(id.data(), i), node) == accessOK && node->elementIndex(n) == accessOK) { Addressable *tem = elementAddress(addr.node->groveIndex(), n); tem->setReferenced(); aref = tem; } break; } case Address::html: uriRefs_.insert(new UriRefAddressRef(addr.params[0])); aref = uriRefs_.head(); break; default: break; } Ref *ref = new Ref(aref); dest_->insert(ref); destStack_.insert(new DestInfo(dest_)); dest_ = ref->contentPtr(); } void HtmlFOTBuilder::endLink() { reverse(*dest_); dest_ = destStack_.head()->list; delete destStack_.get(); end(); } HtmlFOTBuilder::Addressable *HtmlFOTBuilder::elementAddress(size_t g, size_t e) { if (g >= elements_.size()) elements_.resize(g + 1); Vector &v = elements_[g]; for (size_t i = v.size(); i <= e; i++) v.push_back((Addressable *)0); if (!v[e]) v[e] = new Addressable(g, e); return v[e]; } void HtmlFOTBuilder::startNode(const NodePtr &node, const StringC &mode) { pendingAddr_.resize(pendingAddr_.size() + 1); if (mode.size() == 0) { if (pendingAddr_.size() > 1) pendingAddr_.back() = pendingAddr_[pendingAddr_.size() - 2]; unsigned long n; if (node->elementIndex(n) == accessOK) { pendingAddr_.back().push_back(node->groveIndex()); pendingAddr_.back().push_back(size_t(n)); } } giStack_.resize(giStack_.size() + 1); GroveString str; if (node->getGi(str) == accessOK) giStack_.back().assign(str.data(), str.size()); else if (giStack_.size() >= 2) giStack_.back() = giStack_[giStack_.size() - 2]; } void HtmlFOTBuilder::endNode() { pendingAddr_.resize(pendingAddr_.size() - 1); giStack_.resize(giStack_.size() - 1); } void HtmlFOTBuilder::insertAddr(size_t g, size_t e) { Addressable *tem = elementAddress(g, e); if (!tem->defined() && nextFlowObject_.docIndex != (unsigned)-1) { dest_->insert(tem); tem->setDefined(nextFlowObject_.docIndex); } } void HtmlFOTBuilder::setLineSpacing(const LengthSpec &val) { nextFlowObject_.lineHeight = val.length; } void HtmlFOTBuilder::setQuadding(Symbol sym) { switch (sym) { case symbolStart: nextFlowObject_.align = ParaProps::alignLeft; break; case symbolEnd: nextFlowObject_.align = ParaProps::alignRight; break; case symbolCenter: nextFlowObject_.align = ParaProps::alignCenter; break; case symbolJustify: nextFlowObject_.align = ParaProps::alignJustify; break; default: break; } } void HtmlFOTBuilder::setFirstLineStartIndent(const LengthSpec &ls) { nextFlowObject_.textIndent = ls.length; } void HtmlFOTBuilder::setStartIndent(const LengthSpec &ls) { nextFlowObject_.leftMargin = ls.length - nextFlowObject_.parentLeftMargin; } void HtmlFOTBuilder::setEndIndent(const LengthSpec &ls) { nextFlowObject_.rightMargin = ls.length - nextFlowObject_.parentRightMargin; } void HtmlFOTBuilder::setFontFamilyName(const StringC &name) { nextFlowObject_.fontFamily = name; } void HtmlFOTBuilder::setFontWeight(Symbol weight) { switch (weight) { case symbolUltraLight: nextFlowObject_.fontWeight = 1; break; case symbolExtraLight: nextFlowObject_.fontWeight = 2; break; case symbolLight: nextFlowObject_.fontWeight = 3; break; case symbolSemiLight: nextFlowObject_.fontWeight = 4; break; case symbolMedium: nextFlowObject_.fontWeight = 5; break; case symbolSemiBold: nextFlowObject_.fontWeight = 6; break; case symbolBold: nextFlowObject_.fontWeight = 7; break; case symbolExtraBold: nextFlowObject_.fontWeight = 8; break; case symbolUltraBold: nextFlowObject_.fontWeight = 9; break; default: break; } } void HtmlFOTBuilder::setFontPosture(Symbol posture) { switch (posture) { case symbolOblique: nextFlowObject_.fontStyle = CharProps::styleOblique; break; case symbolItalic: nextFlowObject_.fontStyle = CharProps::styleItalic; break; default: nextFlowObject_.fontStyle = CharProps::styleNormal; break; } } void HtmlFOTBuilder::setFontSize(Length n) { nextFlowObject_.fontSize = n; } void HtmlFOTBuilder::setColor(const DeviceRGBColor &color) { nextFlowObject_.color = (color.red << 16) | (color.green << 8) | color.blue; } void HtmlFOTBuilder::setCharMap(Symbol sym) { switch(sym) { case symbolFalse: nextFlowObject_.textTransform = CharProps::ttNone; break; case symbolUppercase: nextFlowObject_.textTransform = CharProps::ttUppercase; break; case symbolLowercase: nextFlowObject_.textTransform = CharProps::ttLowercase; break; case symbolCapitalize: nextFlowObject_.textTransform = CharProps::ttCapitalize; break; default: CANNOT_HAPPEN(); } } void HtmlFOTBuilder::setScrollTitle(const StringC &s) { nextFlowObject_.scrollTitle = new StringResource(s); } void HtmlFOTBuilder::flushPendingAddresses() { if (pendingAddr_.size()) { for (size_t i = 0; i < pendingAddr_.back().size(); i += 2) insertAddr(pendingAddr_.back()[i], pendingAddr_.back()[i + 1]); pendingAddr_.back().resize(0); } } void HtmlFOTBuilder::outputCdata(const Char *s, size_t n, OutputCharStream &os) { for (; n > 0; n--, s++) { switch (*s) { case '\n': break; case '&': os << "&"; break; case '<': os << "<"; break; case '>': os << ">"; break; case '\r': os << RE; break; default: if (*s >= 255) os << "&#" << (unsigned long)*s << ';'; else os.put(*s); break; } } } void HtmlFOTBuilder::Document::output(OutputCharStream &, OutputState &oldState) { OutputState state(&oldState.outputFilename(), oldState.styleSheetFilename(), &oldState.app()); FileOutputByteStream file; String filename(state.outputFilename(index_)); filename += 0; if (!file.open(filename.data())) { state.messenger() .message(HtmlMessages::cannotOpenOutputError, StringMessageArg(state.app().convertInput(filename.data())), ErrnoMessageArg(errno)); return; } RecordOutputCharStream os(new EncodeOutputCharStream(&file, state.app().outputCodingSystem())); // FIXME setEscaper unsigned oldDocIndex = state.setOutputDocIndex(index_); os << "" << RE; const StringC &styleSheetFilename = state.styleSheetFilename(); if (styleSheetFilename.size()) { os << " 0; i--) if (styleSheetFilename[i - 1] == '\\' || styleSheetFilename[i - 1] == '/') break; os.write(styleSheetFilename.data() + i, styleSheetFilename.size() - i); os << "\">" << RE; } if (!title_.isNull()) { os << ""; HtmlFOTBuilder::outputCdata(*title_, os); os << ""; } os << "" << RE; Container::output(os, state); os << "" << RE; os << "" << RE; state.setOutputDocIndex(oldDocIndex); } void HtmlFOTBuilder::Container::output(OutputCharStream &os, OutputState &state) { for (IListIter iter(content_); !iter.done(); iter.next()) iter.cur()->output(os, state); } void HtmlFOTBuilder::Block::output(OutputCharStream &os, OutputState &state) { const AddressRef *addr = state.setAddress(0); state.syncChar(0, os); os << "
"; state.setAddress(addr); } void HtmlFOTBuilder::Ref::output(OutputCharStream &os, OutputState &state) { const AddressRef *oldAref = state.setAddress(aref_); Container::output(os, state); state.setAddress(oldAref); } void HtmlFOTBuilder::Pcdata::output(OutputCharStream &os, OutputState &state) { size_t n; const Char *s = data(n); state.syncChar(styleClass_, os); HtmlFOTBuilder::outputCdata(s, n, os); } void HtmlFOTBuilder::Markup::output(OutputCharStream &os, OutputState &state) { state.syncChar(0, os); os << str_; } void HtmlFOTBuilder::Addressable::output(OutputCharStream &os, OutputState &) { ASSERT(defined()); if (referenced_ && elementIndex_ != (unsigned)-1) { os << ""; } } void HtmlFOTBuilder::Addressable::outputRef(bool end, OutputCharStream &os, OutputState &state) const { ASSERT(referenced_); if (defined()) { if (end) os << ""; else { os << " &outputFilename = state.outputFilename(docIndex_); size_t i = outputFilename.size(); for (; i > 0; i--) if (outputFilename[i - 1] == '\\' || outputFilename[i - 1] == '/') break; for (; i < outputFilename.size(); i++) os.put(outputFilename[i]); } if (elementIndex_ != (unsigned)-1) { os << "#"; if (groveIndex_) os << (unsigned long)groveIndex_ << '.'; os << (unsigned long)elementIndex_; } os << "\">"; } } } String HtmlFOTBuilder::OutputState::outputFilename(unsigned index) const { if (index == 0) return *outputFilename_; String base(*outputFilename_); String ext; for (size_t j = 0; j < 5; j++) { if (base.size() < j + 1) break; Char c = base[base.size() - j - 1]; if (c == '/' || c == '\\') break; if (c == '.') { ext.assign(base.data() + (base.size() - j - 1), j + 1); base.resize(base.size() - j - 1); break; } } char buf[32]; sprintf(buf, "%u", index); for (const char *p = buf; *p; p++) base += CmdLineApp::AppChar(*p); base += ext; return base; } void HtmlFOTBuilder::OutputState::syncChar(const CharStyleClass *styleClass, OutputCharStream &os) { // ... if (curAref_ != specAref_) { if (curCharStyleClass_) { os << ""; curCharStyleClass_ = 0; } if (curAref_) curAref_->outputRef(1, os, *this); if (specAref_) specAref_->outputRef(0, os, *this); curAref_ = specAref_; } if (curCharStyleClass_ != styleClass) { if (curCharStyleClass_) os << ""; if (styleClass) { os << ""; else os << ""; } HtmlFOTBuilder::Item::~Item() { } HtmlFOTBuilder::Document::~Document() { } HtmlFOTBuilder::CharProps::CharProps() : fontWeight(5), color(0), fontStyle(styleNormal), fontSize(10*1000), textTransform(ttNone) { for (const char *p = "Times New Roman,serif"; *p; p++) fontFamily += *p; } HtmlFOTBuilder::InheritParaProps::InheritParaProps() : leftMargin(0), rightMargin(0), align(alignLeft), lineHeight(12*1000), textIndent(0) { } HtmlFOTBuilder::FlowObjectInfo::FlowObjectInfo() : docIndex(unsigned(-1)), parentLeftMargin(0), parentRightMargin(0) { } void HtmlFOTBuilder::StyleClass::outputName(OutputCharStream &os) const { os << prefix->prefix; if (prefix->nCharClasses > 1 || prefix->nParaClasses > 1) os << (unsigned long)prefixIndex; } #ifdef DSSSL_NAMESPACE } #endif #include "HtmlFOTBuilder_inst.cxx" #endif /* JADE_HTML */ OpenJade-1.4devel/jade/TeXFOTBuilder.cxx0000644000021000000240000034766307034614231013555 // TeXFotBuilder.cxx: a Generic TeX backend for Jade // Written by David Megginson // With changes from Sebastian Rahtz // Last Modification: August 6th, 1998 // Table Support: Kathleen Marszalek // Version: 1.0b7 // Last Modification: July 7th, 1998 #include "config.h" #include "TeXFOTBuilder.h" #include "TeXMessages.h" #include #include "TmpOutputByteStream.h" #include "dsssl_ns.h" #include #include #undef TEXDEBUG #undef NDEBUG #define OUTLINES #undef DEBUG_OUTLINES #ifdef DEBUG_OUTLINES #include #endif #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif // --------- TeXTmpOutputByteStream ------------------------------------------ struct TeXTmpOutputByteStream : public TmpOutputByteStream { TeXTmpOutputByteStream() : TmpOutputByteStream() {} void commit( OutputByteStream &os ) const; }; // ---------------------------------------------------------------------------- struct LengthInPoints { LengthInPoints( long l_ ) : l( l_ ) {} long l; }; void TeXTmpOutputByteStream::commit( OutputByteStream &os ) const { TmpOutputByteStream::Iter iter( *this ); const char *s; size_t n; while( iter.next( s, n ) ) { os.sputn( s, n ); } } // --------- TeXFOTBuilder ---------------------------------------------------- class TeXFOTBuilder : public SerialFOTBuilder { public: #ifdef TEXDEBUG static TeXFOTBuilder &curInstance() { assert( CurInstance != NULL ); return *CurInstance; } // used for testing only: otherwise code is re-entrant #endif struct PageFloatNIC { ~PageFloatNIC(); StringC placement; }; class TeXExtensionFlowObj : public FOTBuilder::ExtensionFlowObj { public: virtual void atomic(TeXFOTBuilder &, const NodePtr &) const = 0; }; class TeXCompoundExtensionFlowObj : public FOTBuilder::CompoundExtensionFlowObj { public: virtual void start(TeXFOTBuilder &, const NodePtr &) const = 0; virtual void end(TeXFOTBuilder &) const = 0; }; class PageFloatFlowObj : public TeXCompoundExtensionFlowObj { void start(TeXFOTBuilder &fotb, const NodePtr &) const { fotb.startPageFloat(nic_); } void end(TeXFOTBuilder &fotb) const { fotb.endPageFloat(); } bool hasNIC(const StringC &name) const { return name == "placement" ; } void setNIC(const StringC &, const Value &value) { value.convertString(nic_.placement); } ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); } private: PageFloatNIC nic_; StringC name_; StringC placement; }; class PageFootnoteFlowObj : public TeXCompoundExtensionFlowObj { void start(TeXFOTBuilder &fotb, const NodePtr &) const { fotb.startPageFootnote(); } void end(TeXFOTBuilder &fotb) const { fotb.endPageFootnote(); } ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); } private: }; ////////////////////////////////////////////////////////////////////// // Constructor and destructor. ////////////////////////////////////////////////////////////////////// TeXFOTBuilder(OutputByteStream *, Messenger *mgr); ~TeXFOTBuilder(); //// Needed for heading levels ////////////////////////////////////////////////////////////////////// // Atomic flow objects ////////////////////////////////////////////////////////////////////// void extension(const ExtensionFlowObj &fo, const NodePtr &); void startExtensionSerial(const CompoundExtensionFlowObj &fo, const NodePtr &nd); void endExtensionSerial(const CompoundExtensionFlowObj &fo); void start(); void end(); void charactersFromNode(const NodePtr &, const Char *, size_t); void setPreserveSdata(bool); void startPageFloat(const PageFloatNIC &); void endPageFloat(); void setPageFloatNIC(const PageFloatNIC &); void startPageFootnote(); void endPageFootnote(); void characters(const Char *, size_t); void character(const CharacterNIC &); void paragraphBreak(const ParagraphNIC &); void externalGraphic(const ExternalGraphicNIC &); void rule(const RuleNIC &); void alignmentPoint(); void pageNumber(); void formattingInstruction(const StringC &); void tableColumn(const TableColumnNIC &); void tableCellBeforeRowBorder(); void tableCellAfterRowBorder(); void tableCellBeforeColumnBorder(); void tableCellAfterColumnBorder(); void fractionBar(); void radicalRadical(const CharacterNIC &); void radicalRadicalDefaulted(); void currentNodePageNumber(const NodePtr &); ////////////////////////////////////////////////////////////////////// // Non-atomic flow objects ////////////////////////////////////////////////////////////////////// void startSequence(); void endSequence(); void startLineField(const LineFieldNIC &); void endLineField(); void startParagraph(const ParagraphNIC &); void endParagraph(); void startDisplayGroup(const DisplayGroupNIC &); void endDisplayGroup(); void startScroll(); void endScroll(); void startScore(Char); void startScore(const LengthSpec &); void startScore(Symbol); void endScore(); void startLeader(const LeaderNIC &); void endLeader(); void startSideline(); void endSideline(); void startBox(const BoxNIC &); void endBox(); // Tables void startTable(const TableNIC &); void endTable(); // A call for each border is made immediately // after startTable(), each preceded by any appropriate set*() calls. void tableBeforeRowBorder(); void tableAfterRowBorder(); void tableBeforeColumnBorder(); void tableAfterColumnBorder(); void startTablePartSerial(const TablePartNIC &); void endTablePartSerial(); void startTableRow(); void endTableRow(); void startTableCell(const TableCellNIC &); void endTableCell(); void startSimplePageSequenceSerial(); void endSimplePageSequenceSerial(); // Headers and footers are treated like a separate port. void startSimplePageSequenceHeaderFooter(unsigned); void endSimplePageSequenceHeaderFooter(unsigned); // page-number sosofo void startTablePartHeader(); void endTablePartHeader(); void startTablePartFooter(); void endTablePartFooter(); void startMathSequence(); void endMathSequence(); void startFractionSerial(); void endFractionSerial(); void startFractionNumerator(); void endFractionNumerator(); void startFractionDenominator(); void endFractionDenominator(); void startUnmath(); void endUnmath(); void startSuperscript(); void endSuperscript(); void startSubscript(); void endSubscript(); void startScriptSerial(); void endScriptSerial(); void startScriptPreSup(); void endScriptPreSup(); void startScriptPreSub(); void endScriptPreSub(); void startScriptPostSup(); void endScriptPostSup(); void startScriptPostSub(); void endScriptPostSub(); void startScriptMidSup(); void endScriptMidSup(); void startScriptMidSub(); void endScriptMidSub(); void startMarkSerial(); void endMarkSerial(); void startMarkOver(); void endMarkOver(); void startMarkUnder(); void endMarkUnder(); void startFenceSerial(); void endFenceSerial(); void startFenceOpen(); void endFenceOpen(); void startFenceClose(); void endFenceClose(); void startRadicalSerial(); void endRadicalSerial(); void startRadicalDegree(); void endRadicalDegree(); void startMathOperatorSerial(); void endMathOperatorSerial(); void startMathOperatorOperator(); void endMathOperatorOperator(); void startMathOperatorLowerLimit(); void endMathOperatorLowerLimit(); void startMathOperatorUpperLimit(); void endMathOperatorUpperLimit(); void startGrid(const GridNIC &); void endGrid(); void startGridCell(const GridCellNIC &); void endGridCell(); void startNode(const NodePtr &, const StringC &); void endNode(); void startLink(const Address &); void endLink(); ////////////////////////////////////////////////////////////////////// // Inherited characteristics // Set the value of the characteristic for the next flow object. // Inherited characteristics that are not explicitly set have // the same value as the parent flow object. ////////////////////////////////////////////////////////////////////// void setFontSize(Length); void setFontFamilyName(const StringC &); void setFontWeight(Symbol); void setFontPosture(Symbol); void setStartIndent(const LengthSpec &); void setEndIndent(const LengthSpec &); void setFirstLineStartIndent(const LengthSpec &); void setLastLineEndIndent(const LengthSpec &); void setLineSpacing(const LengthSpec &); void setFieldWidth(const LengthSpec &); void setMarginaliaSep(const LengthSpec &); void setLines(Symbol); void setQuadding(Symbol); void setDisplayAlignment(Symbol); void setFieldAlign(Symbol); void setColor(const DeviceRGBColor &); void setBackgroundColor(); // background of #f void setBackgroundColor(const DeviceRGBColor &); void setBorderPresent(bool); void setLineThickness(Length); void setCellBeforeRowMargin(Length); void setCellAfterRowMargin(Length); void setCellBeforeColumnMargin(Length); void setCellAfterColumnMargin(Length); void setLineSep(Length); void setBoxSizeBefore(Length); void setBoxSizeAfter(Length); void setPositionPointShift(const LengthSpec &); void setStartMargin(const LengthSpec &); void setEndMargin(const LengthSpec &); void setSidelineSep(const LengthSpec &); void setAsisWrapIndent(const LengthSpec &); void setLineNumberSep(const LengthSpec &); void setLastLineJustifyLimit(const LengthSpec &); void setJustifyGlyphSpaceMaxAdd(const LengthSpec &); void setJustifyGlyphSpaceMaxRemove(const LengthSpec &); void setTableCornerRadius(const LengthSpec &); void setBoxCornerRadius(const LengthSpec &); void setInhibitLineBreaks(bool); void setHyphenate(bool); void setKern(bool); void setLigature(bool); void setScoreSpaces(bool); void setFloatOutMarginalia(bool); void setFloatOutSidelines(bool); void setFloatOutLineNumbers(bool); void setCellBackground(bool); void setSpanWeak(bool); void setIgnoreRecordEnd(bool); void setNumberedLines(bool); void setHangingPunct(bool); void setBoxOpenEnd(bool); void setTruncateLeader(bool); void setAlignLeader(bool); void setTablePartOmitMiddleHeader(bool); void setTablePartOmitMiddleFooter(bool); void setBorderOmitAtBreak(bool); void setPrincipalModeSimultaneous(bool); void setMarginaliaKeepWithPrevious(bool); void setLineJoin(Symbol); void setLineCap(Symbol); void setLineNumberSide(Symbol); void setKernMode(Symbol); void setInputWhitespaceTreatment(Symbol); void setFillingDirection(Symbol); void setWritingMode(Symbol); void setLastLineQuadding(Symbol); void setMathDisplayMode(Symbol); void setBoxType(Symbol); void setGlyphAlignmentMode(Symbol); void setBoxBorderAlignment(Symbol); void setCellRowAlignment(Symbol); void setBorderAlignment(Symbol); void setSidelineSide(Symbol); void setHyphenationKeep(Symbol); void setFontStructure(Symbol); void setFontProportionateWidth(Symbol); void setCellCrossed(Symbol); void setMarginaliaSide(Symbol); void setLayer(long); void setBackgroundLayer(long); void setBorderPriority(long); void setLineRepeat(long); void setSpan(long); void setMinLeaderRepeat(long); void setHyphenationRemainCharCount(long); void setHyphenationPushCharCount(long); void setWidowCount(long); void setOrphanCount(long); // 0 means #f void setExpandTabs(long); void setHyphenationLadderCount(long); // public id or #f void setBackgroundTile(PublicId); void setLineBreakingMethod(PublicId); void setLineCompositionMethod(PublicId); void setImplicitBidiMethod(PublicId); void setGlyphSubstMethod(PublicId); void setGlyphReorderMethod(PublicId); void setHyphenationMethod(PublicId); void setTableAutoWidthMethod(PublicId); void setFontName(PublicId); // Two-letter code void setLanguage(Letter2); void setCountry(Letter2); // For simple page sequence void setPageWidth(Length); void setPageHeight(Length); void setLeftMargin(Length); void setRightMargin(Length); void setTopMargin(Length); void setBottomMargin(Length); void setHeaderMargin(Length); void setFooterMargin(Length); void setPageNumberRestart(bool); void setPageNumberFormat(const StringC &); void setPageNColumns(long); void setPageColumnSep(Length); void setPageBalanceColumns(bool); void setGridRowSep(Length); void setGridColumnSep(Length); void setSubscriptDepth(Length); void setSuperscriptHeight(Length); void setUnderMarkDepth(Length); void setOverMarkHeight(Length); void setHeadingLevel(long); void setMinPreLineSpacing(const OptLengthSpec &); void setMinPostLineSpacing(const OptLengthSpec &); void setMinLeading(const OptLengthSpec &); void setScriptPreAlign(Symbol); void setScriptPostAlign(Symbol); void setScriptMidSupAlign(Symbol); void setScriptMidSubAlign(Symbol); void setNumeratorAlign(Symbol); void setDenominatorAlign(Symbol); void setGridPositionCellType(Symbol); void setGridColumnAlignment(Symbol); void setGridRowAlignment(Symbol); void setGridEquidistantRows(bool); void setGridEquidistantColumns(bool); void setEscapementSpaceBefore(const InlineSpace &); void setEscapementSpaceAfter(const InlineSpace &); void setInlineSpaceSpace(const OptInlineSpace &); void setGlyphSubstTable(const Vector > &tables); void startDisplay( const DisplayNIC & ); void endDisplay(); enum FotObjectClassType { oc_Unknown, oc_Cell }; struct Format { Format() : FotCurDisplaySize( 0 ), FotLineThickness( 1000 ), FotLineCap( symbolButt ), FotBorderPriority( 0 ), FotBorderPresent( true ), FotLineRepeat( 1 ), FotLineSep( 1000 ), FotDisplayAlignment( symbolStart ), FotStartIndentSpec( 0 ), FotEndIndentSpec( 0 ), FotLeftMargin( 1 ), FotRightMargin( 1 ), FotPageWidth( 72000*8 ), FotPageNColumns( 1 ), FotPageColumnSep( 72000/2 ), FotSpan( 1 ), FotCellBeforeColumnMargin( 0 ), FotCellAfterColumnMargin( 0 ), FotObjectClass( oc_Unknown ) {} long FotCurDisplaySize; Length FotLineThickness; Symbol FotLineCap; long FotBorderPriority; bool FotBorderPresent; long FotLineRepeat; Length FotLineSep; Symbol FotDisplayAlignment; LengthSpec FotStartIndentSpec; LengthSpec FotEndIndentSpec; Length FotLeftMargin; Length FotRightMargin; Length FotPageWidth; long FotPageNColumns; Length FotPageColumnSep; long FotSpan; Length FotCellBeforeColumnMargin; Length FotCellAfterColumnMargin; FotObjectClassType FotObjectClass; static const Length INITIAL_PAGE_SIZE() { return 72000*8; } }; struct CompoundFotElement; struct FotElement { FotElement( CompoundFotElement *parent = NULL ) : Parent( parent ), SiblingSeqIdx( -1 ) {} String Characteristics; virtual void out( OutputByteStream &stream ) const { outProlog( stream ); outContent( stream ); outEpilog( stream ); } virtual void open( TeXFOTBuilder &builder ); virtual void close( TeXFOTBuilder &builder ); virtual bool isAtomic() const = 0; virtual const char *name() const = 0; CompoundFotElement *parent() const { return Parent; } String &nodeInfoEpilog() { return NodeInfoEpilog; } void setParent( CompoundFotElement *parent ) { Parent = parent; } virtual FotElement *lastClosed_() = 0; virtual FotElement *currentlyOpen_() = 0; void setSiblingSeqIdx( int idx ) { SiblingSeqIdx = idx; } int siblingSeqIdx() const { assert( SiblingSeqIdx > -1 ); return SiblingSeqIdx; } protected: int SiblingSeqIdx; CompoundFotElement* Parent; String NodeInfoProlog; String NodeInfoEpilog; virtual void outContent( OutputByteStream & ) const {}; virtual void outProlog( OutputByteStream &stream ) const = 0; virtual void outEpilog( OutputByteStream &stream ) const = 0; }; struct FotElementState { FotElementState() : EnforcingStructure( true ), IsOpen( false ) {} bool enforcingStructure() { return IsOpen && EnforcingStructure; } bool EnforcingStructure; bool IsOpen; String CurNodeInfoProlog; }; struct AtomicFotElement : public FotElement { AtomicFotElement( CompoundFotElement *parent = NULL ) : FotElement( parent ) {} virtual bool isAtomic() const { return true; } virtual FotElement *lastClosed_() { return NULL; }; virtual FotElement *currentlyOpen_() { return this; } protected: virtual void outProlog( OutputByteStream &stream ) const { stream << NodeInfoProlog << "\\insert" << name() << "%\n{" << Characteristics << '}'; } virtual void outEpilog( OutputByteStream &stream ) const { stream << '}' << NodeInfoEpilog; } }; struct CompoundFotElement : public FotElement { CompoundFotElement( CompoundFotElement *parent = NULL ) : FotElement( parent ), CurrentlyOpenChildIdx( -1 ), LastClosedChildIdx( -1 ) {} virtual bool isAtomic() const { return false; } virtual void open( TeXFOTBuilder &builder ) { FotElement::open( builder ); builder.setCurOs( &PreContent ); }; virtual void childJustClosed( FotElement &child ) { CurrentlyOpenChildIdx = -1; LastClosedChildIdx = child.siblingSeqIdx(); }; virtual void childJustOpened( FotElement &child ) { CurrentlyOpenChildIdx = child.siblingSeqIdx(); }; virtual FotElement &child( size_t idx ) = 0; static FotElement *lastClosed( CompoundFotElement &treeRoot ) { return treeRoot.currentlyOpen( treeRoot ) ? treeRoot.currentlyOpen( treeRoot )->lastClosed_() : (FotElement*)NULL; } static FotElement *currentlyOpen( CompoundFotElement &treeRoot ) { return treeRoot.currentlyOpen_(); } virtual FotElement *currentlyOpen_() { return CurrentlyOpenChildIdx > -1 ? child( (size_t)CurrentlyOpenChildIdx ).currentlyOpen_() : this; } virtual FotElement *lastClosed_() { return LastClosedChildIdx > -1 ? &child( (size_t)LastClosedChildIdx ) : ( parent() ? parent()->lastClosed_() : (FotElement*)NULL ); } protected: virtual void outProlog( OutputByteStream &stream ) const { #ifdef TEXDEBUG stream << "\nELEMENT\n" << "\nPRO\n" << NodeInfoProlog << "\nEND_PRO\n" << "\\" << name() << "%\n{" << Characteristics << '}'; #else stream << NodeInfoProlog << "\\" << name() << "%\n{" << Characteristics << '}'; #endif PreContent.commit( stream ); } virtual void outEpilog( OutputByteStream &stream ) const { #ifdef TEXDEBUG stream << "\\end" << name() << "{}" << "\nEPI\n" << NodeInfoEpilog << "\nEND_EPI\nEND_ELEMENT\n" ; #else stream << "\\end" << name() << "{}" << NodeInfoEpilog << "%\n" ; #endif } int CurrentlyOpenChildIdx; int LastClosedChildIdx; TeXTmpOutputByteStream PreContent; }; struct Border : public AtomicFotElement { Border( CompoundFotElement *parent = NULL, bool cellBorder_ = true ) : AtomicFotElement( parent ), cellBorder( cellBorder_ ), borderPresent( false ) {} long borderPriority; Length lineThickness; bool borderPresent; long lineRepeat; Length lineSep; bool cellBorder; void resolve( Border &adjacentBorder ); void setFromFot( TeXFOTBuilder &builder ); }; struct CellBeforeRowBorder : public Border { CellBeforeRowBorder( CompoundFotElement *parent = NULL ) : Border( parent ) {} virtual const char *name() const { return "TableCellBeforeRowBorder"; } }; struct CellAfterRowBorder : public Border { CellAfterRowBorder( CompoundFotElement *parent = NULL ) : Border( parent ) {} virtual const char *name() const { return "TableCellAfterRowBorder"; } }; struct CellBeforeColumnBorder : public Border { CellBeforeColumnBorder( CompoundFotElement *parent = NULL ) : Border( parent ) {} virtual const char *name() const { return "TableCellBeforeColumnBorder"; } }; struct CellAfterColumnBorder : public Border { CellAfterColumnBorder( CompoundFotElement *parent = NULL ) : Border( parent ) {} virtual const char *name() const { return "TableCellAfterColumnBorder"; } }; struct TableBeforeRowBorder : public Border { TableBeforeRowBorder( CompoundFotElement *parent = NULL ) : Border( parent, false ) {} virtual const char *name() const { return "TableBeforeRowBorder"; } }; struct TableAfterRowBorder : public Border { TableAfterRowBorder( CompoundFotElement *parent = NULL ) : Border( parent, false ) {} virtual const char *name() const { return "TableAfterRowBorder"; } }; struct TableBeforeColumnBorder : public Border { TableBeforeColumnBorder( CompoundFotElement *parent = NULL ) : Border( parent, false ) {} virtual const char *name() const { return "TableBeforeColumnBorder"; } }; struct TableAfterColumnBorder : public Border { TableAfterColumnBorder( CompoundFotElement *parent = NULL ) : Border( parent, false ) {} virtual const char *name() const { return "TableAfterColumnBorder"; } }; struct Column { Column() : hasWidth( 0 ), computedWidth( 0 ), defaultTeXLeftBorder( 0 ), defaultTeXRightBorder( 0 ), displayAlignment( symbolStart ), isExplicit( false ) {} bool isExplicit; bool hasWidth; TableLengthSpec width; long computedWidth; Symbol displayAlignment; int defaultTeXLeftBorder; // also used as column border count; int defaultTeXRightBorder; // }; struct TablePart; struct Cell : public CompoundFotElement { Cell( CompoundFotElement *parent = NULL ) : CompoundFotElement( parent ), missing( false ), OverlappingCell( NULL ), nRowsSpanned( 1 ), nColumnsSpanned( 1 ), displaySize( 0 ), beforeRowBorder(), afterRowBorder(), beforeColumnBorder(), afterColumnBorder(), TeXTableRowIdx( -1 ), TeXTableColumnIdx( -1 ), displayAlignment( symbolStart ), effectiveAlignment( symbolStart ), paragraphChildrenNum( 0 ) {} bool missing; int TeXTableRowIdx; int TeXTableColumnIdx; unsigned nColumnsSpanned; unsigned nRowsSpanned; CellBeforeRowBorder beforeRowBorder; CellAfterRowBorder afterRowBorder; CellBeforeColumnBorder beforeColumnBorder; CellAfterColumnBorder afterColumnBorder; Symbol displayAlignment; Symbol effectiveAlignment; long displaySize; long paragraphChildrenNum; Cell *OverlappingCell; OutputByteStream &content() { return Content; } virtual void open( TeXFOTBuilder &builder ) { CompoundFotElement::open( builder ); builder.setCurOs( &Content ); builder.curFotElementState().EnforcingStructure = false; } virtual void close( TeXFOTBuilder &builder ) { computeMultiParFlag(); CompoundFotElement::close( builder ); builder.curFotElementState().EnforcingStructure = true; } virtual const char *name() const { return "TableCell"; } bool singleRowBeforeRowBorderPresent() const; bool singleRowAfterRowBorderPresent() const; bool singleColumnBeforeColumnBorderPresent() const; bool singleColumnAfterColumnBorderPresent() const; void computeOverridingTeXColumnBorders( TablePart &tablePart ); void computeOverridingTeXDisplayAlignment( TablePart &tablePart ); void computeMultiParFlag(); bool isOverlapped() const { return OverlappingCell == this ? false : true; } virtual FotElement &child( size_t ) { assert( false ); return *this; } protected: virtual void outProlog( OutputByteStream &stream ) const; virtual void outEpilog( OutputByteStream &stream ) const; void outContent( OutputByteStream &stream ) const { Content.commit( stream ); } TeXTmpOutputByteStream Content; }; struct Row : public CompoundFotElement { Row( CompoundFotElement *parent = NULL ) : CompoundFotElement( parent ) {} virtual const char *name() const { return "TableRow"; } Vector Cells; static void outVerticalBorders ( const Row *upperRow, const Row *lowerRow, OutputByteStream &stream ); virtual FotElement &child( size_t idx ) { assert( idx < Cells.size() ); return Cells[idx]; } protected: void outContent( OutputByteStream &stream ) const; }; struct Table; struct TablePart : public CompoundFotElement { TablePart( CompoundFotElement *parent = NULL ) : CompoundFotElement( parent ), columnsProcessed( false ), needsColumnReprocessing( false ), isExplicit( true ) {} bool isExplicit; Vector Columns; String HeaderProlog; Vector Header; String HeaderEpilog; Vector Body; String FooterProlog; Vector Footer; String FooterEpilog; void processColumns( TeXFOTBuilder &builder ); void computeTeXColumnBordersAndDisplayAlignment(); void normalizeRows(); void begin(); Table &parentTable() const { assert( Parent != NULL ); return *(Table*)Parent; } virtual const char *name() const { return "TablePart"; } virtual FotElement &child( size_t idx ); bool columnsProcessed; bool needsColumnReprocessing; protected: virtual void outProlog( OutputByteStream &stream ) const { if( isExplicit ) CompoundFotElement::outProlog( stream ); } virtual void outEpilog( OutputByteStream &stream ) const { if( isExplicit ) CompoundFotElement::outEpilog( stream ); } Row &siblingSeqIdxToRow( int idx ) const; void outContent( OutputByteStream &stream ) const; }; struct Table : public CompoundFotElement { Table( CompoundFotElement *parent = NULL ) : CompoundFotElement( parent ), beforeRowBorder(), afterRowBorder(), beforeColumnBorder(), afterColumnBorder(), CurCell( NULL ), CurTablePart( NULL ), NoTablePartsSeen( true ) {} Vector TableParts; TableBeforeRowBorder beforeRowBorder; TableAfterRowBorder afterRowBorder; TableBeforeColumnBorder beforeColumnBorder; TableAfterColumnBorder afterColumnBorder; Length tableWidth; Symbol displayAlignment; Length startIndent; virtual const char *name() const { return "Table"; } virtual FotElement &child( size_t idx ) { assert( idx < TableParts.size() ); return TableParts[idx]; } void resolveBorders( Vector *preceedingRows, Vector &rows, Vector *followingRows, unsigned startingRowIdx, bool hasFirstTableRow, bool hasLastTableRow ); void begin(); void end( TeXFOTBuilder &builder ); Vector &curRows() { assert( CurRows != NULL ); return *CurRows; } TablePart &curTablePart() { assert( CurTablePart != NULL ); return *CurTablePart; } Cell &curCell() { assert( CurCell != NULL ); return *CurCell; } TablePart *CurTablePart; Cell *CurCell; Vector *CurRows; bool NoTablePartsSeen; protected: void outContent( OutputByteStream &stream ) const; }; long computeLengthSpec( const LengthSpec &spec ) const; const Format &curFormat() const { assert( FormatStack.size() > 0 ); return FormatStack.back(); } Table &curTable() { return CurTable; } FotElementState &curFotElementState() { return CurFotElementState; } void setCurOs( OutputByteStream *to ) { CurOs = to; } void elementStart( FotObjectClassType objectClassType ); OutputByteStream *fileout_; private: // Variables. OutputByteStream *CurOs; StrOutputByteStream stringout_; Messenger *mgr_; bool preserveSdata_; int inMath_; #ifdef OUTLINES int needToCollect() {return inHeading_;} void addHeadedText(const Char * s, size_t n); void addHeadedText(const StringC p); struct ParHead { ParHead() : isHeaded_(false),level_(0),previous_(0){} ParHead(bool h): isHeaded_(h),level_(0),previous_(0){} ParHead(bool h,long l) : isHeaded_(h),level_(l),previous_(0){} bool isHeaded_; long level_; StringC headingText_; size_t previous_; }; StringC protectedChar_; //for special tex Chars bool headingSet_; bool inHeading_; StringC return_; Vector parStack_; size_t lastHeaded_; #endif Vector DisplayBoxLevels; Vector FormatStack; Format NextFormat; Table CurTable; FotElementState CurFotElementState; // Functions. OutputByteStream &os(); void insertAtomic(const char *name); void insertAtomic(FotElement &fotElement); void startGroup(FotElement &fotElement); void startGroup(const char *name, String *output = NULL ); void endGroup(const char *name, String *output = NULL ); void closeopenBrace(const char *name, String *output = NULL ); void startBrace(const char *name, String *output = NULL ); void endBrace(const char *name, String *output = NULL ); void startSimpleGroup(const char *name, String *output = NULL ); void endSimpleGroup(String *output = NULL); void endGroup() {}; void setlength(const char *,Length); void set(const char *,const StringC &); void set(const char *,const GroveString &); void set(const char *,Symbol); void set(const char *,const LengthSpec &); void set(const char *,double); void set(const char *,const DeviceRGBColor &); void set(const char *,bool); void set(const char *,long); void set(const char *,long unsigned int); void set(const char *name,unsigned int n) { set(name, (unsigned long)n); } void set(const char *,PublicId); void setletter2(const char *,Letter2); void set(const char *,const DisplaySpace &); void set(const char *,const GlyphId &); void set(const char *,const OptLengthSpec &); void set(const char *,const InlineSpace &); void set(const char *,const OptInlineSpace &); // Structures for non-inherited characteristics, // in the order specified in style/FOTBuilder.h. void setDisplayNIC(const DisplayNIC &); void setInlineNIC(const InlineNIC &); void setDisplayGroupNIC(const DisplayGroupNIC &); void setExternalGraphicNIC(const ExternalGraphicNIC &); void setBoxNIC(const BoxNIC &); void setRuleNIC(const RuleNIC &); void setLeaderNIC(const LeaderNIC &); void setParagraphNIC(const ParagraphNIC &); void setCharacterNIC(const CharacterNIC &); void setLineFieldNIC(const LineFieldNIC &); void setTableNIC(const TableNIC &); void setTablePartNIC(const TablePartNIC &); void setTableColumnNIC(const TableColumnNIC &); void setTableCellNIC(const TableCellNIC &); void setGridNIC(const GridNIC &); void setGridCellNIC(const GridCellNIC &); void dumpInherited(); void message(const MessageType0 &); static ParHead& top(Vector& s); static ParHead* ptrTop(Vector& s); static void pop(Vector& s); static void push(Vector& s, ParHead p); }; #ifdef OUTLINES // Stack Utilities TeXFOTBuilder::ParHead& TeXFOTBuilder::top (Vector &s) { //cerr << "top" < &s) { //cerr << "top" < &s){ //cerr << "popping" <<'\n'; s.resize(s.size() - 1); } void TeXFOTBuilder::push(Vector &s,TeXFOTBuilder::ParHead p ){ //cerr << "pushing" <= 0); parStack_[top(parStack_).previous_].headingText_.append(s,n); } } void TeXFOTBuilder::addHeadedText(const StringC p){ if (top(parStack_).isHeaded_){ top(parStack_).headingText_ += p; } else{ assert(((top(parStack_).previous_)) >= 0); parStack_[top(parStack_).previous_].headingText_ += p; } } #endif #ifdef TEXDEBUG TeXFOTBuilder *TeXFOTBuilder::CurInstance = NULL; #endif // --------- OutputByteStream operators -------------------------------------- OutputByteStream &operator<<( OutputByteStream &os, LengthInPoints length ) { char buf[32]; int i; sprintf( buf, "%li.%.3i%n", long(length.l)/1000, abs(long(length.l)%1000), &i ); while( buf[--i] == '0' ) {}; if( buf[i] == '.' ) i--; buf[i+1] = '\0'; os << buf << "\\p@"; return os; } // --------- TeXFOTBuilder::FotElement --------------------------------------- void TeXFOTBuilder::FotElement::open( TeXFOTBuilder &builder ) { builder.curFotElementState().IsOpen = true; if( parent() ) parent()->childJustOpened( *this ); if( builder.curFotElementState().CurNodeInfoProlog.size() > 0 ) { NodeInfoProlog = builder.curFotElementState().CurNodeInfoProlog; builder.curFotElementState().CurNodeInfoProlog.resize( 0 ); } } void TeXFOTBuilder::FotElement::close( TeXFOTBuilder &builder ) { if( parent() ) parent()->childJustClosed( *this ); else { builder.curFotElementState().IsOpen = false; builder.setCurOs( NULL ); } } TeXFOTBuilder::FotElement *TeXFOTBuilder::FotElement::lastClosed_() { return parent() ? parent()->lastClosed_() : (FotElement*)NULL; } // --------- TeXFOTBuilder Standard Display/Element Handling ----------------- void TeXFOTBuilder::elementStart( FotObjectClassType objectClassType ) { NextFormat.FotObjectClass = objectClassType; FormatStack.push_back( NextFormat ); } void TeXFOTBuilder::start() { NextFormat.FotObjectClass = oc_Unknown; FormatStack.push_back( NextFormat ); } void TeXFOTBuilder::end() { assert( FormatStack.size() > 0 ); FormatStack.resize( FormatStack.size()-1 ); assert( FormatStack.size() > 0 ); NextFormat = FormatStack.back(); } void TeXFOTBuilder::startDisplay( const DisplayNIC & ) { if( curTable().CurCell != NULL ) NextFormat.FotCurDisplaySize = curTable().CurCell->displaySize; else if( NextFormat.FotSpan > 1 ) NextFormat.FotCurDisplaySize = NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin; else NextFormat.FotCurDisplaySize = ( NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin - NextFormat.FotPageColumnSep * ( NextFormat.FotPageNColumns - 1 ) ) / NextFormat.FotPageNColumns; } void TeXFOTBuilder::endDisplay() { } // --------- TeXFOTBuilder Misc ---------------------------------------------- long TeXFOTBuilder::computeLengthSpec( const LengthSpec &spec ) const { if( spec.displaySizeFactor == 0.0 ) { return spec.length; } else { double tem = curFormat().FotCurDisplaySize * spec.displaySizeFactor; return spec.length + long( tem >= 0.0 ? tem +.5 : tem - .5 ); } } // --------- TeXFOTBuilder::Table --------------------------------------------- void TeXFOTBuilder::Table::resolveBorders ( Vector *preceedingRows, Vector &rows, Vector *, unsigned startingRowIdx, bool hasFirstTableRow, bool hasLastTableRow ) { bool isFirstRow; bool isLastRow; bool isFirstColumn; bool isLastColumn; Cell *cell = NULL; size_t r, c, rr, cc; bool leftEdge, topEdge; #ifdef TEXDEBUG *TeXFOTBuilder::curInstance().fileout_ << "RESOLVING_BORDERS\n"; #endif for( r = 0; r < rows.size(); r++ ) { for( c = 0; c < rows[r].Cells.size()-1; c++ ) { cell = &rows[r].Cells[c]; if( cell->OverlappingCell == NULL ) { for( rr = r; rr < r + cell->nRowsSpanned; rr++ ) { for( cc = c, leftEdge = true; cc < c + cell->nColumnsSpanned; cc++ ) { rows[rr].Cells[cc].OverlappingCell = cell; rows[rr].Cells[cc].TeXTableRowIdx = rr + startingRowIdx; rows[rr].Cells[cc].TeXTableColumnIdx = cc; } } } } } for( r = 0; r < rows.size(); r++ ) { #ifdef TEXDEBUG *TeXFOTBuilder::curInstance().fileout_ << "ROW " << r << "\n"; #endif for( c = 0; c < rows[r].Cells.size() - 1; c++ ) { #ifdef TEXDEBUG *TeXFOTBuilder::curInstance().fileout_ << " COL " << c << "\n"; #endif cell = &rows[r].Cells[c]; if( cell->OverlappingCell == cell ) { for( rr = r, topEdge = true; rr < r + cell->nRowsSpanned; rr++ ) { isFirstRow = ( rr == 0 ) ? true : false; isLastRow = ( rr == rows.size() - 1 ) ? true : false; for( cc = c, leftEdge = true; cc < c + cell->nColumnsSpanned; cc++ ) { isFirstColumn = ( cc == 0 ) ? true : false; isLastColumn = ( cc == rows[rr].Cells.size() - 2 ) ? true : false; if( leftEdge ) if( isFirstColumn ) { #ifdef TEXDEBUG *TeXFOTBuilder::curInstance().fileout_ << "LEFT_TABLE_BORDER_RES \n"; #endif cell->beforeColumnBorder.resolve( beforeColumnBorder ); } else cell->beforeColumnBorder.resolve ( rows[rr].Cells[cc-1].OverlappingCell->afterColumnBorder ); if( topEdge ) if( isFirstRow && hasFirstTableRow ) cell->beforeRowBorder.resolve( beforeRowBorder ); else if( !isFirstRow ) cell->beforeRowBorder.resolve ( rows[rr-1].Cells[cc].OverlappingCell->afterRowBorder ); else if( preceedingRows != NULL ) { assert( preceedingRows->size() > 0 ); cell->beforeRowBorder.resolve ( (*preceedingRows)[preceedingRows->size()-1].Cells[cc] .OverlappingCell->afterRowBorder ); } if( isLastColumn ) cell->afterColumnBorder.resolve( afterColumnBorder ); if( isLastRow && hasLastTableRow ) cell->afterRowBorder.resolve( afterRowBorder ); leftEdge = false; } topEdge = false; } } } } } void TeXFOTBuilder::Table::begin() { CurCell = NULL; NoTablePartsSeen = true; TableParts.resize( 0 ); TableParts.resize( 1 ); TableParts.back().setSiblingSeqIdx( 0 ); TableParts.back().setParent( this ); TableParts.back().begin(); } void TeXFOTBuilder::Table::end( TeXFOTBuilder &builder ) { bool firstPart, lastPart, hasHeader, hasBody, hasFooter; for( size_t i = 0; i < TableParts.size(); i++ ) { firstPart = ( i == 0 ) ? true : false; lastPart = ( i == TableParts.size() - 1 ) ? true : false; TablePart &tablePart = TableParts[i]; tablePart.normalizeRows(); hasHeader = tablePart.Header.size() > 0 ? true : false; hasBody = tablePart.Body.size() > 0 ? true : false; hasFooter = tablePart.Footer.size() > 0 ? true : false; if( hasHeader ) resolveBorders( (Vector*)NULL, tablePart.Header, hasBody ? &tablePart.Body : (Vector*)NULL, 0, firstPart ? true : false, false ); resolveBorders( hasHeader ? &tablePart.Header : (Vector*)NULL, tablePart.Body, hasFooter ? &tablePart.Footer : (Vector*)NULL, tablePart.Header.size(), hasHeader ? false : true, hasFooter ? false : true ); if( hasFooter ) resolveBorders( hasBody ? &tablePart.Body : (Vector*)NULL, tablePart.Footer, (Vector*)NULL, tablePart.Header.size() + tablePart.Body.size(), false, lastPart ? true : false ); if( tablePart.needsColumnReprocessing ) tablePart.processColumns( builder ); tablePart.computeTeXColumnBordersAndDisplayAlignment(); } } void TeXFOTBuilder::Table::outContent( OutputByteStream &stream ) const { for( size_t i = 0; i < TableParts.size(); i++ ) TableParts[i].out( stream ); }; // --------- TeXFOTBuilder::TablePart ----------------------------------------- void TeXFOTBuilder::TablePart::begin() { Columns.resize( 0 ); Header.resize( 0 ); Body.resize( 0 ); Footer.resize( 0 ); columnsProcessed = false; needsColumnReprocessing = false; parentTable().CurRows = &Body; parentTable().CurTablePart = this; } TeXFOTBuilder::FotElement &TeXFOTBuilder::TablePart::child( size_t idx ) { if( idx < Header.size() ) return Header[idx]; idx -= Header.size(); if( idx < Body.size() ) return Body[idx]; assert( idx < Footer.size() ); idx -= Body.size(); return Footer[idx]; } void TeXFOTBuilder::TablePart::computeTeXColumnBordersAndDisplayAlignment() { Vector *rows; for( int step = 0; step < 3; step++ ) { switch( step ) { case 0: rows = &Header; break; case 1: rows = &Body; break; default: rows = &Footer; } for( size_t r = 0; r < rows->size(); r++ ) { if( (*rows)[r].Cells.size()-1 > Columns.size() ) Columns.resize( (*rows)[r].Cells.size()-1 ); for( size_t c = 0; c < (*rows)[r].Cells.size()-1; c++ ) { if( (*rows)[r].Cells[c].singleColumnBeforeColumnBorderPresent() ) Columns[c].defaultTeXLeftBorder++; if( (*rows)[r].Cells[c].singleColumnAfterColumnBorderPresent() ) Columns[c].defaultTeXRightBorder++; } } } #ifdef TEXDEBUG for( int step = 0; step < 3; step++ ) { switch( step ) { case 0: rows = &Header; break; case 1: rows = &Body; break; default: rows = &Footer; } for( size_t r = 0; r < rows->size(); r++ ) { *TeXFOTBuilder::curInstance().fileout_ << "\nROW " << ( step == 0 ? "Header" : ( step == 1 ? "Body" : "Footer" ) ) << "\n"; for( size_t c = 0; c < (*rows)[r].Cells.size()-1; c++ ) { *TeXFOTBuilder::curInstance().fileout_ << "\n CELL " << c << " LB: " << (*rows)[r].Cells[c].beforeColumnBorder.borderPresent << " RB: " << (*rows)[r].Cells[c].beforeColumnBorder.borderPresent << " OVERLAPPED: " << ( (*rows)[r].Cells[c].isOverlapped() ? "YES" : "NO" ) << "\n"; } } } #endif size_t TeXTableRowsNum = Header.size() + Body.size() + Footer.size(); for( size_t c = 0; c < Columns.size(); c++ ) { Columns[c].defaultTeXLeftBorder = ((size_t)Columns[c].defaultTeXLeftBorder)*2 >= TeXTableRowsNum ? 1 : 0; Columns[c].defaultTeXRightBorder = ((size_t)Columns[c].defaultTeXRightBorder)*2 >= TeXTableRowsNum ? 1 : 0; } for( int step = 0; step < 3; step++ ) { switch( step ) { case 0: rows = &Header; break; case 1: rows = &Body; break; default: rows = &Footer; } for( size_t r = 0; r < rows->size(); r++ ) { for( size_t c = 0; c < (*rows)[r].Cells.size()-1; c++ ) { if( !(*rows)[r].Cells[c].isOverlapped() ) { (*rows)[r].Cells[c].computeOverridingTeXColumnBorders( *this ); (*rows)[r].Cells[c].computeOverridingTeXDisplayAlignment( *this ); } } } } } void TeXFOTBuilder::TablePart::processColumns( TeXFOTBuilder &builder ) { long totalNonproportionalWidth = 0L; double totalProportionalUnits = 0.0; size_t nonWidthCellsNum = 0; for( size_t i = 0; i < Columns.size(); i++ ) { if( Columns[i].hasWidth ) { if( Columns[i].width.tableUnitFactor ) { totalProportionalUnits += Columns[i].width.tableUnitFactor; } else { Columns[i].computedWidth = builder.computeLengthSpec( Columns[i].width ); totalNonproportionalWidth += Columns[i].computedWidth; } } else nonWidthCellsNum++; } if( totalProportionalUnits > 0 ) totalProportionalUnits += nonWidthCellsNum; // cannot predict width of some cells, but their width is needed to // compute widths of proportional cells - force non-with cells to be 1 table-unit double proportionalUnit = 0.0; if( totalProportionalUnits ) proportionalUnit = ( parentTable().tableWidth - totalNonproportionalWidth ) / totalProportionalUnits; for( size_t i = 0; i < Columns.size(); i++ ) { if( Columns[i].hasWidth ) { if( Columns[i].width.tableUnitFactor ) Columns[i].computedWidth = long(proportionalUnit * Columns[i].width.tableUnitFactor); } else if( totalProportionalUnits > 0 ) Columns[i].computedWidth = long(proportionalUnit); } columnsProcessed = true; } void TeXFOTBuilder::TablePart::outContent( OutputByteStream &stream ) const { stream << "\\TeXTable%\n{" << LengthInPoints( parentTable().tableWidth ) << "}{" << Columns.size() << '}'; stream << '{'; for( size_t i = 0; i < Columns.size(); i++ ) { #ifdef TEXDEBUG stream << "\nCOLUMN " << i << " DEF_LEFT_B: " << Columns[i].defaultTeXLeftBorder << " DEF_RIGHT_B: " << Columns[i].defaultTeXRightBorder << "\n"; #endif if( i == 0 && Columns[i].defaultTeXLeftBorder ) stream << '|'; if( Columns[i].computedWidth > 0 ) { switch( Columns[i].displayAlignment ) { case symbolInside: case symbolStart: stream << "L{" << LengthInPoints( Columns[i].computedWidth ) << '}'; break; case symbolOutside: case symbolEnd: stream << "R{" << LengthInPoints( Columns[i].computedWidth ) << '}'; break; case symbolCenter: default: stream << "C{" << LengthInPoints( Columns[i].computedWidth ) << '}'; } } else { switch( Columns[i].displayAlignment ) { case symbolOutside: case symbolEnd: stream << 'r'; break; case symbolCenter: stream << 'c'; break; case symbolInside: case symbolStart: default: stream << 'l'; break; } } if( Columns[i].defaultTeXRightBorder ) stream << '|'; } stream << "}%\n"; stream << HeaderProlog; const Row *recentRow = NULL; for( size_t i = 0; i < Header.size(); i++ ) { Row::outVerticalBorders( recentRow, &Header[i], stream ); Header[i].out( stream ); recentRow = &Header[i]; } stream << HeaderEpilog; for( size_t i = 0; i < Body.size(); i++ ) { Row::outVerticalBorders( recentRow, &Body[i], stream ); Body[i].out( stream ); recentRow = &Body[i]; } stream << FooterProlog; for( size_t i = 0; i < Footer.size(); i++ ) { Row::outVerticalBorders( recentRow, &Footer[i], stream ); Footer[i].out( stream ); recentRow = &Footer[i]; } stream << FooterEpilog; if( recentRow ) Row::outVerticalBorders( recentRow, NULL, stream ); stream << "\\endTeXTable" << "{}%\n"; } void TeXFOTBuilder::TablePart::normalizeRows() { size_t maxCellsInRow = Columns.size()+1; Vector *rows; for( int step = 0; step < 2; step++ ) { for( int rowType = 0; rowType < 3; rowType++ ) { switch( rowType ) { case 0: rows = &Header; break; case 1: rows = &Body; break; default: rows = &Footer; } for( size_t r = 0; r < rows->size(); r++ ) { if( step == 0 ) { if( (*rows)[r].Cells.size() > 1 ) { size_t lastCellIdx = (*rows)[r].Cells.size()-2; Cell &lastCell = (*rows)[r].Cells[lastCellIdx]; if( !lastCell.missing && lastCellIdx+lastCell.nColumnsSpanned+1 > maxCellsInRow ) maxCellsInRow = lastCellIdx+lastCell.nColumnsSpanned+1; } } else if( (*rows)[r].Cells.size() < maxCellsInRow ) (*rows)[r].Cells.resize( maxCellsInRow ); } } } } // --------- TeXFOTBuilder::Row ----------------------------------------------- void TeXFOTBuilder::Row::outContent( OutputByteStream &stream ) const { bool first = true; for( size_t i = 0; i + 1 < Cells.size(); i++ ) { if( !Cells[i].isOverlapped() ) { if( !first ) stream << "&"; else first = false; Cells[i].out( stream ); } } } void TeXFOTBuilder::Row::outVerticalBorders ( const TeXFOTBuilder::Row *upperRow, const TeXFOTBuilder::Row *lowerRow, OutputByteStream &stream ) { assert( upperRow != NULL || lowerRow != NULL ); size_t colNum = upperRow ? upperRow->Cells.size()-1 : lowerRow->Cells.size()-1; int borderStartIdx = -1; int borderEndIdx; for( size_t i = 0; i < colNum; i++ ) { #ifdef TEXDEBUG stream << "\nROW: " << "COL " << i << " " << ( ( ( upperRow && upperRow->Cells[i].singleRowAfterRowBorderPresent() ) || ( lowerRow && lowerRow->Cells[i].singleRowBeforeRowBorderPresent() ) ) ? "Border" : "No Border" ); #endif if( ( upperRow && upperRow->Cells[i].singleRowAfterRowBorderPresent() ) || ( lowerRow && lowerRow->Cells[i].singleRowBeforeRowBorderPresent() ) ) { if( borderStartIdx < 0 ) borderStartIdx = i; if( i == colNum-1 ) { borderEndIdx = i; goto OUT_BORDER; } } else if( borderStartIdx > -1 ) { borderEndIdx = i-1; goto OUT_BORDER; } continue; OUT_BORDER: if( borderStartIdx == 0 && i == colNum-1 ) stream << "\\Hline%\n"; else stream << "\\Cline{" << borderStartIdx+1 << '-' << borderEndIdx+1 << "}%\n"; borderStartIdx = -1; } } // --------- TeXFOTBuilder::Cell ---------------------------------------------- void TeXFOTBuilder::Cell::outProlog( OutputByteStream &stream ) const { if( nColumnsSpanned > 1 ) { stream << "\\multicolumn%\n{" << nColumnsSpanned << "}{"; if( beforeColumnBorder.borderPresent ) stream << '|'; switch( effectiveAlignment ) { case symbolOutside: case symbolEnd: stream << 'r'; break; case symbolCenter: stream << 'c'; break; case symbolInside: case symbolStart: default: stream << 'l'; break; } if( afterColumnBorder.borderPresent ) stream << '|'; stream << "}{"; } CompoundFotElement::outProlog( stream ); } void TeXFOTBuilder::Cell::outEpilog( OutputByteStream &stream ) const { CompoundFotElement::outEpilog( stream ); if( nColumnsSpanned > 1 ) stream << "}%\n"; } void TeXFOTBuilder::Cell::computeMultiParFlag() { if( paragraphChildrenNum > 1 ) { StrOutputByteStream str; str << "\\def\\MultiPar{1}"; String s; str.extractString( s ); Characteristics += s; } } void TeXFOTBuilder::Cell::computeOverridingTeXColumnBorders( TablePart &tablePart ) { StrOutputByteStream str; if( tablePart.Columns[TeXTableColumnIdx].defaultTeXLeftBorder != beforeColumnBorder.borderPresent ) str << "\\def\\TeXTableCellBeforeColumnBorder{" << beforeColumnBorder.borderPresent << '}'; if( tablePart.Columns[TeXTableColumnIdx+nColumnsSpanned-1].defaultTeXRightBorder != afterColumnBorder.borderPresent ) str << "\\def\\TeXTableCellAfterColumnBorder{" << afterColumnBorder.borderPresent << '}'; String s; str.extractString( s ); Characteristics += s; } void TeXFOTBuilder::Cell::computeOverridingTeXDisplayAlignment( TablePart &tablePart ) { effectiveAlignment = tablePart.Columns[TeXTableColumnIdx].isExplicit ? tablePart.Columns[TeXTableColumnIdx].displayAlignment : displayAlignment; StrOutputByteStream str; if( effectiveAlignment != tablePart.Columns[TeXTableColumnIdx].displayAlignment ) { str << "\\def\\TeXTableCellDisplayAlignment{"; switch( effectiveAlignment ) { case symbolOutside: case symbolEnd: str << 'r'; break; case symbolCenter: str << 'c'; break; case symbolInside: case symbolStart: default: str << 'l'; break; } str << '}'; String s; str.extractString( s ); Characteristics += s; } } bool TeXFOTBuilder::Cell::singleRowBeforeRowBorderPresent() const { assert( OverlappingCell != NULL ); if( OverlappingCell->TeXTableRowIdx == TeXTableRowIdx ) return OverlappingCell->beforeRowBorder.borderPresent; else return false; } bool TeXFOTBuilder::Cell::singleRowAfterRowBorderPresent() const { assert( OverlappingCell != NULL ); assert( TeXTableRowIdx > -1 ); if( OverlappingCell->TeXTableRowIdx + OverlappingCell->nRowsSpanned == ((unsigned)TeXTableRowIdx)+1 ) return OverlappingCell->afterRowBorder.borderPresent; else return false; } bool TeXFOTBuilder::Cell::singleColumnBeforeColumnBorderPresent() const { assert( OverlappingCell != NULL ); assert( TeXTableRowIdx > -1 ); if( OverlappingCell->TeXTableColumnIdx == TeXTableColumnIdx ) return OverlappingCell->beforeColumnBorder.borderPresent; else return false; } bool TeXFOTBuilder::Cell::singleColumnAfterColumnBorderPresent() const { assert( OverlappingCell != NULL ); if( OverlappingCell->TeXTableColumnIdx + (int)OverlappingCell->nColumnsSpanned == TeXTableColumnIdx+1 ) return OverlappingCell->afterColumnBorder.borderPresent; else return false; } // --------- TeXFOTBuilder::Border -------------------------------------------- void TeXFOTBuilder::Border::setFromFot( TeXFOTBuilder &builder ) { const TeXFOTBuilder::Format &f = builder.curFormat(); borderPriority = f.FotBorderPriority; borderPresent = f.FotBorderPresent; lineThickness = f.FotLineThickness; lineRepeat = f.FotLineRepeat; lineSep = f.FotLineSep; } void TeXFOTBuilder::Border::resolve( Border &adjacentBorder ) { if( adjacentBorder.borderPriority > borderPriority || ( adjacentBorder.borderPriority == borderPriority && !adjacentBorder.cellBorder && adjacentBorder.borderPresent ) ) { lineThickness = adjacentBorder.lineThickness; borderPresent = adjacentBorder.borderPresent; lineRepeat = adjacentBorder.lineRepeat; lineSep = adjacentBorder.lineSep; if( adjacentBorder.cellBorder ) adjacentBorder.borderPresent = false; } #ifdef TEXDEBUG *TeXFOTBuilder::curInstance().fileout_ << "RESOLVE_RESULT: " << borderPresent << "\n"; #endif } // --------- End Tables ------------------------------------------------------- #define MAYBESET(name,value,default) (value!=default?(set(name,value),0):0) // // Get the current output stream. // inline OutputByteStream &TeXFOTBuilder::os() { return CurOs == NULL ? *fileout_ : *CurOs; } // // Define an output operator for StringC // // FIXME This won't work for Unicode characters. static OutputByteStream &operator<<(OutputByteStream &os, const StringC &s) { for (size_t i = 0; i < s.size(); i++) os << char(s[i]); return os; } // // Define an output operator for GroveString // static OutputByteStream &operator<<(OutputByteStream &os, const GroveString &s) { for (size_t i = 0; i < s.size(); i++) os << char(s[i]); return os; } static OutputByteStream &operator<<(OutputByteStream &os, double d) { char buf[64]; sprintf(buf, "%g", d); return os << buf; } FOTBuilder *makeTeXFOTBuilder(OutputByteStream *os, Messenger *mgr, const FOTBuilder::Description *&descr) { static const TeXFOTBuilder::PageFloatFlowObj pageFloat; static const TeXFOTBuilder::PageFootnoteFlowObj pageFootnote; static const FOTBuilder::Extension extensions[] = { { "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-float", 0, 0, 0, 0, &pageFloat }, { "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-footnote", 0, 0, 0, 0, &pageFootnote }, { "UNREGISTERED::James Clark//Characteristic::page-number-format", 0, (void (FOTBuilder::*)(const StringC &))&TeXFOTBuilder::setPageNumberFormat, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-number-restart?", (void (FOTBuilder::*)(bool))&TeXFOTBuilder::setPageNumberRestart, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-n-columns", 0, 0, (void (FOTBuilder::*)(long))&TeXFOTBuilder::setPageNColumns, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-column-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setPageColumnSep, }, { "UNREGISTERED::James Clark//Characteristic::page-balance-columns?", (void (FOTBuilder::*)(bool))&TeXFOTBuilder::setPageBalanceColumns, 0, 0 }, { "UNREGISTERED::James Clark//Characteristic::subscript-depth", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setSubscriptDepth, }, { "UNREGISTERED::James Clark//Characteristic::over-mark-height", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setOverMarkHeight, }, { "UNREGISTERED::James Clark//Characteristic::under-mark-depth", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setUnderMarkDepth, }, { "UNREGISTERED::James Clark//Characteristic::superscript-height", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setSuperscriptHeight, }, { "UNREGISTERED::James Clark//Characteristic::grid-row-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setGridRowSep, }, { "UNREGISTERED::James Clark//Characteristic::grid-column-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&TeXFOTBuilder::setGridColumnSep, }, { "UNREGISTERED::James Clark//Characteristic::heading-level", 0, 0, (void (FOTBuilder::*)(long))&TeXFOTBuilder::setHeadingLevel, 0 }, { "UNREGISTERED::James Clark//Characteristic::preserve-sdata?", (void (FOTBuilder::*)(bool))&TeXFOTBuilder::setPreserveSdata, 0, 0, 0, 0 }, { 0, 0, 0} }; static const FOTBuilder::Feature features[] = { { "sideline", 0}, { "table", 0}, { "math", 0}, { "simple-page", 0}, { "online", 1}, { 0, 0} }; static const char * media[] = { "print", 0 }; static FOTBuilder::Description description= { extensions, features, false, media }; descr = &description; return new TeXFOTBuilder(os, mgr); } //////////////////////////////////////////////////////////////////////// // Constructor and Destructor //////////////////////////////////////////////////////////////////////// TeXFOTBuilder::TeXFOTBuilder(OutputByteStream *o, Messenger *mgr) : fileout_(o), mgr_(mgr), CurOs( NULL ), preserveSdata_(1) #ifdef OUTLINES ,inHeading_(0),headingSet_(0),lastHeaded_(0) #endif ,inMath_(0) { #ifdef TEXDEBUG CurInstance = this; #endif NextFormat.FotCurDisplaySize = Format::INITIAL_PAGE_SIZE(); FormatStack.push_back( NextFormat ); os() << "\\FOT{2}"; #ifdef OUTLINES return_ += Char('\n'); protectedChar_ += Char('\\'); #endif } TeXFOTBuilder::~TeXFOTBuilder() { os() << "\\endFOT{}"; } ////////////////////////////////////////////////////////////////////// // Atomic flow objects ////////////////////////////////////////////////////////////////////// #ifdef OUTLINES //FIXME Que faire avec les characteres > 256 #endif void TeXFOTBuilder::characters(const Char *s, size_t n) { for (; n > 0; n--, s++) { // Since TeX has only 256 characters // by default, two-byte characters // will need special treatment. if (*s > 255) { // set("Ch",(unsigned long)(*s)); // insertAtomic("Character"); // // Don't complicate matters, just give the character! os() << "\\Character{" << (unsigned long)(*s) << "}"; } else { // Otherwise, check for special // TeX escapes. switch(*s) { default: os() << char(*s); #ifdef OUTLINES if (needToCollect()){ addHeadedText(s,1); //top(parStack_).headingText_.append(s,1); } #endif break; case '\\': case '^': case '_': case '~': os() << "\\char" << int(*s) << "{}"; #ifdef OUTLINES if (needToCollect()){ addHeadedText(s,1); //top(parStack_).headingText_.append(s,1); } #endif break; case '{': case '}': case '$': case '&': case '#': case '%': os() << "\\" << char(*s); #ifdef OUTLINES if (needToCollect()){ protectedChar_[1]=*s; addHeadedText(protectedChar_); //top(parStack_).headingText_ += protectedChar_; } #endif break; case '\r': os() << '\n'; #ifdef OUTLINES if (needToCollect()){ addHeadedText(return_); //top(parStack_).headingText_ += return_; } #endif break; case '\n': break; case '-': case '<': case '>': os() << char(*s); if (!inMath_) os() << "\\/"; // break ligatures break; } } } } void TeXFOTBuilder::character(const CharacterNIC &nic) { setCharacterNIC(nic); // insertAtomic("Character"); dumpInherited(); os() << "\\Character{" << (unsigned long)(nic.ch) << "}"; } void TeXFOTBuilder::paragraphBreak(const ParagraphNIC &nic) { setParagraphNIC(nic); insertAtomic("ParagraphBreak"); } void TeXFOTBuilder::externalGraphic(const ExternalGraphicNIC &nic) { setExternalGraphicNIC(nic); insertAtomic("ExternalGraphic"); } void TeXFOTBuilder::rule(const RuleNIC &nic) { setRuleNIC(nic); insertAtomic("Rule"); } void TeXFOTBuilder::alignmentPoint() { insertAtomic("AlignmentPoint"); } // page-number sosofo void TeXFOTBuilder::pageNumber() { insertAtomic("PageNumber"); } void TeXFOTBuilder::formattingInstruction (const StringC &instr) { os() << instr; } void TeXFOTBuilder::tableColumn(const TableColumnNIC &nic) { setTableColumnNIC(nic); if( nic.columnIndex >= curTable().curTablePart().Columns.size() ) curTable().curTablePart().Columns.resize( nic.columnIndex + 1 ); Column &col = curTable().curTablePart().Columns[nic.columnIndex]; col.isExplicit = true; col.hasWidth = nic.hasWidth; if( nic.hasWidth ) col.width = nic.width; col.displayAlignment = curFormat().FotDisplayAlignment; insertAtomic("TableColumn"); } void TeXFOTBuilder::tableCellBeforeRowBorder() { start(); curTable().curCell().beforeRowBorder.setFromFot( *this ); insertAtomic( curTable().curCell().beforeRowBorder ); end(); } void TeXFOTBuilder::tableCellAfterRowBorder() { start(); curTable().curCell().afterRowBorder.setFromFot( *this ); insertAtomic( curTable().curCell().afterRowBorder ); end(); } void TeXFOTBuilder::tableCellBeforeColumnBorder() { start(); curTable().curCell().beforeColumnBorder.setFromFot( *this ); insertAtomic( curTable().curCell().beforeColumnBorder ); end(); } void TeXFOTBuilder::tableCellAfterColumnBorder() { start(); curTable().curCell().afterColumnBorder.setFromFot( *this ); insertAtomic( curTable().curCell().afterColumnBorder ); end(); } void TeXFOTBuilder::fractionBar() { insertAtomic("FractionBar"); } void TeXFOTBuilder::radicalRadical(const CharacterNIC &c) { setCharacterNIC(c); insertAtomic("RadicalRadical"); } void TeXFOTBuilder::radicalRadicalDefaulted() { insertAtomic("RadicalRadicalDefaulted"); } void TeXFOTBuilder::currentNodePageNumber(const NodePtr &node) { GroveString id; unsigned long ei; // FIX ME! // Only PARTIALLY supported -- I currently allow cross-references // only to elements. if (node->getId(id) == accessOK) { set("Label",id); } else if (node->elementIndex(ei) == accessOK) { set("Element",ei); } else { message(TeXMessages::unsupportedPageNumberNonElement); return; } unsigned long g = node->groveIndex(); if (g) { set("GroveIndex",g); } insertAtomic("CurrentNodePageNumber"); } ////////////////////////////////////////////////////////////////////// // Non-atomic flow objects ////////////////////////////////////////////////////////////////////// void TeXFOTBuilder::startSequence() { start(); if( !curFotElementState().enforcingStructure() ) startGroup("Seq"); } void TeXFOTBuilder::endSequence() { if( !curFotElementState().enforcingStructure() ) endGroup("Seq"); end(); } void TeXFOTBuilder::startLineField(const LineFieldNIC &nic) { start(); setLineFieldNIC(nic); startGroup("LineField"); } void TeXFOTBuilder::endLineField() { endGroup("LineField"); end(); } void TeXFOTBuilder::startParagraph(const ParagraphNIC &nic) { startDisplay( nic ); if( curFormat().FotObjectClass == oc_Cell ) curTable().curCell().paragraphChildrenNum++; start(); setParagraphNIC(nic); #ifdef OUTLINES if (headingSet_){ startGroup("HeadPar"); headingSet_=0; inHeading_=1; top(parStack_).previous_=lastHeaded_; lastHeaded_=parStack_.size() - 1 ; //assert(lastHeaded_!=0); } else{ ParHead par(0); startGroup("Par"); push(parStack_,par); top(parStack_).previous_=lastHeaded_; } #else startGroup("Par"); #endif } void TeXFOTBuilder::endParagraph() { //FIXME : when (headed (level n) (headed level (+ n 1))) // text for level N+1 is emitted before text for level n // and outliens are out of sync. #ifdef OUTLINES if (top(parStack_).isHeaded_){ //cerr << "Writing\n"; //cerr << "length : "< 0 && DisplayBoxLevels.back() == FormatStack.size() ) { DisplayBoxLevels.resize( DisplayBoxLevels.size() - 1 ); endDisplay(); } } // Tables void TeXFOTBuilder::startTable(const TableNIC &nic) { #ifdef TEXDEBUG *fileout_ << "\nTABLE_START\n"; #endif startDisplay( nic ); start(); setTableNIC(nic); Length curStartIndent = computeLengthSpec( curFormat().FotStartIndentSpec ); curTable().startIndent = curStartIndent; curTable().begin(); curTable().displayAlignment = curFormat().FotDisplayAlignment; if( nic.widthType == TableNIC::widthExplicit ) curTable().tableWidth = computeLengthSpec( nic.width ); else curTable().tableWidth = curFormat().FotCurDisplaySize - curStartIndent - computeLengthSpec( curFormat().FotEndIndentSpec ); startGroup( curTable() ); curTable().curTablePart().open( *this ); } void TeXFOTBuilder::endTable() { #ifdef TEXDEBUG *fileout_ << "\nTABLE_END\n"; #endif if( curTable().NoTablePartsSeen ) { curTable().curTablePart().close( *this ); curTable().curTablePart().isExplicit = false; } curTable().end( *this ); curTable().close( *this ); curTable().out( os() ); endGroup(); end(); endDisplay(); } // A call for each border is made immediately // after startTable(), each preceded by any appropriate set*() calls. void TeXFOTBuilder::tableBeforeRowBorder() { start(); curTable().beforeRowBorder.setFromFot( *this ); insertAtomic( curTable().beforeRowBorder ); end(); } void TeXFOTBuilder::tableAfterRowBorder() { start(); curTable().afterRowBorder.setFromFot( *this ); insertAtomic( curTable().afterRowBorder ); end(); } void TeXFOTBuilder::tableBeforeColumnBorder() { start(); curTable().beforeColumnBorder.setFromFot( *this ); insertAtomic( curTable().beforeColumnBorder ); end(); } void TeXFOTBuilder::tableAfterColumnBorder() { start(); curTable().afterColumnBorder.setFromFot( *this ); insertAtomic( curTable().afterColumnBorder ); end(); } void TeXFOTBuilder::startTablePartSerial(const TablePartNIC &nic) { #ifdef TEXDEBUG *fileout_ << "\nTABLE_PART_START\n"; #endif startDisplay( nic ); start(); setTablePartNIC(nic); if( curTable().NoTablePartsSeen ) curTable().NoTablePartsSeen = false; else { curTable().TableParts.resize( curTable().TableParts.size()+1 ); curTable().TableParts.back().setSiblingSeqIdx( curTable().TableParts.size()-1 ); curTable().TableParts.back().setParent( &curTable() ); } curTable().TableParts.back().begin(); curTable().TableParts.back().open( *this ); startGroup( curTable().curTablePart() ); } void TeXFOTBuilder::endTablePartSerial() { curTable().curTablePart().close( *this ); curTable().CurTablePart = NULL; endGroup(); end(); endDisplay(); #ifdef TEXDEBUG *fileout_ << "\nTABLE_PART_END\n"; #endif } void TeXFOTBuilder::startTableRow() { #ifdef TEXDEBUG *fileout_ << "\nTABLE_ROW_START\n"; #endif curTable().curRows().resize( curTable().curRows().size() + 1 ); curTable().curRows().back().setSiblingSeqIdx( curTable().curRows().size()-1 ); curTable().curRows().back().setParent( &curTable().curTablePart() ); startGroup( curTable().curRows().back() ); curTable().curRows().back().open( *this ); } void TeXFOTBuilder::endTableRow() { curTable().curRows().back().close( *this ); endGroup(); #ifdef TEXDEBUG *fileout_ << "\nTABLE_ROW_END\n"; #endif } void TeXFOTBuilder::startTableCell(const TableCellNIC &nic) { #ifdef TEXDEBUG *fileout_ << "\nTABLE_CELL_START index: " << nic.columnIndex << " missing: " << nic.missing << "\n"; #endif setTableCellNIC(nic); TablePart &tp = curTable().curTablePart(); if( !tp.columnsProcessed ) tp.processColumns( *this ); Vector &Cells = curTable().curRows().back().Cells; { size_t curSize = Cells.size(); if( nic.columnIndex >= curSize ) { Cells.resize( nic.columnIndex + 1 ); for( size_t i = curSize; i < Cells.size(); i++ ) Cells[i].setSiblingSeqIdx( i ); } } Cell &cell = Cells[nic.columnIndex]; curTable().CurCell = &cell; cell.missing = nic.missing; cell.setParent( &curTable().curRows().back() ); if( nic.nColumnsSpanned != 1 ) cell.nColumnsSpanned = nic.nColumnsSpanned; if( nic.nRowsSpanned != 1 ) cell.nRowsSpanned = nic.nRowsSpanned; long newDisplaySize = 0; for( size_t i = nic.columnIndex; i < nic.columnIndex + nic.nColumnsSpanned; i++ ) if( i < tp.Columns.size() ) { if( tp.Columns[i].hasWidth ) newDisplaySize += computeLengthSpec( tp.Columns[i].width ); } else if( !nic.missing ) { tp.Columns.resize( tp.Columns.size() + 1 ); tp.Columns.back().hasWidth = false; } if( newDisplaySize > 0 ) { newDisplaySize -= NextFormat.FotCellBeforeColumnMargin + NextFormat.FotCellAfterColumnMargin; NextFormat.FotCurDisplaySize = newDisplaySize; } cell.displaySize = NextFormat.FotCurDisplaySize; cell.displayAlignment = NextFormat.FotDisplayAlignment; elementStart( oc_Cell ); startGroup( cell ); cell.open( *this ); } void TeXFOTBuilder::endTableCell() { curTable().curCell().close( *this ); curTable().CurCell = NULL; endGroup(); end(); #ifdef TEXDEBUG *fileout_ << "\nTABLE_CELL_END\n"; #endif } void TeXFOTBuilder::startSimplePageSequenceSerial() { NextFormat.FotCurDisplaySize = ( NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin - NextFormat.FotPageColumnSep * ( NextFormat.FotPageNColumns - 1 ) ) / NextFormat.FotPageNColumns; start(); startGroup("SpS"); } void TeXFOTBuilder::endSimplePageSequenceSerial() { endGroup("SpS"); end(); } // These aren't real flow objects, so handle them a little // differently. void TeXFOTBuilder::startSimplePageSequenceHeaderFooter(unsigned flags) { os() << "\n\\SpS"; if ((flags & (firstHF|otherHF)) == firstHF) os() << "First"; else os() << "Other"; if ((flags & (frontHF|backHF)) == frontHF) os() << "Front"; else os() << "Back"; switch (flags & (leftHF|centerHF|rightHF)) { case leftHF: os() << "Left"; break; case centerHF: os() << "Center"; break; case rightHF: os() << "Right"; break; } if ((flags & (headerHF|footerHF)) == headerHF) os() << "Header"; else os() << "Footer"; os() << "%\n{"; } void TeXFOTBuilder::endSimplePageSequenceHeaderFooter(unsigned) { endSimpleGroup(); } void TeXFOTBuilder::startTablePartHeader() { curTable().CurRows = &curTable().curTablePart().Header; startGroup( "TablePartHeader", &curTable().curTablePart().HeaderProlog ); } void TeXFOTBuilder::endTablePartHeader() { curTable().CurRows = &curTable().curTablePart().Body; endGroup( "TablePartHeader", &curTable().curTablePart().HeaderEpilog ); } void TeXFOTBuilder::startTablePartFooter() { curTable().CurRows = &curTable().curTablePart().Footer; startGroup( "TablePartFooter", &curTable().curTablePart().FooterProlog ); } void TeXFOTBuilder::endTablePartFooter() { curTable().CurRows = &curTable().curTablePart().Body; endGroup( "TablePartFooter", &curTable().curTablePart().FooterEpilog ); } void TeXFOTBuilder::startMathSequence() { inMath_++; startGroup("MathSeq"); } void TeXFOTBuilder::endMathSequence() { endGroup("MathSeq"); inMath_++; } void TeXFOTBuilder::startFractionSerial() { startGroup("FractionSerial"); } void TeXFOTBuilder::endFractionSerial() { endGroup("FractionSerial"); } void TeXFOTBuilder::startFractionNumerator() { startGroup("FractionNumerator"); } void TeXFOTBuilder::endFractionNumerator() { endGroup("FractionNumerator"); } void TeXFOTBuilder::startFractionDenominator() { startGroup("FractionDenominator"); } void TeXFOTBuilder::endFractionDenominator() { endGroup("FractionDenominator"); } void TeXFOTBuilder::startUnmath() { startBrace("Unmath"); } void TeXFOTBuilder::endUnmath() { endBrace("Unmath"); } void TeXFOTBuilder::startSuperscript() { startBrace("Superscript"); } void TeXFOTBuilder::endSuperscript() { endBrace("Superscript"); } void TeXFOTBuilder::startSubscript() { startBrace("Subscript"); } void TeXFOTBuilder::endSubscript() { endBrace("Subscript"); } void TeXFOTBuilder::startScriptSerial() { startBrace("ScriptSerial"); } void TeXFOTBuilder::endScriptSerial() { } void TeXFOTBuilder::startScriptPreSup() { closeopenBrace("ScriptPreSup"); // ends brace started in startScript Serial } void TeXFOTBuilder::endScriptPreSup() { endSimpleGroup(); } void TeXFOTBuilder::startScriptPreSub() { startSimpleGroup("ScriptPreSub"); } void TeXFOTBuilder::endScriptPreSub() { endSimpleGroup(); } void TeXFOTBuilder::startScriptPostSup() { startSimpleGroup("ScriptPostSup"); } void TeXFOTBuilder::endScriptPostSup() { endSimpleGroup(); } void TeXFOTBuilder::startScriptPostSub() { startSimpleGroup("ScriptPostSub"); } void TeXFOTBuilder::endScriptPostSub() { endSimpleGroup(); } void TeXFOTBuilder::startScriptMidSup() { startSimpleGroup("ScriptMidSup"); } void TeXFOTBuilder::endScriptMidSup() { endSimpleGroup(); } void TeXFOTBuilder::startScriptMidSub() { startSimpleGroup("ScriptMidSub"); } void TeXFOTBuilder::endScriptMidSub() { endSimpleGroup(); } void TeXFOTBuilder::startMarkSerial() { startGroup("MarkSerial"); } void TeXFOTBuilder::endMarkSerial() { endGroup("MarkSerial"); } void TeXFOTBuilder::startMarkOver() { startGroup("MarkOver"); } void TeXFOTBuilder::endMarkOver() { endGroup("MarkOver"); } void TeXFOTBuilder::startMarkUnder() { startGroup("MarkUnder"); } void TeXFOTBuilder::endMarkUnder() { endGroup("MarkUnder"); } void TeXFOTBuilder::startFenceSerial() { startBrace("FenceSerial"); } void TeXFOTBuilder::endFenceSerial() { // endGroup("FenceSerial"); } void TeXFOTBuilder::startFenceOpen() { // Extra closing brace for end of fence body closeopenBrace("FenceOpen"); } void TeXFOTBuilder::endFenceOpen() { endSimpleGroup(); } void TeXFOTBuilder::startFenceClose() { startSimpleGroup("FenceClose"); } void TeXFOTBuilder::endFenceClose() { endSimpleGroup(); } void TeXFOTBuilder::startRadicalSerial() { startGroup("RadicalSerial"); } void TeXFOTBuilder::endRadicalSerial() { endGroup("RadicalSerial"); } void TeXFOTBuilder::startRadicalDegree() { startGroup("RadicalDegree"); } void TeXFOTBuilder::endRadicalDegree() { endGroup("RadicalDegree"); } void TeXFOTBuilder::startMathOperatorSerial() { startGroup("MathOperatorSerial"); } void TeXFOTBuilder::endMathOperatorSerial() { endGroup("MathOperatorSerial"); } void TeXFOTBuilder::startMathOperatorOperator() { startGroup("MathOperatorOperator"); } void TeXFOTBuilder::endMathOperatorOperator() { endGroup("MathOperatorOperator"); } void TeXFOTBuilder::startMathOperatorLowerLimit() { startGroup("MathOperatorLowerLimit"); } void TeXFOTBuilder::endMathOperatorLowerLimit() { endGroup("MathOperatorLowerLimit"); } void TeXFOTBuilder::startMathOperatorUpperLimit() { startGroup("MathOperatorUpperLimit"); } void TeXFOTBuilder::endMathOperatorUpperLimit() { endGroup("MathOperatorUpperLimit"); } void TeXFOTBuilder::startGrid(const GridNIC &nic) { setGridNIC(nic); startGroup("Grid"); } void TeXFOTBuilder::endGrid() { endGroup("Grid"); } void TeXFOTBuilder::startGridCell(const GridCellNIC &nic) { setGridCellNIC(nic); startGroup("GridCell"); } void TeXFOTBuilder::endGridCell() { endGroup("GridCell"); } void TeXFOTBuilder::startNode(const NodePtr &node, const StringC &processingMode) { GroveString id; unsigned long ei; if (node->getId(id) == accessOK) { set("Label",id); } else if (node->elementIndex(ei) == accessOK) { set("Element", ei); } unsigned long g = node->groveIndex(); if (g) { set("GroveIndex", g); } if (processingMode.size()) { set("ProcessingMode", processingMode); } if( curFotElementState().enforcingStructure() ) { startGroup( "Node", &(curFotElementState().CurNodeInfoProlog) ); #ifdef TEXDEBUG *fileout_ << "\nSTART_NODE " << ei << "\n"; #endif } else startGroup("Node"); } void TeXFOTBuilder::endNode() { if( curFotElementState().enforcingStructure() ) { curFotElementState().CurNodeInfoProlog.resize( 0 ); FotElement *lastClosed = CompoundFotElement::lastClosed( curTable() ); if( lastClosed != NULL ) endGroup( "Node", &lastClosed->nodeInfoEpilog() ); #ifdef TEXDEBUG *fileout_ << "\nEND_NODE\n"; #endif } else endGroup("Node"); } void TeXFOTBuilder::startLink(const Address &addr) { GroveString id; unsigned long ei; // FIX ME! // This needs a lot of work -- for now, it supports only links to // elements. switch (addr.type) { case Address::none: break; case Address::resolvedNode: if (addr.node->getId(id) == accessOK) { set("Label",id); } else if (addr.node->elementIndex(ei) == accessOK) { set("Element", ei); } else { message(TeXMessages::unsupportedLinkNonElement); } break; case Address::idref: // just the first IDREF for now set("Label",addr.params[0]); break; case Address::entity: message(TeXMessages::unsupportedLinkEntity); break; case Address::sgmlDocument: message(TeXMessages::unsupportedLinkSgmlDoc); break; case Address::hytimeLinkend: message(TeXMessages::unsupportedLinkHyTime); break; case Address::tei: message(TeXMessages::unsupportedLinkTei); break; case Address::html: set("Label",addr.params[0]); set("LinkType", "url"); break; } if (addr.node) { unsigned long g = addr.node->groveIndex(); if (g) { set("GroveIndex",g); } } startGroup("Link"); } void TeXFOTBuilder::endLink() { endGroup("Link"); } ///////////////////////////////////////////////////////////////////// // Inherited characteristics // Set the value of the characteristic for the next flow object. // Inherited characteristics that are not explicitly set have // the same value as the parent flow object. ////////////////////////////////////////////////////////////////////// void TeXFOTBuilder::setFontSize(Length size) { setlength("fSize",size); } void TeXFOTBuilder::setFontFamilyName(const StringC &name) { stringout_ << "\\def\\fFamName{"; for (size_t i = 0; i < name.size(); i++) { switch(name[i]) { case ' ': stringout_ << '-'; break; default: stringout_ << char(name[i]); break; } } stringout_ << "}"; } void TeXFOTBuilder::setFontWeight(Symbol weight) { set("fWeight",weight); } void TeXFOTBuilder::setFontPosture(Symbol posture) { set("fPosture",posture); } void TeXFOTBuilder::setStartIndent(const LengthSpec &indent) { NextFormat.FotStartIndentSpec = indent; set("StartIndent",indent); } void TeXFOTBuilder::setEndIndent(const LengthSpec &indent) { NextFormat.FotEndIndentSpec = indent; set("EndIndent",indent); } void TeXFOTBuilder::setFirstLineStartIndent(const LengthSpec &indent) { set("FirstLineStartIndent",indent); } void TeXFOTBuilder::setLastLineEndIndent(const LengthSpec &indent) { set("LastLineEndIndent",indent); } void TeXFOTBuilder::setLineSpacing(const LengthSpec &spacing) { set("LineSpacing",spacing); } void TeXFOTBuilder::setFieldWidth(const LengthSpec &width) { set("FieldWidth",width); } void TeXFOTBuilder::setMarginaliaSep(const LengthSpec &sep) { set("MarginaliaSep",sep); } void TeXFOTBuilder::setLines(Symbol lines) { set("Lines",lines); } void TeXFOTBuilder::setQuadding(Symbol quadding) { set("Quadding",quadding); } void TeXFOTBuilder::setDisplayAlignment(Symbol align) { NextFormat.FotDisplayAlignment = align; set("DisplayAlignment",align); } void TeXFOTBuilder::setFieldAlign(Symbol align) { set("FieldAlign",align); } void TeXFOTBuilder::setColor(const DeviceRGBColor &color) { set("Color",color); } void TeXFOTBuilder::setBackgroundColor() { set("BackgroundColor",symbolFalse); } void TeXFOTBuilder::setBackgroundColor(const DeviceRGBColor &color) { set("BackgroundColor",color); } void TeXFOTBuilder::setBorderPresent(bool flag) { NextFormat.FotBorderPresent = flag; set("BorderPresent",flag); } void TeXFOTBuilder::setLineThickness(Length thickness) { NextFormat.FotLineThickness = thickness; setlength("LineThickness",thickness); } void TeXFOTBuilder::setCellBeforeRowMargin(Length margin) { setlength("CellBeforeRowMargin",margin); } void TeXFOTBuilder::setCellAfterRowMargin(Length margin) { setlength("CellAfterRowMargin",margin); } void TeXFOTBuilder::setCellBeforeColumnMargin(Length margin) { NextFormat.FotCellBeforeColumnMargin = margin; setlength("CellBeforeColumnMargin",margin); } void TeXFOTBuilder::setCellAfterColumnMargin(Length margin) { NextFormat.FotCellAfterColumnMargin = margin; setlength("CellAfterColumnMargin",margin); } void TeXFOTBuilder::setLineSep(Length sep) { NextFormat.FotLineSep = sep; setlength("LineSep",sep); } void TeXFOTBuilder::setBoxSizeBefore(Length size) { setlength("BoxSizeBefore",size); } void TeXFOTBuilder::setBoxSizeAfter(Length size) { setlength("BoxSizeAfter",size); } void TeXFOTBuilder::setPositionPointShift(const LengthSpec &shift) { set("PositionPointShift",shift); } void TeXFOTBuilder::setStartMargin(const LengthSpec &margin) { set("StartMargin",margin); } void TeXFOTBuilder::setEndMargin(const LengthSpec &margin) { set("EndMargin",margin); } void TeXFOTBuilder::setSidelineSep(const LengthSpec &sep) { set("SidelineSep",sep); } void TeXFOTBuilder::setAsisWrapIndent(const LengthSpec &indent) { set("AsisWrapIndent",indent); } void TeXFOTBuilder::setLineNumberSep(const LengthSpec &sep) { set("LineNumberSep",sep); } void TeXFOTBuilder::setLastLineJustifyLimit(const LengthSpec &limit) { set("LastLineJustifyLimit",limit); } void TeXFOTBuilder::setJustifyGlyphSpaceMaxAdd(const LengthSpec &max) { set("JustifyGlyphSpaceMaxAdd",max); } void TeXFOTBuilder::setJustifyGlyphSpaceMaxRemove(const LengthSpec &max) { set("JustifyGlyphSpaceMaxRemove",max); } void TeXFOTBuilder::setTableCornerRadius(const LengthSpec &radius) { set("TableCornerRadius",radius); } void TeXFOTBuilder::setBoxCornerRadius(const LengthSpec &radius) { set("BoxCornerRadius",radius); } void TeXFOTBuilder::setInhibitLineBreaks(bool flag) { set("InhibitLineBreaks",flag); } void TeXFOTBuilder::setHyphenate(bool flag) { set("Hyphenate",flag); } void TeXFOTBuilder::setKern(bool flag) { set("Kern",flag); } void TeXFOTBuilder::setLigature(bool flag) { set("Ligature",flag); } void TeXFOTBuilder::setScoreSpaces(bool flag) { set("ScoreSpaces",flag); } void TeXFOTBuilder::setFloatOutMarginalia(bool flag) { set("FloatOutMarginalia",flag); } void TeXFOTBuilder::setFloatOutSidelines(bool flag) { set("FloatOutSidelines",flag); } void TeXFOTBuilder::setFloatOutLineNumbers(bool flag) { set("FloatOutLineNumbers",flag); } void TeXFOTBuilder::setCellBackground(bool flag) { set("CellBackground",flag); } void TeXFOTBuilder::setSpanWeak(bool flag) { set("SpanWeak",flag); } void TeXFOTBuilder::setIgnoreRecordEnd(bool flag) { set("IgnoreRecordEnd",flag); } void TeXFOTBuilder::setNumberedLines(bool flag) { set("NumberedLines",flag); } void TeXFOTBuilder::setHangingPunct(bool flag) { set("HangingPunct",flag); } void TeXFOTBuilder::setBoxOpenEnd(bool flag) { set("BoxOpenEnd",flag); } void TeXFOTBuilder::setTruncateLeader(bool flag) { set("TruncateLeader",flag); } void TeXFOTBuilder::setAlignLeader(bool flag) { set("AlignLeader",flag); } void TeXFOTBuilder::setTablePartOmitMiddleHeader(bool flag) { set("TablePartOmitMiddleHeader",flag); } void TeXFOTBuilder::setTablePartOmitMiddleFooter(bool flag) { set("TablePartOmitMiddleFooter",flag); } void TeXFOTBuilder::setBorderOmitAtBreak(bool flag) { set("BorderOmitAtBreak",flag); } void TeXFOTBuilder::setPrincipalModeSimultaneous(bool flag) { set("PrincipalModeSimultaneous",flag); } void TeXFOTBuilder::setMarginaliaKeepWithPrevious(bool flag) { set("MarginaliaKeepWithPrevious",flag); } void TeXFOTBuilder::setLineJoin(Symbol join) { set("LineJoin",join); } void TeXFOTBuilder::setLineCap(Symbol cap) { NextFormat.FotLineCap = cap; set("LineCap",cap); } void TeXFOTBuilder::setLineNumberSide(Symbol side) { set("LineNumberSide",side); } void TeXFOTBuilder::setKernMode(Symbol mode) { set("KernMode",mode); } void TeXFOTBuilder::setInputWhitespaceTreatment(Symbol treatment) { set("InputWhitespaceTreatment",treatment); } void TeXFOTBuilder::setFillingDirection(Symbol direction) { set("FillingDirection",direction); } void TeXFOTBuilder::setWritingMode(Symbol mode) { set("WritingMode",mode); } void TeXFOTBuilder::setLastLineQuadding(Symbol quadding) { set("LastLineQuadding",quadding); } void TeXFOTBuilder::setMathDisplayMode(Symbol mode) { set("MathDisplayMode",mode); } void TeXFOTBuilder::setBoxType(Symbol type) { set("BoxType",type); } void TeXFOTBuilder::setGlyphAlignmentMode(Symbol mode) { set("GlyphAlignmentMode",mode); } void TeXFOTBuilder::setBoxBorderAlignment(Symbol align) { set("BoxBorderAlignment",align); } void TeXFOTBuilder::setCellRowAlignment(Symbol align) { set("CellRowAlignment",align); } void TeXFOTBuilder::setBorderAlignment(Symbol align) { set("BorderAlignment",align); } void TeXFOTBuilder::setSidelineSide(Symbol side) { set("SidelineSide",side); } void TeXFOTBuilder::setHyphenationKeep(Symbol keep) { set("HyphenationKeep",keep); } void TeXFOTBuilder::setFontStructure(Symbol structure) { set("fStructure",structure); } void TeXFOTBuilder::setFontProportionateWidth(Symbol width) { set("fProportionateWidth",width); } void TeXFOTBuilder::setCellCrossed(Symbol crossed) { set("CellCrossed",crossed); } void TeXFOTBuilder::setMarginaliaSide(Symbol side) { set("MarginaliaSide",side); } void TeXFOTBuilder::setLayer(long n) { set("Layer",n); } void TeXFOTBuilder::setBackgroundLayer(long n) { set("BackgroundLayer",n); } void TeXFOTBuilder::setBorderPriority(long n) { NextFormat.FotBorderPriority = n; set("BorderPriority",n); } void TeXFOTBuilder::setLineRepeat(long n) { NextFormat.FotLineRepeat = n; set("LineRepeat",n); } void TeXFOTBuilder::setSpan(long n) { NextFormat.FotSpan = n; set("Span",n); } void TeXFOTBuilder::setMinLeaderRepeat(long n) { set("MinLeaderRepeat",n); } void TeXFOTBuilder::setHyphenationRemainCharCount(long n) { set("HyphenationRemainCharCount",n); } void TeXFOTBuilder::setHyphenationPushCharCount(long n) { set("HyphenationPushCharCount",n); } void TeXFOTBuilder::setWidowCount(long n) { set("WidowCount",n); } void TeXFOTBuilder::setOrphanCount(long n) { set("OrphanCount",n); } // 0 means #f void TeXFOTBuilder::setExpandTabs(long n) { set("ExpandTabs",n); } void TeXFOTBuilder::setHyphenationLadderCount(long n) { set("HyphenationLadderCount",n); } // public id or #f void TeXFOTBuilder::setBackgroundTile(PublicId id) { set("BackgroundTile",id); } void TeXFOTBuilder::setLineBreakingMethod(PublicId id) { set("LineBreakingMethod",id); } void TeXFOTBuilder::setLineCompositionMethod(PublicId id) { set("LineCompositionMethod",id); } void TeXFOTBuilder::setImplicitBidiMethod(PublicId id) { set("ImplicitBidiMethod",id); } void TeXFOTBuilder::setGlyphSubstMethod(PublicId id) { set("GlyphSubstMethod",id); } void TeXFOTBuilder::setGlyphReorderMethod(PublicId id) { set("GlyphReorderMethod",id); } void TeXFOTBuilder::setHyphenationMethod(PublicId id) { set("HyphenationMethod",id); } void TeXFOTBuilder::setTableAutoWidthMethod(PublicId id) { set("TableAutoWidthMethod",id); } void TeXFOTBuilder::setFontName(PublicId id) { set("fName",id); } // Two-letter code void TeXFOTBuilder::setLanguage(Letter2 language) { setletter2("Language",language); } void TeXFOTBuilder::setCountry(Letter2 country) { setletter2("Country",country); } // For simple page sequence void TeXFOTBuilder::setPageWidth(Length width) { NextFormat.FotPageWidth = width; setlength("PageWidth",width); } void TeXFOTBuilder::setPageHeight(Length height) { setlength("PageHeight",height); } void TeXFOTBuilder::setLeftMargin(Length margin) { NextFormat.FotLeftMargin = margin; setlength("LeftMargin",margin); } void TeXFOTBuilder::setRightMargin(Length margin) { NextFormat.FotRightMargin = margin; setlength("RightMargin",margin); } void TeXFOTBuilder::setTopMargin(Length margin) { setlength("TopMargin",margin); } void TeXFOTBuilder::setBottomMargin(Length margin) { setlength("BottomMargin",margin); } void TeXFOTBuilder::setHeaderMargin(Length margin) { setlength("HeaderMargin",margin); } void TeXFOTBuilder::setFooterMargin(Length margin) { setlength("FooterMargin",margin); } // New inherited characteristics // added 1 March/97 with math support. void TeXFOTBuilder::setMinPreLineSpacing(const OptLengthSpec &len) { set("MinPreLineSpacing",len); } void TeXFOTBuilder::setMinPostLineSpacing(const OptLengthSpec &len) { set("MinPostLineSpacing",len); } void TeXFOTBuilder::setMinLeading(const OptLengthSpec &len) { set("MinLeading",len); } void TeXFOTBuilder::setScriptPreAlign(Symbol sym) { set("ScriptPreAlign",sym); } void TeXFOTBuilder::setScriptPostAlign(Symbol sym) { set("ScriptPostAlign",sym); } void TeXFOTBuilder::setScriptMidSupAlign(Symbol sym) { set("ScriptMidSupAlign",sym); } void TeXFOTBuilder::setScriptMidSubAlign(Symbol sym) { set("ScriptMidSubAlign",sym); } void TeXFOTBuilder::setNumeratorAlign(Symbol sym) { set("NumeratorAlign",sym); } void TeXFOTBuilder::setDenominatorAlign(Symbol sym) { set("DenominatorAlign",sym); } void TeXFOTBuilder::setGridPositionCellType(Symbol sym) { set("GridPositionCellType",sym); } void TeXFOTBuilder::setGridColumnAlignment(Symbol sym) { set("GridColumnAlignment",sym); } void TeXFOTBuilder::setGridRowAlignment(Symbol sym) { set("GridRowAlignment",sym); } void TeXFOTBuilder::setGridEquidistantRows(bool flag) { set("GridEquidistantRows",flag); } void TeXFOTBuilder::setGridEquidistantColumns(bool flag) { set("GridEquidistantColumns",flag); } void TeXFOTBuilder::setEscapementSpaceBefore(const InlineSpace &space) { set("EscapementSpaceBefore",space); } void TeXFOTBuilder::setEscapementSpaceAfter(const InlineSpace &space) { set("EscapementSpaceAfter",space); } void TeXFOTBuilder::setInlineSpaceSpace(const OptInlineSpace &space) { set("InlineSpaceSpace",space); } void TeXFOTBuilder::setGlyphSubstTable(const Vector > &) { // FIX ME! message(TeXMessages::unsupportedGlyphSubstTable); // set("GlyphSubstTable",tables); } //////////////////////////////////////////////////////////////////////// // Private member functions. //////////////////////////////////////////////////////////////////////// // // Insert an atomic flow object. // void TeXFOTBuilder::insertAtomic(const char *name) { os() << "\\insert" << name << "%\n{"; dumpInherited(); os() << '}'; } void TeXFOTBuilder::insertAtomic( TeXFOTBuilder::FotElement &fotElement ) { stringout_.extractString( fotElement.Characteristics ); } // // Start a non-atomic flow object. // void TeXFOTBuilder::startGroup(const char *name, String *output ) { if( output ) { String s; stringout_.extractString( s ); StrOutputByteStream out; out << "\\" << name << "%\n{" << s << '}'; out.extractString( s ); *output += s; } else { os() << "\\" << name << "%\n{"; dumpInherited(); os() << '}'; } } void TeXFOTBuilder::startGroup( TeXFOTBuilder::FotElement &fotElement ) { stringout_.extractString( fotElement.Characteristics ); } // // Start a non-atomic flow object, with the content delimited by braces, // but no macro name at all; we just emit all the characteristics in // the stream after the brace. // void TeXFOTBuilder::startSimpleGroup(const char *name, String *output ) { if( output ) { String s; stringout_.extractString( s ); StrOutputByteStream out; out << "%\n{" << s ; out.extractString( s ); *output += s; } else { os() << "%\n{"; dumpInherited(); } } // // End with just a closing brace // void TeXFOTBuilder::endSimpleGroup(String *output ) { if( output ) { StrOutputByteStream out; out << "}"; String s; out.extractString( s ); *output += s; } else os() << "}"; } // // Stop and start a brace, but note characteristics // void TeXFOTBuilder::closeopenBrace(const char *name, String *output ) { if( output ) { String s; stringout_.extractString( s ); StrOutputByteStream out; out << "}{" << s ; out.extractString( s ); *output += s; } else { os() << "}{"; dumpInherited(); } } // // Start a non-atomic flow object, with the content delimited by braces // void TeXFOTBuilder::startBrace(const char *name, String *output ) { if( output ) { String s; stringout_.extractString( s ); StrOutputByteStream out; out << "\\" << name << "%\n{" << s << "}{"; out.extractString( s ); *output += s; } else { os() << "\\" << name << "%\n{"; dumpInherited(); os() << "}{"; } } // // End a non-atomic flow object with just a closing brace // void TeXFOTBuilder::endBrace(const char *name, String *output ) { if( output ) { StrOutputByteStream out; out << "}"; String s; out.extractString( s ); *output += s; } else os() << "}"; } // // End a non-atomic flow object. // void TeXFOTBuilder::endGroup(const char *name, String *output ) { if( output ) { StrOutputByteStream out; out << "\\end" << name << "{}"; String s; out.extractString( s ); *output += s; } else os() << "\\end" << name << "{}"; } // // Set a Length (needs a different name to avoid conflict // with long. // void TeXFOTBuilder::setlength(const char *name,Length size) { stringout_ << "\\def\\" << name << "%\n{" << float(size/1000.0) << "\\p@}"; } // // Set a StringC. // void TeXFOTBuilder::set(const char *name,const StringC &value) { stringout_ << "\\def\\" << name << "%\n{" << value << '}'; } // // Set a GroveString // void TeXFOTBuilder::set(const char *name,const GroveString &value) { stringout_ << "\\def\\" << name << "%\n{" << value << '}'; } // // Set a Symbol. // void TeXFOTBuilder::set(const char *name,Symbol sym) { const char * symbolName = ""; switch (sym) { case symbolFalse: symbolName = "false"; break; case symbolTrue: symbolName = "true"; break; case symbolNotApplicable: symbolName = "notapplicable"; break; case symbolUltraCondensed: symbolName = "ultracondensed"; break; case symbolExtraCondensed: symbolName = "extracondensed"; break; case symbolCondensed: symbolName = "condensed"; break; case symbolSemiCondensed: symbolName = "semicondensed"; break; case symbolUltraLight: symbolName = "ultralight"; break; case symbolExtraLight: symbolName = "extralight"; break; case symbolLight: symbolName = "light"; break; case symbolSemiLight: symbolName = "semilight"; break; case symbolMedium: symbolName = "medium"; break; case symbolSemiExpanded: symbolName = "semiexpanded"; break; case symbolExpanded: symbolName = "expanded"; break; case symbolExtraExpanded: symbolName = "extraexpanded"; break; case symbolUltraExpanded: symbolName = "ultraexpanded"; break; case symbolSemiBold: symbolName = "semibold"; break; case symbolBold: symbolName = "bold"; break; case symbolExtraBold: symbolName = "extrabold"; break; case symbolUltraBold: symbolName = "ultrabold"; break; case symbolUpright: symbolName = "upright"; break; case symbolOblique: symbolName = "oblique"; break; case symbolBackSlantedOblique: symbolName = "backslantedoblique"; break; case symbolItalic: symbolName = "italic"; break; case symbolBackSlantedItalic: symbolName = "backslanteditalic"; break; case symbolStart: symbolName = "start"; break; case symbolEnd: symbolName = "end"; break; case symbolCenter: symbolName = "center"; break; case symbolJustify: symbolName = "justify"; break; case symbolSpreadInside: symbolName = "spreadinside"; break; case symbolSpreadOutside: symbolName = "spreadoutside"; break; case symbolPageInside: symbolName = "pageinside"; break; case symbolPageOutside: symbolName = "pageoutside"; break; case symbolWrap: symbolName = "wrap"; break; case symbolAsis: symbolName = "asis"; break; case symbolAsisWrap: symbolName = "asiswrap"; break; case symbolAsisTruncate: symbolName = "asistruncate"; break; case symbolNone: symbolName = "none"; break; case symbolBefore: symbolName = "before"; break; case symbolThrough: symbolName = "through"; break; case symbolAfter: symbolName = "after"; break; case symbolTopToBottom: symbolName = "toptobottom"; break; case symbolLeftToRight: symbolName = "lefttoright"; break; case symbolBottomToTop: symbolName = "bottomtotop"; break; case symbolRightToLeft: symbolName = "righttoleft"; break; case symbolInside: symbolName = "inside"; break; case symbolOutside: symbolName = "outside"; break; case symbolHorizontal: symbolName = "horizontal"; break; case symbolVertical: symbolName = "vertical"; break; case symbolEscapement: symbolName = "escapement"; break; case symbolLineProgression: symbolName = "lineprogression"; break; case symbolMath: symbolName = "math"; break; case symbolOrdinary: symbolName = "ordinary"; break; case symbolOperator: symbolName = "operator"; break; case symbolBinary: symbolName = "binary"; break; case symbolRelation: symbolName = "relation"; break; case symbolOpening: symbolName = "opening"; break; case symbolClosing: symbolName = "closing"; break; case symbolPunctuation: symbolName = "punctuation"; break; case symbolInner: symbolName = "inner"; break; case symbolSpace: symbolName = "space"; break; case symbolPage: symbolName = "page"; break; case symbolPageRegion: symbolName = "pageregion"; break; case symbolColumnSet: symbolName = "columnset"; break; case symbolColumn: symbolName = "column"; break; case symbolMax: symbolName = "max"; break; case symbolMaxUniform: symbolName = "maxuniform"; break; case symbolMiter: symbolName = "miter"; break; case symbolRound: symbolName = "round"; break; case symbolBevel: symbolName = "bevel"; break; case symbolButt: symbolName = "butt"; break; case symbolSquare: symbolName = "square"; break; case symbolLoose: symbolName = "loose"; break; case symbolNormal: symbolName = "normal"; break; case symbolKern: symbolName = "kern"; break; case symbolTight: symbolName = "tight"; break; case symbolTouch: symbolName = "touch"; break; case symbolPreserve: symbolName = "preserve"; break; case symbolCollapse: symbolName = "collapse"; break; case symbolIgnore: symbolName = "ignore"; break; case symbolRelative: symbolName = "relative"; break; case symbolDisplay: symbolName = "display"; break; case symbolInline: symbolName = "inline"; break; case symbolBorder: symbolName = "border"; break; case symbolBackground: symbolName = "background"; break; case symbolBoth: symbolName = "both"; break; case symbolBase: symbolName = "base"; break; case symbolFont: symbolName = "font"; break; case symbolTop: symbolName = "top"; break; case symbolBottom: symbolName = "bottom"; break; case symbolSpread: symbolName = "spread"; break; case symbolSolid: symbolName = "solid"; break; case symbolOutline: symbolName = "outline"; break; case symbolWith: symbolName = "with"; break; case symbolAgainst: symbolName = "against"; break; case symbolForce: symbolName = "force"; break; case symbolIndependent: symbolName = "independent"; break; case symbolPile: symbolName = "pile"; break; case symbolSupOut: symbolName = "supout"; break; case symbolSubOut: symbolName = "subout"; break; case symbolLeadEdge: symbolName = "leadedge"; break; case symbolTrailEdge: symbolName = "trailedge"; break; case symbolExplicit: symbolName = "explicit"; break; case symbolRowMajor: symbolName = "rowmajor"; break; case symbolColumnMajor: symbolName = "columnmajor"; break; } stringout_ << "\\def\\" << name << "%\n{" << symbolName << '}'; } // // Set a LengthSpec. // void TeXFOTBuilder::set(const char *name,const LengthSpec &spec) { stringout_ << "\\def\\" << name << "%\n{" << float(spec.length/1000.0) << "\\p@}"; stringout_ << "\\def\\" << name << "Factor%\n{" << spec.displaySizeFactor << '}'; } // // Set a double. // void TeXFOTBuilder::set(const char *name,double n) { stringout_ << "\\def\\" << name << "%\n{" << n << '}'; } // // Set a DeviceRGBColor. // void TeXFOTBuilder::set(const char *name, const DeviceRGBColor &color) { stringout_ << "\\def\\" << name << "Red%\n{" << int(color.red) << '}'; stringout_ << "\\def\\" << name << "Green%\n{" << int(color.green) << '}'; stringout_ << "\\def\\" << name << "Blue%\n{" << int(color.blue) << '}'; } // // Set a bool. // void TeXFOTBuilder::set(const char *name,bool flag) { stringout_ << "\\def\\" << name << "%\n{" << (flag ? 1 : 0) << '}'; } // // Set a long. // void TeXFOTBuilder::set(const char *name,long n) { stringout_ << "\\def\\" << name << "%\n{" << n << '}'; } // // Set an unsigned long. // void TeXFOTBuilder::set(const char *name,long unsigned int n) { stringout_ << "\\def\\" << name << "%\n{" << n << '}'; } // // Set a PublicId. // void TeXFOTBuilder::set(const char *name,PublicId id) { stringout_ << "\\def\\" << name << "%\n{" << id << '}'; } // // Set a Letter2. // void TeXFOTBuilder::setletter2(const char *name,Letter2 code) { char letter1 = (code & 0xff00) >> 8; char letter2 = (code & 0xff); stringout_ << "\\def\\" << name << "%\n{" << letter1 << letter2 << '}'; } // // This one is a problem because it duplications functionality from // above. // void TeXFOTBuilder::set(const char *name,const DisplaySpace &space) { if (space.nominal.length != 0 || space.min.length != 0 || space.max.length != 0) { stringout_ << "\\def\\" << name << "Nom%\n{" << (space.nominal.length/1000.0) << "\\p@}"; if (space.nominal.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "NomFactor%\n{" << space.nominal.displaySizeFactor << '}'; if (space.min.length != 0) stringout_ << "\\def\\" << name << "Min%\n{" << (space.min.length/1000.0) << "\\p@}"; if (space.min.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "MinFactor%\n{" << space.min.displaySizeFactor << '}'; if (space.max.length != 0) stringout_ << "\\def\\" << name << "Max%\n{" << (space.max.length/1000.0) << "\\p@}"; if (space.max.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "MaxFactor%\n{" << space.max.displaySizeFactor << '}'; if (space.priority != 0) stringout_ << "\\def\\" << name << "Priority%\n{" << space.priority << '}'; if (space.conditional) stringout_ << "\\def\\" << name << "Conditional%\n{" << (space.conditional ? 1 : 0) << '}'; if (space.force) stringout_ << "\\def\\" << name << "Force%\n{" << (space.force ? 1 : 0) << '}'; } } void TeXFOTBuilder::set(const char *name,const GlyphId &glyphId) { stringout_ << "\\def\\" << name << "%\n{"; if (glyphId.publicId) { stringout_ << glyphId.publicId; if (glyphId.suffix) stringout_ << "::" << glyphId.suffix; } stringout_ << '}'; } void TeXFOTBuilder::set(const char *name,const OptLengthSpec &spec) { if (spec.hasLength) { set(name,spec.length); } } void TeXFOTBuilder::set(const char *name,const OptInlineSpace &spec) { if (spec.hasSpace) { set(name,spec.space); } } // This one is also a problem because it duplicates functionality. void TeXFOTBuilder::set(const char *name,const InlineSpace &space) { if (space.nominal.length != 0 || space.min.length != 0 || space.max.length != 0) { stringout_ << "\\def\\" << name << "Nom%\n{" << (space.nominal.length/1000.0) << "\\p@}"; if (space.nominal.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "NomFactor%\n{" << space.nominal.displaySizeFactor << '}'; if (space.min.length != 0) stringout_ << "\\def\\" << name << "Min%\n{" << (space.min.length/1000.0) << "\\p@}"; if (space.min.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "MinFactor%\n{" << space.min.displaySizeFactor << '}'; if (space.max.length != 0) stringout_ << "\\def\\" << name << "Max%\n{" << (space.max.length/1000.0) << "\\p@}"; if (space.max.displaySizeFactor != 0) stringout_ << "\\def\\" << name << "MaxFactor%\n{" << space.max.displaySizeFactor << '}'; } } // // Structures for non-inherited characters, in the order specified // in /style/FOTBuilder.h. // void TeXFOTBuilder::setDisplayNIC(const DisplayNIC &nic) { set("sb",nic.spaceBefore); set("sa",nic.spaceAfter); MAYBESET("PositionPreference",nic.positionPreference,symbolFalse); MAYBESET("Keep",nic.keep,symbolFalse); MAYBESET("BreakBefore",nic.breakBefore,symbolFalse); MAYBESET("BreakAfter",nic.breakAfter,symbolFalse); MAYBESET("KeepWithPrevious",nic.keepWithPrevious,symbolFalse); MAYBESET("KeepWithNext",nic.keepWithNext,symbolFalse); MAYBESET("MayViolateKeepBefore",nic.mayViolateKeepBefore,symbolFalse); MAYBESET("MayViolateKeepAfter",nic.mayViolateKeepAfter,symbolFalse); } void TeXFOTBuilder::setInlineNIC(const InlineNIC &nic) { MAYBESET("BreakBeforePriority",nic.breakBeforePriority,0); MAYBESET("BreakAfterPriority",nic.breakAfterPriority,0); } void TeXFOTBuilder::setDisplayGroupNIC(const DisplayGroupNIC &nic) { setDisplayNIC(nic); if (nic.hasCoalesceId) set("CoalesceId",nic.coalesceId); } void TeXFOTBuilder::setExternalGraphicNIC(const ExternalGraphicNIC &nic) { setDisplayNIC(nic); setInlineNIC(nic); MAYBESET("IsDisplay",nic.isDisplay,symbolFalse); MAYBESET("ScaleType",nic.scaleType,symbolMaxUniform); if (nic.scaleType == symbolFalse) { set("ScaleX",nic.scale[0]); set("ScaleY",nic.scale[1]); } set("EntitySystemId",nic.entitySystemId); set("NotationSystemId",nic.notationSystemId); if(nic.hasMaxWidth) set("MaxWidth",nic.maxWidth); if (nic.hasMaxHeight) set("MaxHeight",nic.maxHeight); if (!nic.isDisplay) { set("EscapementDirection",nic.escapementDirection); set("PositionPointX",nic.positionPointX); set("PositionPointY",nic.positionPointY); } } void TeXFOTBuilder::setBoxNIC(const BoxNIC &nic) { setDisplayNIC(nic); setInlineNIC(nic); // BoxNIC MAYBESET("IsDisplay",nic.isDisplay,symbolFalse); } void TeXFOTBuilder::setRuleNIC(const RuleNIC &nic) { setDisplayNIC(nic); setInlineNIC(nic); // Rule NIC set("Orientation",nic.orientation); if (nic.hasLength) set("Length",nic.length); } void TeXFOTBuilder::setLeaderNIC(const LeaderNIC &nic) { setInlineNIC(nic); if (nic.hasLength) set("Length",nic.length); } void TeXFOTBuilder::setParagraphNIC(const ParagraphNIC &nic) { setDisplayNIC(nic); } void TeXFOTBuilder::setCharacterNIC(const CharacterNIC &nic) { if (nic.specifiedC & (1 << CharacterNIC::cChar)) set("Ch",(unsigned long)nic.ch); if (nic.specifiedC & (1 << CharacterNIC::cGlyphId)) { if(nic.glyphId.publicId) set("GlyphId",nic.glyphId); } if (nic.specifiedC & (1 << CharacterNIC::cBreakBeforePriority)) MAYBESET("BreakBeforePriority",nic.breakBeforePriority,0); if (nic.specifiedC & (1 << CharacterNIC::cBreakAfterPriority)) MAYBESET("BreakAfterPriority",nic.breakAfterPriority,0); if (nic.specifiedC & (1 << CharacterNIC::cMathClass)) MAYBESET("MathClass",nic.mathClass,symbolOrdinary); if (nic.specifiedC & (1 << CharacterNIC::cMathFontPosture)) MAYBESET("MathFontPosture",nic.mathFontPosture,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cScript)) MAYBESET("Script",(long unsigned int)nic.script,0); if (nic.specifiedC & (1 << CharacterNIC::cIsDropAfterLineBreak)) MAYBESET("IsDropAfterLineBreak",nic.isDropAfterLineBreak,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsDropUnlessBeforeLineBreak)) MAYBESET("IsDropUnlessBeforeLineBreak",nic.isDropUnlessBeforeLineBreak,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsPunct)) MAYBESET("IsPunct",nic.isPunct,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsInputWhitespace)) MAYBESET("IsInputWhiteSpace",nic.isInputWhitespace,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsInputTab)) MAYBESET("IsInputTab",nic.isInputTab,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsRecordEnd)) MAYBESET("IsRecordEnd",nic.isRecordEnd,symbolFalse); if (nic.specifiedC & (1 << CharacterNIC::cIsSpace)) MAYBESET("IsSpace",nic.isSpace,symbolFalse); MAYBESET("StretchFactor",nic.stretchFactor,1.0); } void TeXFOTBuilder::setLineFieldNIC(const LineFieldNIC &nic) { setInlineNIC(nic); } void TeXFOTBuilder::setTableNIC(const TableNIC &nic) { setDisplayNIC(nic); // TableNIC switch (nic.widthType) { case TableNIC::widthFull: set("TableWidth","full"); break; case TableNIC::widthMinimum: set("TableWidth","minimum"); break; case TableNIC::widthExplicit: set("TableWidth",nic.width); break; } } void TeXFOTBuilder::setTablePartNIC(const TablePartNIC &nic) { setDisplayNIC(nic); } void TeXFOTBuilder::setTableColumnNIC(const TableColumnNIC &nic) { MAYBESET("ColumnIndex",long(nic.columnIndex),0); MAYBESET("NColumnsSpanned",long(nic.nColumnsSpanned),1); if (nic.hasWidth) set("Width",nic.width); } void TeXFOTBuilder::setTableCellNIC(const TableCellNIC &nic) { // FIX ME! // does not deal with "missing" bool yet. MAYBESET("ColumnIndex",long(nic.columnIndex),0); MAYBESET("NColumnsSpanned",long(nic.nColumnsSpanned),1); MAYBESET("NRowsSpanned",long(nic.nRowsSpanned),1); } void TeXFOTBuilder::setGridNIC(const GridNIC &nic) { set("NColumns",nic.nColumns); set("NRows",nic.nRows); } void TeXFOTBuilder::setGridCellNIC(const GridCellNIC &nic) { set("ColumnNumber",nic.columnNumber); set("RowNumber",nic.rowNumber); } // Dump all accumulated inherited characteristics. void TeXFOTBuilder::dumpInherited() { String tem; stringout_.extractString(tem); os() << tem; } void TeXFOTBuilder::message(const MessageType0 &msg) { mgr_->message(msg); } void TeXFOTBuilder::setPageNumberFormat(const StringC &name) { set("PageNumberFormat",name); } void TeXFOTBuilder::setPageNColumns(long n) { NextFormat.FotPageNColumns = n; set("PageNColumns",n); } void TeXFOTBuilder::setPageColumnSep(Length w) { NextFormat.FotPageColumnSep = w; setlength("PageColumnSep",w); } void TeXFOTBuilder::setPageBalanceColumns(bool flag) { set("PageBalanceColumns",flag); } void TeXFOTBuilder::setSubscriptDepth(Length w) { setlength("SubScriptDepth",w); } void TeXFOTBuilder::setOverMarkHeight(Length w) { setlength("OverMarkHeight",w); } void TeXFOTBuilder::setUnderMarkDepth(Length w) { setlength("UnderMarkDepth",w); } void TeXFOTBuilder::setSuperscriptHeight(Length w) { setlength("SuperscriptHeight",w); } void TeXFOTBuilder::setGridRowSep(Length w) { setlength("GridRowsep",w); } void TeXFOTBuilder::setGridColumnSep(Length w) { setlength("GridColumnSep",w); } void TeXFOTBuilder::setHeadingLevel(long n) { #ifdef OUTLINES if ((n >=1) && (n <=9)){ ParHead par(1,n); headingSet_=1; push(parStack_,par); set("HeadingLevel",n); } #else set("HeadingLevel",n); #endif } void TeXFOTBuilder::setPageNumberRestart(bool flag) { set("PageNumberRestart",flag); } void TeXFOTBuilder::startPageFloat(const PageFloatNIC &nic) { setPageFloatNIC(nic); startGroup("PageFloat"); } void TeXFOTBuilder::endPageFloat() { endGroup("PageFloat"); } void TeXFOTBuilder::startPageFootnote() { startBrace("PageFootnote"); } void TeXFOTBuilder::endPageFootnote() { endBrace("PageFootnote"); } void TeXFOTBuilder::setPageFloatNIC(const PageFloatNIC &nic) { set("placement",nic.placement); } TeXFOTBuilder::PageFloatNIC::~PageFloatNIC() { } void TeXFOTBuilder::extension(const ExtensionFlowObj &fo, const NodePtr &nd) { ((const TeXExtensionFlowObj &)fo).atomic(*this, nd); } void TeXFOTBuilder::startExtensionSerial(const CompoundExtensionFlowObj &fo, const NodePtr &nd) { ((const TeXCompoundExtensionFlowObj &)fo).start(*this, nd); } void TeXFOTBuilder::endExtensionSerial(const CompoundExtensionFlowObj &fo) { ((const TeXCompoundExtensionFlowObj &)fo).end(*this); } void TeXFOTBuilder::setPreserveSdata(bool b) { preserveSdata_ = b; } void TeXFOTBuilder::charactersFromNode(const NodePtr &nd, const Char *s, size_t n) { GroveString name; if (preserveSdata_ && n == 1 && nd->getEntityName(name) == accessOK) os() << "\\Entity{" << name << '}'; else TeXFOTBuilder::characters(s, n); } #ifdef DSSSL_NAMESPACE } #endif #include "TeXFOTBuilder_inst.cxx" OpenJade-1.4devel/jade/TransformFOTBuilder.cxx0000644000021000000240000003604107032347562015021 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #include "TransformFOTBuilder.h" #include "FOTBuilder.h" #include #include #include #include "dsssl_ns.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif const char RE = '\r'; class TransformFOTBuilder : public SerialFOTBuilder { public: // SGML Transformations struct DocumentTypeNIC { ~DocumentTypeNIC(); StringC name; StringC publicId; StringC systemId; }; struct ElementNIC { ~ElementNIC(); StringC gi; Vector attributes; }; class TransformExtensionFlowObj : public FOTBuilder::ExtensionFlowObj { public: virtual void atomic(TransformFOTBuilder &, const NodePtr &) const = 0; }; class TransformCompoundExtensionFlowObj : public FOTBuilder::CompoundExtensionFlowObj { public: virtual void start(TransformFOTBuilder &, const NodePtr &) const = 0; virtual void end(TransformFOTBuilder &) const = 0; }; class EntityRefFlowObj : public TransformExtensionFlowObj { public: void atomic(TransformFOTBuilder &fotb, const NodePtr &) const { fotb.entityRef(name_); } bool hasNIC(const StringC &name) const { return name == "name"; } void setNIC(const StringC &name, const Value &value) { value.convertString(name_); } ExtensionFlowObj *copy() const { return new EntityRefFlowObj(*this); } private: StringC name_; }; class ProcessingInstructionFlowObj : public TransformExtensionFlowObj { public: void atomic(TransformFOTBuilder &fotb, const NodePtr &) const { fotb.processingInstruction(data_); } bool hasNIC(const StringC &name) const { return name.size() == 4 && name[0] == 'd' && name[1] == 'a' && name[2] == 't' && name[3] == 'a'; } void setNIC(const StringC &name, const Value &value) { value.convertString(data_); } ExtensionFlowObj *copy() const { return new ProcessingInstructionFlowObj(*this); } private: StringC data_; }; class EmptyElementFlowObj : public TransformExtensionFlowObj { void atomic(TransformFOTBuilder &fotb, const NodePtr &nd) const { if (nic_.gi.size() > 0) fotb.emptyElement(nic_); else { GroveString str; if (nd && nd->getGi(str) == accessOK) { ElementNIC tem(nic_); tem.gi.assign(str.data(), str.size()); fotb.emptyElement(tem); } else fotb.emptyElement(nic_); } } bool hasNIC(const StringC &name) const { return name == "gi" || name == "attributes"; } void setNIC(const StringC &name, const Value &value) { switch (name[0]) { case 'g': value.convertString(nic_.gi); break; case 'a': value.convertStringPairList(nic_.attributes); break; } } ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); } private: ElementNIC nic_; }; class ElementFlowObj : public TransformCompoundExtensionFlowObj { void start(TransformFOTBuilder &fotb, const NodePtr &nd) const { if (nic_.gi.size() > 0) fotb.startElement(nic_); else { GroveString str; if (nd && nd->getGi(str) == accessOK) { ElementNIC tem(nic_); tem.gi.assign(str.data(), str.size()); fotb.startElement(tem); } else fotb.startElement(nic_); } } void end(TransformFOTBuilder &fotb) const { fotb.endElement(); } bool hasNIC(const StringC &name) const { return name == "gi" || name == "attributes"; } void setNIC(const StringC &name, const Value &value) { switch (name[0]) { case 'g': value.convertString(nic_.gi); break; case 'a': value.convertStringPairList(nic_.attributes); break; } } ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); } private: ElementNIC nic_; }; class EntityFlowObj : public TransformCompoundExtensionFlowObj { void start(TransformFOTBuilder &fotb, const NodePtr &) const { fotb.startEntity(systemId_); } void end(TransformFOTBuilder &fotb) const { fotb.endEntity(); } bool hasNIC(const StringC &name) const { return name == "system-id"; } void setNIC(const StringC &name, const Value &value) { value.convertString(systemId_); } ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); } private: StringC systemId_; }; class DocumentTypeFlowObj : public TransformExtensionFlowObj { void atomic(TransformFOTBuilder &fotb, const NodePtr &nd) const { fotb.documentType(nic_); } bool hasNIC(const StringC &name) const { return name == "system-id" || name == "public-id" || name == "name"; } void setNIC(const StringC &name, const Value &value) { switch (name[0]) { case 's': value.convertString(nic_.systemId); break; case 'p': value.convertString(nic_.publicId); break; case 'n': value.convertString(nic_.name); break; } } ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); } private: DocumentTypeNIC nic_; }; TransformFOTBuilder(CmdLineApp *, bool xml, const Vector &options); ~TransformFOTBuilder(); void startElement(const ElementNIC &); void endElement(); void emptyElement(const ElementNIC &); void characters(const Char *s, size_t n); void charactersFromNode(const NodePtr &, const Char *, size_t); void processingInstruction(const StringC &); void documentType(const DocumentTypeNIC &); void formattingInstruction(const StringC &); void entityRef(const StringC &); void startEntity(const StringC &); void endEntity(); void extension(const ExtensionFlowObj &fo, const NodePtr &); void startExtensionSerial(const CompoundExtensionFlowObj &fo, const NodePtr &nd); void endExtensionSerial(const CompoundExtensionFlowObj &fo); void start(); void end(); void setPreserveSdata(bool); private: TransformFOTBuilder(const TransformFOTBuilder &); void operator=(const TransformFOTBuilder &); OutputCharStream &os() { return *os_; } void attributes(const Vector &atts); void flushPendingRe() { if (state_ == statePendingRe) { os() << RE; state_ = stateMiddle; } } void flushPendingReCharRef() { if (state_ == statePendingRe) { os() << " "; state_ = stateMiddle; } } CmdLineApp *app_; OutputCharStream *os_; Owner topOs_; Vector openElements_; StringC undefGi_; struct OpenFile : Link { ~OpenFile(); OutputCharStream *saveOs; // fb must be before os so it gets destroyed afterwards FileOutputByteStream fb; Owner os; StringC systemId; }; IList openFileStack_; bool xml_; enum ReState { stateMiddle, stateStartOfElement, statePendingRe }; ReState state_; bool preserveSdata_; char RE_[2]; char SP_[2]; // Really Vector StringC preserveSdataStack_; }; FOTBuilder *makeTransformFOTBuilder(CmdLineApp *app, bool xml, const Vector &options, const FOTBuilder::Description *&descr) { static const TransformFOTBuilder::ProcessingInstructionFlowObj pi; static const TransformFOTBuilder::ElementFlowObj element; static const TransformFOTBuilder::EmptyElementFlowObj emptyElement; static const TransformFOTBuilder::EntityFlowObj entity; static const TransformFOTBuilder::EntityRefFlowObj entityRef; static const TransformFOTBuilder::DocumentTypeFlowObj documentType; static const FOTBuilder::Extension extensions[] = { { "UNREGISTERED::James Clark//Flow Object Class::processing-instruction", 0, 0, 0, 0, &pi }, { "UNREGISTERED::James Clark//Flow Object Class::element", 0, 0, 0, 0, &element }, { "UNREGISTERED::James Clark//Flow Object Class::empty-element", 0, 0, 0, 0, &emptyElement }, { "UNREGISTERED::James Clark//Flow Object Class::entity", 0, 0, 0, 0, &entity }, { "UNREGISTERED::James Clark//Flow Object Class::entity-ref", 0, 0, 0, 0, &entityRef }, { "UNREGISTERED::James Clark//Flow Object Class::document-type", 0, 0, 0, 0, &documentType }, { "UNREGISTERED::James Clark//Characteristic::preserve-sdata?", (void (FOTBuilder::*)(bool))&TransformFOTBuilder::setPreserveSdata, 0, 0, 0, 0 }, { 0 } }; static const FOTBuilder::Description description = { extensions, 0, // Features false }; descr = &description; return new TransformFOTBuilder(app, xml, options); } static void outputNumericCharRef(OutputCharStream &os, Char c) { os << "&#" << (unsigned long)c << ';'; } TransformFOTBuilder::TransformFOTBuilder(CmdLineApp *app, bool xml, const Vector &options) : app_(app), xml_(xml), topOs_(new RecordOutputCharStream(app->makeStdOut())), state_(stateMiddle), preserveSdata_(0) { undefGi_ = app_->systemCharset().execToDesc("#UNDEF"); topOs_->setEscaper(outputNumericCharRef); os_ = topOs_.pointer(); preserveSdataStack_ += 0; RE_[0] = RE; RE_[1] = 0; SP_[0] = RE; SP_[1] = 0; for (size_t i = 0; i < options.size(); i++) { if (options[i] == app_->systemCharset().execToDesc("raw")) { RE_[0] = 0; SP_[0] = ' '; } } } TransformFOTBuilder::~TransformFOTBuilder() { } static bool contains(const StringC &str, Char c) { for (size_t i = 0; i < str.size(); i++) if (str[i] == c) return 1; return 0; } void TransformFOTBuilder::documentType(const DocumentTypeNIC &nic) { flushPendingRe(); if (nic.name.size()) { os() << "' << RE; } atomic(); } void TransformFOTBuilder::attributes(const Vector &atts) { for (size_t i = 0; i < atts.size(); i += 2) { os() << SP_ << atts[i] << '='; const StringC &s = atts[i + 1]; if (!contains(s, '"')) os() << '"' << s << '"'; else if (!contains(s, '\'')) os() << '\'' << s << '\''; else { os() << '"'; for (size_t j = 0; j < s.size(); j++) { if (s[j] == '"') { if (xml_) os() << """; else outputNumericCharRef(os(), '"'); } else os().put(s[j]); } os() << '"'; } } } void TransformFOTBuilder::startElement(const ElementNIC &nic) { flushPendingRe(); os() << "<"; const StringC &s = nic.gi.size() == 0 ? undefGi_ : nic.gi; os() << s; attributes(nic.attributes); os() << RE_ << '>'; openElements_.push_back(s); start(); state_ = stateStartOfElement; } void TransformFOTBuilder::emptyElement(const ElementNIC &nic) { flushPendingRe(); os() << "<"; const StringC &s = nic.gi.size() == 0 ? undefGi_ : nic.gi; os() << s; attributes(nic.attributes); if (xml_) os() << "/>"; else os() << '>'; atomic(); state_ = stateMiddle; } void TransformFOTBuilder::endElement() { flushPendingReCharRef(); os() << "'; openElements_.resize(openElements_.size() - 1); end(); state_ = stateMiddle; } void TransformFOTBuilder::processingInstruction(const StringC &s) { flushPendingReCharRef(); os() << ""; else os() << '>'; atomic(); } void TransformFOTBuilder::formattingInstruction(const StringC &s) { flushPendingRe(); os() << s; } void TransformFOTBuilder::entityRef(const StringC &s) { flushPendingRe(); os() << "&" << s << ";"; } void TransformFOTBuilder::startEntity(const StringC &systemId) { flushPendingRe(); OpenFile *ofp = new OpenFile; openFileStack_.insert(ofp); ofp->systemId = systemId; ofp->saveOs = os_; String filename; #ifdef SP_WIDE_SYSTEM filename = systemId; #else filename = app_->codingSystem()->convertOut(systemId); #endif if (filename.size()) { filename += 0; if (!ofp->fb.open(filename.data())) { app_->message(CmdLineApp::openFileErrorMessage(), StringMessageArg(systemId), ErrnoMessageArg(errno)); } else { ofp->os = new RecordOutputCharStream( new EncodeOutputCharStream(&ofp->fb, app_->outputCodingSystem())); ofp->os->setEscaper(outputNumericCharRef); os_ = ofp->os.pointer(); } } } void TransformFOTBuilder::endEntity() { flushPendingRe(); OpenFile &of = *openFileStack_.head(); if (of.os) { errno = 0; of.os->flush(); if (!of.fb.close()) app_->message(CmdLineApp::closeFileErrorMessage(), StringMessageArg(of.systemId), ErrnoMessageArg(errno)); } os_ = of.saveOs; delete openFileStack_.get(); } inline OutputCharStream &operator<<(OutputCharStream &os, GroveString &str) { return os.write(str.data(), str.size()); } void TransformFOTBuilder::charactersFromNode(const NodePtr &nd, const Char *s, size_t n) { GroveString name; if (preserveSdata_ && n == 1 && nd->getEntityName(name) == accessOK) { flushPendingRe(); os() << "&" << name << ';'; } else TransformFOTBuilder::characters(s, n); } void TransformFOTBuilder::characters(const Char *s, size_t n) { if (n == 0) return; flushPendingRe(); if (state_ == stateStartOfElement && *s == RE) { s++; n--; os() << " "; if (n == 0) { state_ = stateMiddle; return; } } if (s[n - 1] == RE) { n--; state_ = statePendingRe; } else state_ = stateMiddle; for (; n > 0; n--, s++) { switch (*s) { case '&': if (xml_) os() << "&"; else outputNumericCharRef(os(), *s); break; case '<': if (xml_) os() << "<"; else outputNumericCharRef(os(), *s); break; case '>': if (xml_) os() << ">"; else outputNumericCharRef(os(), *s); break; default: os().put(*s); break; } } } void TransformFOTBuilder::extension(const ExtensionFlowObj &fo, const NodePtr &nd) { ((const TransformExtensionFlowObj &)fo).atomic(*this, nd); } void TransformFOTBuilder::startExtensionSerial(const CompoundExtensionFlowObj &fo, const NodePtr &nd) { ((const TransformCompoundExtensionFlowObj &)fo).start(*this, nd); } void TransformFOTBuilder::endExtensionSerial(const CompoundExtensionFlowObj &fo) { ((const TransformCompoundExtensionFlowObj &)fo).end(*this); } void TransformFOTBuilder::setPreserveSdata(bool b) { preserveSdata_ = b; } void TransformFOTBuilder::start() { preserveSdataStack_ += Char(preserveSdata_); } void TransformFOTBuilder::end() { preserveSdataStack_.resize(preserveSdataStack_.size() - 1); preserveSdata_ = bool(preserveSdataStack_[preserveSdataStack_.size() - 1]); } TransformFOTBuilder::OpenFile::~OpenFile() { } TransformFOTBuilder::DocumentTypeNIC::~DocumentTypeNIC() { } TransformFOTBuilder::ElementNIC::~ElementNIC() { } #ifdef DSSSL_NAMESPACE } #endif #include "TransformFOTBuilder_inst.cxx" OpenJade-1.4devel/jade/MifFOTBuilder.cxx0000644000021000000240000062042207037165451013563 /* Copyright (c) 1998 ISOGEN International Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ISOGEN INTERNATIONAL CORP. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of ISOGEN International Corp. shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from ISOGEN International Corp. */ /* Created by Kathleen Marszalek and Paul Prescod. */ #include "config.h" #ifdef JADE_MIF #include "MifFOTBuilder.h" #include "MifMessages.h" #include "TmpOutputByteStream.h" #include #include #include #include "FOTBuilder.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "dsssl_ns.h" #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif //#define assert(exp) (void)( (exp) || (throw "assertion_failed", 0) ) #define PROPERTY( propertyType, propertyName ) \ propertyType propertyName; \ void set ## propertyName ( propertyType p ) \ { propertyName = p; setProperties |= f ## propertyName ;} #define PROPERTY_OUT( propertyName ) \ if( properties & f ## propertyName ) \ os << '\n' << MifOutputByteStream::INDENT \ << "<" #propertyName " " << propertyName << ">"; #define VECTOR_OF_PROPERTIES( propertyType, propertyName ) \ Vector< propertyType > propertyName ## s; \ void propertyName ## sAreSet() \ { setProperties |= f ## propertyName ## s ;} #define STATIC_PROPERTY( propertyType, propertyName ) \ static propertyType propertyName; \ static void set ## propertyName ( propertyType p ) \ { propertyName = p; setProperties |= f ## propertyName ;} class StringHash { public: static unsigned long hash( const String & ); }; class MifOutputByteStream; class MifTmpOutputByteStream; class MifDoc { public: MifDoc( const String &fileLoc, CmdLineApp *app ); ~MifDoc(); static MifDoc &curInstance() { assert( CurInstance != NULL ); return *CurInstance; } static MifDoc *CurInstance; struct T_indent { T_indent( unsigned i ) : data( i ) {} long data; operator unsigned() const { return data; } }; struct T_dimension { T_dimension( long u = 0 ) : data( u ) {} long data; operator long() const { return data; } T_dimension &operator=( long s ) { data = s; return *this; } }; struct T_string : public String { T_string() : String() {}; T_string( const String &s ) : String( s ) {}; T_string( String &s ) : String() { for( size_t i = 0; i < s.size(); i++ ) *this += char( s[i] ); } T_string( const char *cS ) : String( cS, strlen( cS ) ) {}; T_string &operator=( String s ) { String::operator=( s ); return *this; } void escapeSpecialChars(); }; struct T_boolean { T_boolean( bool b = false ) : data( b ) {} bool data; operator bool() const { return data; } T_boolean &operator=( bool b ) { data = b; return *this; } }; typedef T_string T_tagstring; typedef T_string T_pathname; typedef String T_keyword; typedef long T_integer; typedef unsigned T_ID; typedef long T_degrees; typedef double T_percentage; typedef long T_metric; struct T_WH { T_dimension w, h; // width, height T_WH( T_dimension w_, T_dimension h_ ) : w( w_ ), h( h_ ) {} T_WH() : w( 0L ), h( 0L ) {} }; struct T_XY { T_dimension x, y; T_XY( T_dimension x_, T_dimension y_ ) : x( x_ ), y( y_ ) {} T_XY() : x( 0L ), y( 0L ) {} }; struct T_LTRB { T_dimension l, t, r, b; // left, top, right, bottom T_LTRB( T_dimension l_, T_dimension t_, T_dimension r_, T_dimension b_ ) : l( l_ ), t( t_ ), r( r_ ), b( b_ ) {} T_LTRB() : l( 0L ), t( 0L ), r( 0L ), b( 0L ) {} }; struct T_LTWH { T_dimension l, t, w, h; // left, top, width, height T_LTWH( T_dimension l_, T_dimension t_, T_dimension w_, T_dimension h_ ) : l( l_ ), t( t_ ), w( w_ ), h( h_ ) {} T_LTWH() : l( 0L ), t( 0L ), w( 0L ), h( 0L ) {} }; struct T_XYWH { T_dimension x, y, w, h; }; // special characters static const String sTab; static const String sHardSpace; static const String sSoftHyphen; static const String sHardHyphen; static const String sHardReturn; static const String sNumberSpace; static const String sThinSpace; static const String sEnSpace; static const String sEmSpace; static const String sCent; static const String sPound; static const String sYen; static const String sEnDash; static const String sEmDash; static const String sDagger; static const String sDoubleDagger; static const String sBullet; // for tagged text flows static const String sA; // FWeight static const String sRegular; static const String sBold; // FAngle // sRegular; static const String sItalic; // FVar // sRegular; // FColor static const String sWhite; static const String sBlack; // FUnderlining static const String sFNoUnderlining; static const String sFSingle; static const String sFDouble; static const String sFNumeric; // FPosition static const String sFNormal; static const String sFSuperscript; static const String sFSubscript; // FCase static const String sFAsTyped; static const String sFSmallCaps; static const String sFLowercase; static const String sFUppercase; // FFamily static const String sTimesNewRoman; struct FontFormat : public Link { enum { fNone = 0, fFFamily = 0x1, fFAngle = 0x2, fFWeight = 0x4, fFVar = 0x8, fFSize = 0x10, fFColor = 0x20, fFUnderlining = 0x40, fFOverline = 0x80, fFStrike = 0x100, fFPosition = 0x200, fFPairKern = 0x400, fFCase = 0x800, fFDX = 0x1000, fFDY = 0x2000, fFDW = 0x4000, fAll = 0x7FFF }; unsigned setProperties; FontFormat() : setProperties( 0 ) {} // font name PROPERTY( T_string, FFamily ); PROPERTY( T_string, FAngle ); PROPERTY( T_string, FWeight ); PROPERTY( T_string, FVar ); // font size and color PROPERTY( T_dimension, FSize ); PROPERTY( T_tagstring, FColor ); // font style PROPERTY( T_keyword, FUnderlining ); PROPERTY( T_boolean, FOverline ); PROPERTY( T_boolean, FStrike ); PROPERTY( T_keyword, FPosition ); PROPERTY( T_boolean, FPairKern ); PROPERTY( T_keyword, FCase ); // kerning information PROPERTY( T_percentage, FDX ); PROPERTY( T_percentage, FDY ); PROPERTY( T_percentage, FDW ); void setDSSSLDefaults() { setFFamily( sTimesNewRoman ); setFAngle( sRegular ); setFWeight( sRegular ); setFVar( sRegular ); setFSize( 10000 ); setFColor( sBlack ), setFUnderlining( sFNoUnderlining ); setFOverline( false ); setFStrike( false ); setFPosition( sFNormal ); setFPairKern( false ); setFCase( sFAsTyped ); setFDX( 0 ); setFDY( 0 ); setFDW( 0 ); } enum FontStatement { stPgfFont, stFont }; unsigned compare( FontFormat &f ); void setFrom( FontFormat &f, unsigned properties ); void out( MifOutputByteStream &os, unsigned properties, FontStatement fontStatement ); void ffOut( MifOutputByteStream &os, unsigned properties, FontStatement fontStatement ) { out( os, properties, fontStatement ); } void out( MifOutputByteStream &os, FontStatement fontStatement ) { out( os, setProperties, fontStatement ); } void ffOut( MifOutputByteStream &os, FontStatement fontStatement ) { out( os, fontStatement ); } void updateFrom( FontFormat & ); void ffUpdateFrom( FontFormat &f ) { updateFrom( f ); } void clearSetProperties() { setProperties = 0; } }; static const String sNONE; // paragraph formats static const String sDefaultPgfFormat; static const String sHeader; static const String sFooter; // PgfAlignment static const String sLeftRight; static const String sLeft; static const String sRight; static const String sCenter; // PgfLineSpacing static const String sFixed; static const String sProportional; // PgfCellAlignment static const String sTop; static const String sMiddle; static const String sBottom; // PgfPlacement static const String sAnywhere; static const String sColumnTop; static const String sPageTop; static const String sLPageTop; static const String sRPageTop; // PgfPlacementStyle static const String sNormal; static const String sStraddle; // PgfLanguage static const String sNoLanguage; static const String sUSEnglish; static const String sUKEnglish; static const String sGerman; static const String sSwissGerman; static const String sFrench; static const String sCanadianFrench; static const String sSpanish; static const String sCatalan; static const String sItalian; static const String sPortuguese; static const String sBrazilian; static const String sDanish; static const String sDutch; static const String sNorwegian; static const String sNynorsk; static const String sFinnish; static const String sSwedish; // TStype // sLeft; // sRight; // sCenter; static const String sDecimal; // TSLeaderStr; static const String sSPACE; struct TabStop { enum { fNone = 0, fTSX = 0x1, fTSType = 0x2, fTSLeaderStr = 0x4, fTSDecimalChar = 0x8, fAll = 0xF }; unsigned setProperties; TabStop( T_keyword type = sLeft, T_dimension x = 0, T_string tSLeaderStr = sSPACE ) : TSX( x ), TSType( type ), setProperties( fTSType | fTSX ) { setTSLeaderStr( tSLeaderStr ); } PROPERTY( T_dimension, TSX ); PROPERTY( T_keyword, TSType ); PROPERTY( T_string, TSLeaderStr ); PROPERTY( T_integer, TSDecimalChar ); void out( MifOutputByteStream &os ); }; struct ParagraphFormat : public FontFormat { enum { fNone = 0, fPgfFIndent = 0x1, fPgfLIndent = 0x2, fPgfRIndent = 0x4, fPgfAlignment = 0x8, fPgfSpBefore = 0x10, fPgfSpAfter = 0x20, fPgfLineSpacing = 0x40, fPgfLeading = 0x80, fPgfWithPrev = 0x100, fPgfWithNext = 0x200, fPgfBlockSize = 0x400, fPgfAutoNum = 0x800, fPgfNumFormat = 0x1000, fPgfNumberFont = 0x2000, fPgfHyphenate = 0x4000, fHyphenMaxLines = 0x8000, fHyphenMinPrefix = 0x10000, fHyphenMinSuffix = 0x20000, fHyphenMinWord = 0x40000, fPgfLetterSpace = 0x80000, fPgfLanguage = 0x100000, fPgfCellAlignment = 0x200000, fPgfCellMargins = 0x400000, fPgfCellLMarginFixed = 0x800000, fPgfCellTMarginFixed = 0x1000000, fPgfCellRMarginFixed = 0x2000000, fPgfCellBMarginFixed = 0x4000000, fPgfTag = 0x8000000, fTabStops = 0x10000000, fPgfPlacement = 0x20000000, fPgfNumTabs = 0x40000000, fPgfPlacementStyle = 0x80000000, fAll = 0xFFFFFFFF }; unsigned setProperties; ParagraphFormat() : setProperties( 0 ) {} // basic properties PROPERTY( T_tagstring, PgfTag ); PROPERTY( T_dimension, PgfFIndent ); PROPERTY( T_dimension, PgfLIndent ); PROPERTY( T_dimension, PgfRIndent ); PROPERTY( T_keyword, PgfAlignment ); PROPERTY( T_dimension, PgfSpBefore ); PROPERTY( T_dimension, PgfSpAfter ); PROPERTY( T_keyword, PgfLineSpacing ); PROPERTY( T_dimension, PgfLeading ); PROPERTY( T_integer, PgfNumTabs ); Vector TabStops; // default font properties // pagination properties PROPERTY( T_keyword, PgfPlacement ); PROPERTY( T_keyword, PgfPlacementStyle ); PROPERTY( T_boolean, PgfWithPrev ); PROPERTY( T_boolean, PgfWithNext ); PROPERTY( T_integer, PgfBlockSize ); // numbering properties PROPERTY( T_boolean, PgfAutoNum ); PROPERTY( T_string, PgfNumFormat ); PROPERTY( T_tagstring, PgfNumberFont ); // advanced properties PROPERTY( T_boolean, PgfHyphenate ); PROPERTY( T_integer, HyphenMaxLines ); PROPERTY( T_integer, HyphenMinPrefix ); PROPERTY( T_integer, HyphenMinSuffix ); PROPERTY( T_integer, HyphenMinWord ); PROPERTY( T_boolean, PgfLetterSpace ); PROPERTY( T_keyword, PgfLanguage ); // table cell properties PROPERTY( T_keyword, PgfCellAlignment ); PROPERTY( T_LTRB, PgfCellMargins ); PROPERTY( T_boolean, PgfCellLMarginFixed ); PROPERTY( T_boolean, PgfCellTMarginFixed ); PROPERTY( T_boolean, PgfCellRMarginFixed ); PROPERTY( T_boolean, PgfCellBMarginFixed ); // miscellaneous properties // none void setDSSSLDefaults() { FontFormat::setDSSSLDefaults(); setPgfFIndent( 0 ); setPgfLIndent( 0 ); setPgfRIndent( 0 ); setPgfAlignment( sLeft ); setPgfSpBefore( 0 ); setPgfSpAfter( 0 ); setPgfLineSpacing( sFixed ); setPgfLeading( 0 ); setPgfNumTabs( 0 ); setPgfWithPrev( false ); setPgfWithNext( false ); setPgfBlockSize( 2 ); setPgfAutoNum( false ); // setPgfNumFormat( sNONE ); // setPgfNumberFont( sNONE ); setPgfHyphenate( false ); setHyphenMaxLines( 999 ); setHyphenMinPrefix( 2 ); setHyphenMinSuffix( 2 ); setHyphenMinWord( 2 ); setPgfLetterSpace( false ); setPgfLanguage( sNoLanguage ); setPgfCellAlignment( sTop ); setPgfCellMargins( T_LTRB( 0, 0, 0, 0 ) ); setPgfCellLMarginFixed( true ); setPgfCellTMarginFixed( true ); setPgfCellRMarginFixed( true ); setPgfCellBMarginFixed( true ); // setPgfTag( sNONE ); setPgfPlacement( sAnywhere ); setPgfPlacementStyle( sNormal ); } void forceSetProperties( unsigned properties, unsigned fontProperties ) { setProperties = properties; FontFormat::setProperties = fontProperties; } unsigned &ffSetProperties() { return FontFormat::setProperties; } unsigned compare( ParagraphFormat & ); void setFrom( ParagraphFormat &, unsigned, unsigned ); void out( MifOutputByteStream &os, unsigned, unsigned, bool excludeCellProperties = true ); void out( MifOutputByteStream &os, bool excludeCellProperties = true ) { out( os, setProperties, (unsigned)FontFormat::setProperties, excludeCellProperties ); } void updateFrom( ParagraphFormat & ); void clearSetProperties() { setProperties = 0; FontFormat::clearSetProperties(); } }; // DPageNumStyle static const String sArabic; static const String sUCRoman; static const String sLCRoman; static const String sUCAlpha; static const String sLCAlpha; // DParity static const String sFirstLeft; static const String sFirstRight; struct Document { enum { fNone = 0, fDPageSize = 0x1, fDStartPage = 0x2, fDPageNumStyle = 0x4, fDTwoSides = 0x8, fDParity = 0x10, fDMargins = 0x20, fDColumns = 0x40, fDColumnGap = 0x80, fAll = 0xFF }; unsigned setProperties; Document() : setProperties( fNone ) {} // column properties PROPERTY( T_LTRB, DMargins ); PROPERTY( T_integer, DColumns ); PROPERTY( T_dimension, DColumnGap ); PROPERTY( T_WH, DPageSize ); // pagination PROPERTY( T_integer, DStartPage ); PROPERTY( T_keyword, DPageNumStyle ); PROPERTY( T_boolean, DTwoSides ); PROPERTY( T_keyword, DParity ); void out( MifOutputByteStream &os ); }; struct Object { enum { fNone = 0, fID = 0x1, fPen = 0x2, fFill = 0x4, fPenWidth = 0x8, fObjectNext = 0x10, fObColor = 0x20 }; unsigned setProperties; Object( T_integer pen = 15, T_integer fill = 15, T_dimension penWidth = 0, const T_tagstring &obColor = sBlack ) : setProperties( 0 ) { setID( ++IDCnt ); setPen( pen ); setFill( fill ); setPenWidth( penWidth ); setObColor( obColor ); } static T_ID IDCnt; PROPERTY( T_integer, ID ); PROPERTY( T_integer, Pen ); PROPERTY( T_integer, Fill ); PROPERTY( T_dimension, PenWidth ); PROPERTY( T_tagstring, ObColor ); void outObjectProperties( MifOutputByteStream &os ); virtual void out( MifOutputByteStream &os ) = 0; }; // HeadCap/TailCap static const String sButt; static const String sRound; static const String sSquare; struct PolyLine : public Object { enum { fHeadCap = fObjectNext << 1, fTailCap = fHeadCap << 1 }; PolyLine( T_keyword cap, T_integer pen = 15, T_integer fill = 15, T_dimension penWidth = 0, const T_tagstring &obColor = sBlack ) : Object( pen, fill, penWidth, obColor ) { setHeadCap( cap ); setTailCap( cap ); } PROPERTY( T_keyword, HeadCap ); PROPERTY( T_keyword, TailCap ); Vector Points; void out( MifOutputByteStream &os ); }; struct ImportObject : public Object { enum { fImportObFileDI = fObjectNext << 1, fBitMapDpi = fImportObFileDI << 1, fShapeRect = fBitMapDpi << 1, fImportObFixedSize = fShapeRect << 1, fNativeOrigin = fImportObFixedSize << 1 }; ImportObject( T_pathname importObFileDI, T_LTWH shapeRect, T_boolean importObFixedSize = true, T_integer bitMapDpi = 72 ) : Object() { setImportObFileDI( importObFileDI ); setShapeRect( shapeRect ); setImportObFixedSize( importObFixedSize ); setBitMapDpi( bitMapDpi ); } PROPERTY( T_pathname, ImportObFileDI ); PROPERTY( T_integer, BitMapDpi ); PROPERTY( T_LTWH, ShapeRect ); PROPERTY( T_boolean, ImportObFixedSize ); PROPERTY( T_XY, NativeOrigin ); void out( MifOutputByteStream &os ); }; // FrameType static const String sInline; static const String sRunIntoParagraph; static const String sBelow; // AnchorAlign // Left // Center // Right // Inside // Outside struct Frame : public Object { enum { fShapeRect = fObjectNext << 1, fFrameType = fShapeRect << 1, fNSOffset = fFrameType << 1, fBLOffset = fNSOffset << 1, fAnchorAlign = fBLOffset << 1 }; Frame() : Object() {} PROPERTY( T_LTWH, ShapeRect ); PROPERTY( T_keyword, FrameType ); PROPERTY( T_dimension, NSOffset ); PROPERTY( T_dimension, BLOffset ); PROPERTY( T_keyword, AnchorAlign ); Vector Objects; void out( MifOutputByteStream &os ); }; struct TextRect : public Object { enum { fID = fObjectNext << 1, fShapeRect = fID << 1, fTRNumColumns = fShapeRect << 1, fTRColumnGap = fTRNumColumns << 1, fTRColumnBalance = fTRColumnGap << 1 }; TextRect() : Object() {} TextRect( T_LTWH shapeRect, T_integer tRNumColumns = 1, T_dimension tRColumnGap = 0, bool tRColumnBalance = false ) : Object() { setShapeRect( shapeRect ); setTRNumColumns( tRNumColumns ); setTRColumnGap( tRColumnGap ); setTRColumnBalance( tRColumnBalance ); } PROPERTY( T_LTWH, ShapeRect ); PROPERTY( T_integer, TRNumColumns ); PROPERTY( T_dimension, TRColumnGap ); PROPERTY( T_boolean, TRColumnBalance ); void out( MifOutputByteStream &os ); }; // PageType static const String sLeftMasterPage; static const String sRightMasterPage; static const String sOtherMasterPage; static const String sBodyPage; // PageTag static const String sFirst; // sLeft // sRight struct Page { enum { fNone = 0, fPageType = 0x1, fPageTag = 0x2, fPageBackground = 0x4 }; unsigned setProperties; Page( T_keyword pageType, T_tagstring pageTag = sNONE, T_tagstring pageBackground = sNONE ) : PageType( pageType ), PageTag( pageTag ), PageBackground( pageBackground ), setProperties( fPageType | fPageTag ) { if( PageTag != sNONE ) setProperties |= fPageTag; if( PageBackground != sNONE ) setProperties |= fPageBackground; } Page() : PageType( MifDoc::sRightMasterPage ), setProperties( fPageType ) {} PROPERTY( T_keyword, PageType ); PROPERTY( T_tagstring, PageTag ); PROPERTY( T_tagstring, PageBackground ); // keyword in MIF Vector TextRects; void out( MifOutputByteStream &os ); }; struct TagStream { enum TagStreamClass { tsTagStream, tsTextFlow, tsCell, tsPara } TagStreamClass; TagStream( T_indent osIndent = 2 ); ~TagStream(); T_tagstring InitialPgfTag; bool PgfTagUsed; ParagraphFormat &format() { return Format; } MifTmpOutputByteStream &content() { assert( Content != NULL ); return *Content; } void setParagraphFormat( ParagraphFormat &pf ) { Format = pf; } protected: MifTmpOutputByteStream *Content; ParagraphFormat Format; }; struct TextFlow : public TagStream { enum { fNone = 0, fTFTag = 0x1, fTFAutoConnect = 0x02 }; unsigned setProperties; TextFlow() : setProperties( fNone ), TextRectIDUsed( false ) { TagStreamClass = tsTextFlow; } TextFlow( const TextRect &textRect, bool body, ParagraphFormat *format = NULL, T_tagstring pgfTag = sNONE ); T_ID TextRectID; // for ParaLine (not in MIF) bool TextRectIDUsed; PROPERTY( T_tagstring, TFTag ); PROPERTY( T_boolean, TFAutoConnect ); const TextRect *textRect() { assert( TextRect_ != NULL ); return TextRect_; } void out( MifOutputByteStream &os, bool resolveCrossReferences = false ); protected: const TextRect *TextRect_; }; struct Para : public TagStream { enum { fNone = 0, fPgfTag = 0x1, fParagraphFormat = 0x2 }; unsigned setProperties; Para( T_indent osIndent = 2 ) : TagStream( osIndent ), setProperties( fParagraphFormat ), leaderTabsSet( false ) { TagStreamClass = tsPara; } static bool currentlyOpened; bool leaderTabsSet; PROPERTY( T_tagstring, PgfTag ); ParagraphFormat &curFormat() { return CurFormat; } void out( MifOutputByteStream &os ); void outProlog( MifOutputByteStream &os ); static void outSimpleProlog( MifOutputByteStream &os ); static void outEpilog( MifOutputByteStream &os ); protected: ParagraphFormat CurFormat; }; struct ParaLine { enum { fNone = 0, fTextRectID = 0x1, fATbl = 0x2 }; static unsigned setProperties; STATIC_PROPERTY( T_ID, TextRectID ); STATIC_PROPERTY( T_ID, ATbl ); static void outProlog( MifOutputByteStream &os ); static void outEpilog( MifOutputByteStream &os ); }; struct PgfCatalog { Vector ParaFormats; void out( MifOutputByteStream &os ); }; struct Color { enum { fColorTag = 0x1, fColorCyan = 0x2, fColorMagenta = 0x4, fColorYellow = 0x8, fColorBlack = 0x10 }; unsigned setProperties; Color() : setProperties( 0 ) {} Color( unsigned char red, unsigned char green, unsigned char blue ); PROPERTY( T_tagstring, ColorTag ); PROPERTY( T_percentage, ColorCyan ); PROPERTY( T_percentage, ColorMagenta ); PROPERTY( T_percentage, ColorYellow ); PROPERTY( T_percentage, ColorBlack ); static const String &key( Color &color ); void out( MifOutputByteStream &os ) const; }; struct ColorCatalog { PointerTable,StringHash,Color> Colors; void out( MifOutputByteStream &os ); }; // TblAlignment // Left // Center // Right static const String sInside; static const String sOutside; struct Ruling { enum { fNone = 0, fRulingTag = 0x1, fRulingPenWidth = 0x2, fRulingGap = 0x4, fRulingPen = 0x8, fRulingLines = 0x10, fRulingColor = 0x20 }; unsigned setProperties; Ruling() : setProperties( 0 ), RulingPenWidth( 1000 ), RulingGap( 1000 ), RulingPen( 0 ), RulingLines( 1 ) {}; Ruling( T_tagstring RulingTag_ ) : setProperties( 0 ), RulingPenWidth( 1000 ), RulingGap( 1000 ), RulingPen( 0 ), RulingLines( 1 ) { setRulingTag( RulingTag_ ); } PROPERTY( T_tagstring, RulingTag ); PROPERTY( T_dimension, RulingPenWidth ); PROPERTY( T_dimension, RulingGap ); PROPERTY( T_tagstring, RulingColor ); PROPERTY( T_integer, RulingPen ); PROPERTY( T_integer, RulingLines ); static const String &key( Ruling & ); void out( MifOutputByteStream &os ) const; String Key; }; struct RulingCatalog { PointerTable,StringHash,Ruling> Rulings; void out( MifOutputByteStream &os ); }; struct Cell : public TagStream { enum { fNone = 0, fCellLRuling = 0x1, fCellBRuling = 0x2, fCellRRuling = 0x4, fCellTRuling = 0x8, fCellColumns = 0x10, fCellRows = 0x20, fCellFill = 0x40, fCellColor = 0x80 }; unsigned setProperties; Cell( T_indent osIndent = 12 ) : TagStream( osIndent ), setProperties( 0 ) { TagStreamClass = tsCell; } PROPERTY( T_integer, CellFill ); PROPERTY( T_tagstring, CellColor ); PROPERTY( T_tagstring, CellLRuling ); PROPERTY( T_tagstring, CellBRuling ); PROPERTY( T_tagstring, CellRRuling ); PROPERTY( T_tagstring, CellTRuling ); PROPERTY( T_integer, CellColumns ); PROPERTY( T_integer, CellRows ); void out( MifOutputByteStream &os, bool resolveCrossReferences = false ); }; struct Row { Vector Cells; void out( MifOutputByteStream &os, bool resolveCrossReferences = false ); }; struct TblColumn { enum { fNone = 0, fTblColumnNum = 0x1, fTblColumnWidth = 0x2 }; unsigned setProperties; TblColumn() : setProperties( 0 ), TblColumnNum( 0 ), TblColumnWidth( 0 ) {}; TblColumn( T_integer TblColumnNum_, T_dimension TblColumnWidth_ ) : setProperties( 0 ) { setTblColumnNum( TblColumnNum_ ); setTblColumnWidth( TblColumnWidth_ ); } PROPERTY( T_integer, TblColumnNum ); PROPERTY( T_dimension, TblColumnWidth ); void out( MifOutputByteStream &os ); }; // TblTitlePlacement static const String sNone; struct TblFormat { enum { fNone = 0, fTblTag = 0x1, fTblLIndent = 0x2, fTblRIndent = 0x4, fTblSpBefore = 0x8, fTblSpAfter = 0x10, fTblAlignment = 0x20, fTblCellMargins = 0x40, fTblWidth = 0x80, fTblTitlePlacement = 0x100, fAll = 0x1ff }; unsigned setProperties; TblFormat() : setProperties( 0 ) {} TblFormat( T_tagstring TblTag_ ) : setProperties( 0 ) { setTblTag( TblTag_ ); } void setDSSSLDefaults() { setTblLIndent( 0 ); setTblRIndent( 0 ); setTblSpBefore( 0 ); setTblSpAfter( 0 ); setTblAlignment( sLeft ); setTblCellMargins( T_LTRB( 0, 0, 0, 0 ) ); setTblTitlePlacement( sNone ); } // basic properties PROPERTY( T_tagstring, TblTag ); PROPERTY( T_dimension, TblLIndent ); PROPERTY( T_dimension, TblRIndent ); PROPERTY( T_dimension, TblSpBefore ); PROPERTY( T_dimension, TblSpAfter ); PROPERTY( T_keyword, TblAlignment ); PROPERTY( T_LTRB, TblCellMargins ); PROPERTY( T_keyword, TblTitlePlacement ); // column properties PROPERTY( T_dimension, TblWidth ); Vector TblColumns; void out( MifOutputByteStream &os ); }; struct TblCatalog { Vector TblFormats; void out( MifOutputByteStream &os ); }; // TblTag static const String sDefaultTblFormat; struct Tbl { enum { fNone = 0, fTblID = 0x1, fTblTag = 0x2, fTblNumColumns = 0x4, fTblColumnWidths = 0x8, fTblFormat = 0x10 }; unsigned setProperties; Tbl() : setProperties( 0 ), TblIDUsed( false ) { setTblID( MifDoc::CurInstance->nextID() ); setTblTag( MifDoc::sDefaultTblFormat ); } PROPERTY( T_ID, TblID ); PROPERTY( T_tagstring, TblTag ); bool TblIDUsed; TblFormat tblFormat; // table columns PROPERTY( T_integer, TblNumColumns ); VECTOR_OF_PROPERTIES( T_dimension, TblColumnWidth ); // table rows Vector TblH; Vector TblBody; Vector TblF; void out( MifOutputByteStream &os, bool resolveCrossReferences = false ); }; // paragraph formats static const String sPageNumXRefFormatName; struct XRefFormat { enum { fXRefName = 0x1, fXRefDef = 0x2 }; unsigned setProperties; XRefFormat() {} XRefFormat( T_string XRefName_, T_string XRefDef_ ) { setXRefName( XRefName_ ); setXRefDef( XRefDef_ ); } PROPERTY( T_string, XRefName ); PROPERTY( T_string, XRefDef ); void out( MifOutputByteStream &os ); }; static char escapeChar() { return '\x0'; } struct CrossRefInfo { enum InfoType { PotentialMarker, XRef, HypertextLink } Type; CrossRefInfo() {} CrossRefInfo ( unsigned long groveIndex_, unsigned long elementIndex_, int tagIndent_, InfoType type_, const Char *id, size_t idLen ) : groveIndex( groveIndex_ ), elementIndex( elementIndex_ ), tagIndent( tagIndent_ ), Type( type_ ) { if( id != NULL && idLen > 0 ) sgmlId.assign( id, idLen ); } InfoType type() { return Type; } void out( MifOutputByteStream &os ); T_string crossRefText() const; unsigned long groveIndex; unsigned long elementIndex; int tagIndent; StringC sgmlId; }; struct XRef { enum { fXRefName = 0x1, fXRefSrcFile = 0x2, fXRefText = 0x4, fXRefSrcText }; unsigned setProperties; XRef() {} XRef( CrossRefInfo &crossRefInfo ); XRef( T_tagstring XRefName_, T_string XRefSrcText_, T_string XRefText_, T_pathname XRefSrcFile_ ) { setXRefName( XRefName_ ); setXRefSrcText( XRefSrcText_ ); setXRefText( XRefText_ ); setXRefSrcFile( XRefSrcFile_ ); } PROPERTY( T_tagstring, XRefName ); PROPERTY( T_string, XRefSrcText ); PROPERTY( T_pathname, XRefSrcFile ); PROPERTY( T_string, XRefText ); void out( MifOutputByteStream &os ); }; struct Marker { enum Type { XRef = 9, Index = 2, Hypertext = 8, HypertextLink = 100, HypertextDestination = 101 }; enum { fMType = 0x1, fMText = 0x2 }; unsigned setProperties; Marker() {} Marker( CrossRefInfo &crossRefInfo, bool linkDestinationMode = false ); Marker( T_string MText_, Type MType_ = XRef ) { setMText( MText_ ); setMType( T_integer( MType_ ) ); } PROPERTY( T_integer, MType ); PROPERTY( T_string, MText ); void out( MifOutputByteStream &os ); }; struct BookComponent { BookComponent() : epilogOs( NULL ), pageNumXRefFormatGenerated( false ) {} BookComponent( MifTmpOutputByteStream *epilogOs ); void commit( const String &dirName, bool resolveCrossReferences = true ); String FileName; Vector XRefFormats; Document document; ColorCatalog colorCatalog; PgfCatalog pgfCatalog; TblCatalog tblCatalog; Vector AFrames; Vector Tbls; Vector Pages; Vector TextFlows; RulingCatalog rulingCatalog; bool pageNumXRefFormatGenerated; MifTmpOutputByteStream *epilogOs; }; struct ElementSet { enum ReferenceType { AnyReference = 0xC000, LinkReference = 0x8000, PageReference = 0x4000 }; static unsigned short LINK_TYPE_MASK( ReferenceType refType ) { return (unsigned short)( refType ); } static const unsigned short BOOK_COMPONENT_INDEX_M() { return 0x3FFF; } ElementSet(); struct SgmlIdInfo { SgmlIdInfo( const StringC &sgmlId_, unsigned long groveIndex_ ) : sgmlId( sgmlId_ ), groveIndex( groveIndex_ ), flags( 0 ) {} StringC sgmlId; unsigned short flags; unsigned long groveIndex; static const StringC &key( SgmlIdInfo &sgmlIdInfo) { return sgmlIdInfo.sgmlId; } }; SgmlIdInfo &enforceSgmlId( const StringC &sgmlId, unsigned long groveIndex ); void setReferencedFlag( ReferenceType, unsigned long groveIndex, unsigned long n ); void setReferencedFlag( ReferenceType, unsigned long groveIndex, const StringC &sgmlId ); void setBookComponentIndex( unsigned long groveIndex, unsigned long n, int i ); void setBookComponentIndex( unsigned long groveIndex, const StringC &sgmlId, int i ); bool hasBeenReferenced( ReferenceType, unsigned long groveIndex, unsigned long n ) const; bool hasBeenReferenced( ReferenceType, unsigned long groveIndex, const StringC &sgmlId ); int bookComponentIndex( unsigned long groveIndex, unsigned long n ) const; int bookComponentIndex( unsigned long groveIndex, const StringC &sgmlId ); private: PointerTable SgmlIdInfos; void add( unsigned long groveIndex, unsigned long n, unsigned short flags ); bool getFlags( unsigned long groveIndex, unsigned long n, unsigned short &result ) const; Vector > Flags; }; void commit(); void outTagEnd(); void outHexChar( unsigned code, MifOutputByteStream *o = NULL ); void outHexChar( unsigned code, String &targetString ); void outSpecialChar( const String &charName, MifOutputByteStream *o = NULL ); void beginParaLine(); void endParaLine(); void outPageNumber(); void outBreakingPara( T_keyword pgfPlacement ); void outAFrame( T_ID ID, MifOutputByteStream &os ); Vector &bookComponents() { return BookComponents; }; BookComponent &bookComponent() { assert( bookComponents().size() > 0 ); return bookComponents().back(); } void setCurOs( MifOutputByteStream &os ) { curOs = &os; } MifOutputByteStream &os() { assert( curOs != NULL ); return *curOs; } void setCurTextFlow( TextFlow *tf ) { CurTextFlow = tf; } TextFlow *curTextFlow() { return CurTextFlow; } void setCurCell( Cell *c ) { CurCell = c; } Cell *curCell() { return CurCell; } void setCurTblNum( size_t n ) { CurTblNum = n; } Tbl *curTbl( bool assertNotNull = true ) { if( assertNotNull ) assert( CurTblNum > 0 ); return CurTblNum > 0 ? &bookComponent().Tbls[CurTblNum-1] : (Tbl *)NULL; } void setCurPara( Para *p ) { CurPara = p; } Para *curPara( bool assertNotNull = true ) { if( assertNotNull ) assert( CurPara != NULL ); return CurPara; } void setCurParagraphFormat( ParagraphFormat &pf ) { CurFormat = pf; } ParagraphFormat &curFormat() { return CurFormat; } TagStream &curTagStream() { assert( TagStreamStack.size() > 0 ); return *TagStreamStack.back(); } void enterTextFlow( TextFlow &textFlow ) { enterTagStream( textFlow ); } void exitTextFlow() { setCurTextFlow( NULL ); exitTagStream(); } void enterTableCell( Cell &cell ) { enterTagStream( cell ); } void exitTableCell() { setCurCell( NULL ); exitTagStream(); } void enterPara( Para &p ) { enterTagStream( p ); } void exitPara() { setCurPara( NULL ); exitTagStream(); } void enterBookComponent(); void exitBookComponent(); void enterTagStream( TagStream &tagStream ); void exitTagStream(); T_ID nextID() { return ++NextID; } Document &document() { return bookComponent().document; } PgfCatalog &pgfCatalog() { return bookComponent().pgfCatalog; } TblCatalog &tblCatalog() { return bookComponent().tblCatalog; } RulingCatalog &rulingCatalog() { return bookComponent().rulingCatalog; } ColorCatalog &colorCatalog() { return bookComponent().colorCatalog; } Vector &tbls() { return bookComponent().Tbls; } Vector &pages() { return bookComponent().Pages; } Vector &textFlows() { return bookComponent().TextFlows; } Vector &aFrames() { return bookComponent().AFrames; } ElementSet &elements() { return Elements; } Vector &crossRefInfos() { return CrossRefInfos; } const String &rootOutputFileLoc() { return RootOutputFileLoc; } CmdLineApp *App; protected: Vector CrossRefInfos; ElementSet Elements; void switchToTagStream( TagStream &tagStream, bool startWithDefaultPgfFormat = true ); String RootOutputFileLoc; T_ID NextID; MifOutputByteStream *curOs; Vector BookComponents; size_t CurTblNum; ParagraphFormat CurFormat; TextFlow *CurTextFlow; Cell *CurCell; Para *CurPara; Vector TagStreamStack; }; class MifOutputByteStream { OutputByteStream *os; public: int CurTagIndent; static MifDoc::T_indent INDENT; void indent() { CurTagIndent += 2; } void undent() { CurTagIndent -= 2; assert( CurTagIndent >= 0 ); } MifOutputByteStream( MifDoc::T_indent i = 0 ) : os( NULL ), CurTagIndent( i ) {}; MifOutputByteStream( OutputByteStream &os, MifDoc::T_indent i = 0 ) : os( &os ), CurTagIndent( i ) {}; void setStream( OutputByteStream &s ) { os = &s; } OutputByteStream &stream() { assert( os != NULL ); return *os; } MifOutputByteStream &operator<<( unsigned n ) { stream() << n; return *this; } MifOutputByteStream &operator<<( long n ) { stream() << n; return *this; } MifOutputByteStream &operator<<( char c ) { stream() << c; return *this; } MifOutputByteStream &operator<<( const char *s ) { stream() << s; return *this; } #ifdef SP_WIDE_SYSTEM MifOutputByteStream &operator<<( const String &s ) { for( size_t i = 0; i < s.size(); i++ ) stream() << char( s[i] ); return *this; } #endif MifOutputByteStream &operator<<( const String &s ) { stream() << s; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_string &s ) { stream() << '`'; stream() << s; stream() << '\''; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_percentage &p ) { char buf[32]; sprintf( buf, "%.6f", p ); stream() << buf; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_dimension &d ) { char buf[32]; int i; sprintf( buf, "%li.%.3i%n", long(d)/1000, abs(long(d)%1000), &i ); while( buf[--i] == '0' ) {}; if( buf[i] == '.' ) i--; buf[i+1] = '\0'; stream() << buf << "pt"; return *this; } MifOutputByteStream &operator<<( const MifDoc::CrossRefInfo &cri ) { Vector &crossRefInfos = MifDoc::CurInstance->crossRefInfos(); unsigned idx = crossRefInfos.size(); crossRefInfos.resize( crossRefInfos.size() + 1 ); crossRefInfos.back() = cri; stream() << MifDoc::escapeChar(); stream().sputn( (char*)&idx, sizeof( idx ) ); return *this; } MifOutputByteStream &operator<<( const MifDoc::T_LTRB &b ) { *this << b.l << " " << b.t << " " << b.r << " " << b.b; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_LTWH &b ) { *this << b.l << " " << b.t << " " << b.w << " " << b.h; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_WH &s ) { *this << s.w << " " << s.h; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_XY &s ) { *this << s.x << " " << s.y; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_boolean &b ) { if( bool(b) ) *this << "Yes"; else *this << "No"; return *this; } MifOutputByteStream &operator<<( const MifDoc::T_indent &i ) { unsigned cnt = (i==INDENT) ? CurTagIndent : unsigned( i ); for( ; cnt; cnt-- ) stream() << ' '; return *this; } }; class MifTmpOutputByteStream : public TmpOutputByteStream { MifOutputByteStream os; public: MifTmpOutputByteStream( MifDoc::T_indent osIndent = 0 ) : TmpOutputByteStream(), os( osIndent ) { os.setStream( *this ); } void commit( OutputByteStream &os, bool resolveCrossReferences = false ); void commit( String &str ); MifOutputByteStream &stream() { return os; } }; class MifFOTBuilder : public SerialFOTBuilder { public: MifFOTBuilder( const String &fileLoc, const Ptr &, const CharsetInfo &, CmdLineApp *app ); ~MifFOTBuilder() {} static MifFOTBuilder &curInstance() { assert( CurInstance != NULL ); return *CurInstance; } static MifFOTBuilder *CurInstance; struct IndexEntryNIC { IndexEntryNIC() : pageNumber( true ), startsPageRange( false ), endsPageRange( false ) {} StringC sortString; Vector components; bool pageNumber; bool startsPageRange; bool endsPageRange; }; class MifExtensionFlowObj : public FOTBuilder::ExtensionFlowObj { public: virtual void atomic( MifFOTBuilder &, const NodePtr & ) const = 0; }; class IndexEntryFlowObj : public MifExtensionFlowObj { public: void atomic( MifFOTBuilder &fb, const NodePtr & ) const { fb.indexEntry( nic ); } bool hasNIC( const StringC &name ) const; void setNIC( const StringC &name, const Value &value ); ExtensionFlowObj *copy() const { return new IndexEntryFlowObj(*this); } private: IndexEntryNIC nic; }; void extension( const ExtensionFlowObj &fo, const NodePtr & ); void start(); void end(); void startSimplePageSequenceSerial(); void endSimplePageSequenceSerial(); void startSimplePageSequenceHeaderFooter( unsigned ); void endSimplePageSequenceHeaderFooter( unsigned ); void endAllSimplePageSequenceHeaderFooter(); void indexEntry( const IndexEntryNIC & ); void setPageNColumns( long ); void setPageColumnSep( Length ); void setPageBalanceColumns( bool ); void startNode( const NodePtr &, const StringC & ); void endNode(); void currentNodePageNumber( const NodePtr & ); void startLink( const Address & ); void endLink(); void startLineField( const LineFieldNIC & ); void endLineField(); void doStartParagraph( const ParagraphNIC &, bool servesAsWrapper = false, MifDoc::T_dimension = 0, bool allowNegativeLeading = false ); void startParagraph( const ParagraphNIC &nic ) { doStartParagraph( nic ); } void doEndParagraph( bool sustainFormatStack = false, bool sustainDisplayStack = false, bool paragraphBreakTest = true, bool discardThisPara = false ); void endParagraph() { doEndParagraph(); } void startDisplayGroup( const DisplayGroupNIC & ); void endDisplayGroup(); void characters( const Char *, size_t ); void paragraphBreak( const ParagraphNIC & ); void externalGraphic( const ExternalGraphicNIC & ); void rule( const RuleNIC & ); void pageNumber(); void startScore( Symbol ); void endScore(); void startLeader( const LeaderNIC & ); void endLeader(); void startTable(const TableNIC &); void endTable(); void startTablePartSerial(const TablePartNIC &); void endTablePartSerial(); void startTablePartHeader(); void endTablePartHeader(); void startTablePartFooter(); void endTablePartFooter(); void tableColumn(const TableColumnNIC &); void startTableRow(); void endTableRow(); void startTableCell(const TableCellNIC &); void endTableCell(); void tableBeforeRowBorder(); void tableAfterRowBorder(); void tableBeforeColumnBorder(); void tableAfterColumnBorder(); void tableCellBeforeRowBorder(); void tableCellAfterRowBorder(); void tableCellBeforeColumnBorder(); void tableCellAfterColumnBorder(); // void setCellBeforeRowMargin(Length); // void setCellAfterRowMargin(Length); // void setCellBeforeColumnMargin(Length); // void setCellAfterColumnMargin(Length); void setCellBackground( bool ); void setCellRowAlignment( Symbol ); void setFontSize(Length); void setFontFamilyName( const StringC & ); void setFontWeight( Symbol ); void setFontPosture( Symbol ); void setStartIndent( const LengthSpec & ); void setEndIndent( const LengthSpec & ); void setFirstLineStartIndent( const LengthSpec & ); // void setLastLineEndIndent(const LengthSpec &); void setLineSpacing( const LengthSpec & ); void setFieldWidth( const LengthSpec & ); void setLines( Symbol ); void setQuadding( Symbol ); void setDisplayAlignment( Symbol ); void setFieldAlign( Symbol ); void setColor( const DeviceRGBColor & ); void setBackgroundColor( const DeviceRGBColor & ); void setBackgroundColor(); void setPageWidth( Length ); void setPageHeight( Length ); void setLeftMargin( Length ); void setRightMargin( Length ); void setTopMargin( Length ); void setBottomMargin( Length ); void setHeaderMargin( Length ); void setFooterMargin( Length ); void setBorderPresent(bool); void setLineThickness(Length); void setCellBeforeRowMargin( Length ); void setCellAfterRowMargin( Length ); void setCellBeforeColumnMargin( Length ); void setCellAfterColumnMargin( Length ); void setLineSep(Length); // void setBoxSizeBefore(Length); // void setBoxSizeAfter(Length); void setPositionPointShift( const LengthSpec & ); // void setStartMargin(const LengthSpec &); // void setEndMargin(const LengthSpec &); // void setSidelineSep(const LengthSpec &); // void setAsisWrapIndent(const LengthSpec &); // void setLineNumberSep(const LengthSpec &); // void setLastLineJustifyLimit(const LengthSpec &); // void setJustifyGlyphSpaceMaxAdd(const LengthSpec &); // void setJustifyGlyphSpaceMaxRemove(const LengthSpec &); // void setTableCornerRadius(const LengthSpec &); // void setBoxCornerRadius(const LengthSpec &); // void setMarginaliaSep(const LengthSpec &); // void setMinPreLineSpacing(const OptLengthSpec &); // void setMinPostLineSpacing(const OptLengthSpec &); void setMinLeading( const OptLengthSpec & ); // void setInhibitLineBreaks(bool); void setHyphenate( bool ); void setKern( bool ); // void setLigature(bool); // void setScoreSpaces(bool); // void setFloatOutMarginalia(bool); // void setFloatOutSidelines(bool); // void setFloatOutLineNumbers(bool); // void setCellBackground(bool); // void setSpanWeak(bool); // void setIgnoreRecordEnd(bool); // void setNumberedLines(bool); // void setHangingPunct(bool); // void setBoxOpenEnd(bool); // void setTruncateLeader(bool); // void setAlignLeader(bool); // void setTablePartOmitMiddleHeader(bool); // void setTablePartOmitMiddleFooter(bool); void setBorderOmitAtBreak(bool); // void setPrincipalModeSimultaneous(bool); // void setMarginaliaKeepWithPrevious(bool); // void setGridEquidistantRows(bool); // void setGridEquidistantColumns(bool); // void setLineJoin(Symbol); void setLineCap( Symbol ); // void setLineNumberSide(Symbol); // void setKernMode(Symbol); void setInputWhitespaceTreatment( Symbol ); // void setFillingDirection(Symbol); // void setWritingMode(Symbol); // void setLastLineQuadding(Symbol); // void setMathDisplayMode(Symbol); // void setScriptPreAlign(Symbol); // void setScriptPostAlign(Symbol); // void setScriptMidSupAlign(Symbol); // void setScriptMidSubAlign(Symbol); // void setNumeratorAlign(Symbol); // void setDenominatorAlign(Symbol); // void setGridPositionCellType(Symbol); // void setGridColumnAlignment(Symbol); // void setGridRowAlignment(Symbol); // void setBoxType(Symbol); // void setGlyphAlignmentMode(Symbol); // void setBoxBorderAlignment(Symbol); // void setCellRowAlignment(Symbol); // void setBorderAlignment(Symbol); // void setSidelineSide(Symbol); // void setHyphenationKeep(Symbol); // void setPositionPreference(Symbol); // void setFontStructure(Symbol); // void setFontProportionateWidth(Symbol); // void setCellCrossed(Symbol); // void setMarginaliaSide(Symbol); // void setLayer(long); // void setBackgroundLayer(long); void setBorderPriority( long ); void setLineRepeat( long ); void setSpan( long ); // void setMinLeaderRepeat(long); void setHyphenationRemainCharCount( long ); void setHyphenationPushCharCount( long ); void setWidowCount( long ); void setOrphanCount( long ); // void setExpandTabs(long); void setHyphenationLadderCount( long ); // void setBackgroundTile(PublicId); // void setLineBreakingMethod(PublicId); // void setLineCompositionMethod(PublicId); // void setImplicitBidiMethod(PublicId); // void setGlyphSubstMethod(PublicId); // void setGlyphReorderMethod(PublicId); // void setHyphenationMethod(PublicId); // void setTableAutoWidthMethod(PublicId); // void setFontName(PublicId); void setLanguage (Letter2 ); void setCountry( Letter2 ); // void setEscapementSpaceBefore(const InlineSpace &); // void setEscapementSpaceAfter(const InlineSpace &); // void setGlyphSubstTable(const Vector > &); struct DisplayInfo : public Link { DisplayInfo( const DisplayNIC &nic, DisplayInfo *parentDs ) : spaceBefore( nic.spaceBefore), spaceAfter( nic.spaceAfter ), keep( nic.keep ), breakAfter( nic.breakAfter ), breakBefore( nic.breakBefore ), keepWithPrevious( nic.keepWithPrevious ), keepWithNext( nic.keepWithNext ), mayViolateKeepBefore( nic.mayViolateKeepBefore ), isParagraph( false ), mayViolateKeepAfter( nic.mayViolateKeepAfter ), firstParaOutputed( false ), paragraphClosedInMif( false ) { keepWithinPageInEffect = (nic.keep==symbolPage) ? true : (parentDs ? parentDs->keepWithinPageInEffect : false ); } DisplaySpace spaceBefore; DisplaySpace spaceAfter; Symbol keep; Symbol breakBefore; Symbol breakAfter; bool keepWithPrevious; bool keepWithNext; bool mayViolateKeepBefore; bool mayViolateKeepAfter; bool firstParaOutputed; bool isParagraph; bool paragraphClosedInMif; bool keepWithinPageInEffect; }; struct DisplaySpaceInfo : public Link { DisplaySpaceInfo( DisplaySpace space_, Symbol breakType_, bool breakIsAfter_ ) : space( space_ ), breakType( breakType_ ), breakIsAfter( breakIsAfter_ ) {} DisplaySpace space; Symbol breakType; bool breakIsAfter; }; struct EffectiveDisplaySpace { long nominal; long min; long max; long priority; bool conditional; bool force; EffectiveDisplaySpace() { set(); } EffectiveDisplaySpace( long) { set(); } void set( long nominal_ = 0, long min_ = 0, long max_ = 0, long priority_ = 0, bool conditional_ = true, bool force_ = false ) { nominal = nominal_; min = min_; max = max_; priority = priority_; conditional = conditional_; force = force_; } void combine( const EffectiveDisplaySpace ); void clear() { set(); } }; struct TFotSimplePageSequence { TFotSimplePageSequence() : BodyTextFlow( NULL ), FirstHeaderTextFlow( NULL ), FirstFooterTextFlow( NULL ), LeftHeaderTextFlow( NULL ), LeftFooterTextFlow( NULL ), RightHeaderTextFlow( NULL ), RightFooterTextFlow( NULL ) {} MifDoc::TextFlow *BodyTextFlow; MifDoc::TextFlow *FirstHeaderTextFlow; MifDoc::TextFlow *FirstFooterTextFlow; MifDoc::TextFlow *LeftHeaderTextFlow; MifDoc::TextFlow *LeftFooterTextFlow; MifDoc::TextFlow *RightHeaderTextFlow; MifDoc::TextFlow *RightFooterTextFlow; MifDoc::ParagraphFormat paragraphFormat; }; struct Border { Border( bool cellBorder_ = true ) : cellBorder( cellBorder_ ), borderPresent( false ) {} long borderPriority; Length lineThickness; bool borderPresent; long lineRepeat; Length lineSep; bool cellBorder; MifDoc::T_tagstring color; MifDoc::T_tagstring makeMifRuling( MifDoc &mifDoc ); void resolve( Border &adjacentBorder ); void setFromFot(); }; struct Column { Column() : hasWidth( 0 ) {} bool hasWidth; TableLengthSpec width; }; struct Cell { Cell() : missing( false ), MifCell( new MifDoc::Cell ), OverlappingCell( NULL ), nRowsSpanned( 1 ), nColumnsSpanned( 1 ), displaySize( 0 ) {} bool missing; unsigned nColumnsSpanned; unsigned nRowsSpanned; Border beforeRowBorder; Border afterRowBorder; Border beforeColumnBorder; Border afterColumnBorder; long displaySize; Cell *OverlappingCell; MifDoc::Cell &mifCell() { assert( MifCell != NULL ); return *MifCell; } void translate( MifDoc::Cell &mifCell, MifDoc &mifDoc ); protected: MifDoc::Cell *MifCell; }; struct Row { Row() {} Vector Cells; void translate( Vector &mifRows, MifDoc &mifDoc ); }; struct Table; struct TablePart { TablePart() : MifTableNum( 0 ), ParentTable( NULL ), columnsProcessed( false ), needsColumnReprocessing( false ) {} Vector Columns; Vector Header; Vector Body; Vector Footer; void translate( MifDoc &mifDoc ); void processColumns(); void normalizeRows(); void begin( Table &parentTable, MifDoc &mifDoc ); MifDoc::Tbl &mifTable( MifDoc &mifDoc ) { assert( MifTableNum > 0 ); return mifDoc.tbls()[MifTableNum-1]; } Table &parentTable() { assert( ParentTable != NULL ); return *ParentTable; } size_t MifTableNum; Table *ParentTable; bool columnsProcessed; bool needsColumnReprocessing; }; struct Table { Table() : beforeRowBorder( false ), afterRowBorder( false ), beforeColumnBorder( false ), afterColumnBorder( false ), CurCell( NULL ), CurTablePart( NULL ), DefaultTblFormatGenerated( false ), NoTablePartsSeen( true ) {} Vector TableParts; Border beforeRowBorder; Border afterRowBorder; Border beforeColumnBorder; Border afterColumnBorder; // TableNIC nic; Length tableWidth; Symbol displayAlignment; Length startIndent; void resolveBorders( Vector &rows, bool hasFirstTableRow, bool hasLastTableRow ); void begin( MifDoc &mifDoc ); Vector &curRows() { assert( CurRows != NULL ); return *CurRows; } TablePart &curTablePart() { assert( CurTablePart != NULL ); return *CurTablePart; } Cell &curCell() { assert( CurCell != NULL ); return *CurCell; } TablePart *CurTablePart; Cell *CurCell; Vector *CurRows; bool DefaultTblFormatGenerated; bool NoTablePartsSeen; }; struct Format : public MifDoc::ParagraphFormat { Format() : MifDoc::ParagraphFormat(), FotLineSpacingSpec( 12000 ), FotFirstLineStartIndentSpec( 0 ), FotStartIndentSpec( 0 ), FotEndIndentSpec( 0 ), FotLanguage( 0 ), FotCurDisplaySize( 0 ), FotLineThickness( 1000 ), FotBorderPresent( true ), FotLineRepeat( 1 ), FotLineSep( 1000 ), FotBorderPriority( 0 ), FotDisplayAlignment( symbolStart ), FotLeftMargin( 1 ), FotRightMargin( 1 ), FotTopMargin( 0 ), FotBottomMargin( 0 ), FotHeaderMargin( 0 ), FotFooterMargin( 0 ), FotPageWidth( 72000*8 ), FotPageHeight( (72000*23)/2 ), FotLineCap( symbolButt ), FotPositionPointShiftSpec( 0 ), FotMinLeading(), FotFieldAlign( symbolStart ), FotFieldWidth( 0 ), FotLines( symbolWrap ), FotInputWhitespaceTreatment( symbolPreserve ), FotPageNColumns( 1 ), FotPageColumnSep( 72000/2 ), FotSpan( 1 ), FotPageBalanceColumns( false ), FotCellBackground( false ) {} LengthSpec FotFirstLineStartIndentSpec; LengthSpec FotStartIndentSpec; LengthSpec FotEndIndentSpec; LengthSpec FotLineSpacingSpec; LengthSpec FotPositionPointShiftSpec; LengthSpec FotFieldWidth; OptLengthSpec FotMinLeading; long FotCurDisplaySize; Length FotLineThickness; Symbol FotLineCap; long FotBorderPriority; bool FotBorderPresent; long FotLineRepeat; Length FotLineSep; Symbol FotDisplayAlignment; Length FotLeftMargin; Length FotRightMargin; Length FotTopMargin; Length FotBottomMargin; Length FotHeaderMargin; Length FotFooterMargin; Length FotPageWidth; Length FotPageHeight; Symbol FotFieldAlign; Symbol FotInputWhitespaceTreatment; Symbol FotLines; long FotPageNColumns; Length FotPageColumnSep; long FotSpan; bool FotPageBalanceColumns; bool FotCellBackground; MifDoc::T_tagstring MifBackgroundColor; Letter2 FotLanguage; Letter2 FotCountry; void computePgfLanguage(); static const Length INITIAL_PAGE_SIZE() { return 72000*8; } }; struct NodeInfo { NodeInfo() {} NodeInfo( NodePtr node_, unsigned nodeLevel_ ) : node( node_ ), nodeLevel( nodeLevel_ ) {} NodePtr node; unsigned nodeLevel; static unsigned nonEmptyElementsOpened; static unsigned curNodeLevel; }; struct LinkInfo { LinkInfo( MifDoc::CrossRefInfo *crossRefInfo_ = NULL ) : crossRefInfo( crossRefInfo_ ), openedInMif( false ) {} ~LinkInfo() { if( crossRefInfo != NULL ) delete crossRefInfo; } bool forcesNoLink() const { return crossRefInfo != NULL ? false : true; } MifDoc::CrossRefInfo *crossRefInfo; bool openedInMif; static unsigned pendingMifClosings; }; struct SymbolFont { const char *name; Char mapping[256]; }; enum { nSymbolFonts = 3 }; void synchronizeFontFormat(); long computeLengthSpec( const LengthSpec &spec ) const; Format &format() const { Format *result = formatStack.head(); assert( result != NULL ); return *result; } Table &curTable() { return CurTable; } void setCurLeaderStream( MifTmpOutputByteStream *s, bool doDelete = true ) { if( doDelete && CurLeaderStream ) delete CurLeaderStream; CurLeaderStream = s; } MifTmpOutputByteStream &curLeaderStream() { assert( CurLeaderStream != NULL ); return *CurLeaderStream; } CmdLineApp *App; const CharsetInfo *SystemCharset; Ptr EntityManager; bool paragraphBreakInEffect; bool inLeader; bool lastFlowObjectWasWhitespace; bool firstHeaderFooter; bool inSimplePageSequence; bool bookComponentOpened; bool bookComponentAvailable; protected: TFotSimplePageSequence FotSimplePageSequence; Table CurTable; MifDoc::T_pathname systemIdToMifPathname( const StringC &systemId ); bool systemIdToMifPathname( const StringC &systemId, MifDoc::T_pathname & ); int systemIdFilename( const StringC &systemId, StringC &filename ); void initMifBookComponent(); void setupSimplePageSequence(); void beginHeaderFooter( bool header ); void beginHeader() { beginHeaderFooter( true ); } void beginFooter() { beginHeaderFooter( false ); }; void endHeaderFooter(); void makeEmptyTextFlow( MifDoc::TextRect & ); void checkForParagraphReopening(); void outPendingInlineStatements(); void outString( const Char *s, size_t n, MifTmpOutputByteStream *o = NULL, bool inParagraph = true, String *targetString = NULL ); MifDoc::Frame &makeAnchoredFrame ( MifDoc::T_keyword frameType, long width, long height, MifDoc::T_keyword anchorAlign = MifDoc::sLeft ); void setupHeaderFooterParagraphFormat( MifDoc::ParagraphFormat &, MifDoc::ParagraphFormat &, MifDoc::T_dimension ); OutputByteStream &os() { return *outputStream; } MifDoc mifDoc; OutputByteStream *outputStream; MifTmpOutputByteStream *CurLeaderStream; EffectiveDisplaySpace createEffectiveDisplaySpace( const DisplaySpace &ds ) const; IList displayStack; IList formatStack; IQueue displaySpaceQueue; Vector nodeStack; Vector linkStack; Vector indexEntryStack; Format nextFormat; Symbol pendingBreak; EffectiveDisplaySpace pendingEffectiveDisplaySpace; void processDisplaySpaceStack(); void startDisplay( const DisplayNIC & ); void endDisplay(); // sytem font code from James Clark enum { CHAR_TABLE_CHAR_BITS = 16 }; enum { CHAR_TABLE_SYMBOL_FLAG = 1U << 31 }; CharMap CharTable; static const SymbolFont SymbolFonts[nSymbolFonts]; static const Char FrameCharsetMap[128]; }; MifFOTBuilder *MifFOTBuilder::CurInstance = NULL; unsigned MifFOTBuilder::NodeInfo::nonEmptyElementsOpened = 0; unsigned MifFOTBuilder::NodeInfo::curNodeLevel = 0; unsigned MifFOTBuilder::LinkInfo::pendingMifClosings = 0; int operator ==(struct FOTBuilder::DisplayNIC, struct FOTBuilder::DisplayNIC) { return 0; } void MifFOTBuilder::start() { NodeInfo::nonEmptyElementsOpened = nodeStack.size(); Format *effectiveFormat = new Format( nextFormat ); if( nextFormat.FSize > 0 ) effectiveFormat->setFDY ( double( computeLengthSpec( nextFormat.FotPositionPointShiftSpec ) * -100 ) / nextFormat.FSize ); formatStack.insert( effectiveFormat ); } void MifFOTBuilder::end() { assert( formatStack.head() != NULL ); delete formatStack.get(); assert( formatStack.head() != NULL ); nextFormat = *formatStack.head(); } void MifFOTBuilder::Format::computePgfLanguage() { switch( FotLanguage ) { case SP_LETTER2( 'E', 'N' ): switch( FotCountry ) { case SP_LETTER2( 'G', 'B' ): PgfLanguage = MifDoc::sUKEnglish; break; default: PgfLanguage = MifDoc::sUSEnglish; } break; case SP_LETTER2( 'D', 'E' ): switch( FotCountry ) { case SP_LETTER2( 'C', 'H' ): PgfLanguage = MifDoc::sSwissGerman; break; default: PgfLanguage = MifDoc::sGerman; } case SP_LETTER2( 'F', 'R' ): switch( FotCountry ) { case SP_LETTER2( 'C', 'A' ): PgfLanguage = MifDoc::sCanadianFrench; break; default: PgfLanguage = MifDoc::sFrench; } break; case SP_LETTER2( 'E', 'S' ): PgfLanguage = MifDoc::sSpanish; break; case SP_LETTER2( 'C', 'A' ): PgfLanguage = MifDoc::sCatalan; break; case SP_LETTER2( 'I', 'T' ): PgfLanguage = MifDoc::sItalian; break; case SP_LETTER2( 'P', 'T' ): PgfLanguage = MifDoc::sPortuguese; break; // case SP_LETTER2( '', '' ): // PgfLanguage = sBrazilian; // break; // case SP_LETTER2( '', '' ): // PgfLanguage = sDanish; // break; case SP_LETTER2( 'N', 'L' ): PgfLanguage = MifDoc::sDutch; break; case SP_LETTER2( 'N', 'O' ): PgfLanguage = MifDoc::sNorwegian; break; // case SP_LETTER2( '', '' ): // PgfLanguage = sNynorsk; // break; case SP_LETTER2( 'F', 'I' ): PgfLanguage = MifDoc::sFinnish; break; case SP_LETTER2( 'S', 'V' ): PgfLanguage = MifDoc::sSwedish; break; default: PgfLanguage = MifDoc::sNoLanguage; } } MifFOTBuilder::MifFOTBuilder( const String &fileLoc, const Ptr &entityManager, const CharsetInfo &systemCharset, CmdLineApp *app ) : App( app ), EntityManager( entityManager ), SystemCharset( &systemCharset ), mifDoc( fileLoc, app ), paragraphBreakInEffect( false ), inLeader( false ), CurLeaderStream( NULL ), CharTable( 0 ), lastFlowObjectWasWhitespace( false ), pendingBreak( symbolFalse ), firstHeaderFooter( true ), inSimplePageSequence( false ), bookComponentOpened( false ), bookComponentAvailable( false ) { CurInstance = this; nextFormat.setDSSSLDefaults(); nextFormat.FotCurDisplaySize = Format::INITIAL_PAGE_SIZE() - 2; // 2 is for margins (MIF doesn't accept zero-sized ones) formatStack.insert( new Format( nextFormat ) ); initMifBookComponent(); bookComponentOpened = true; bookComponentAvailable = true; for( int i = 0; i < 128; i++ ) { Char c = FrameCharsetMap[i]; if( c ) { if( !CharTable[i+0x80] ) CharTable.setChar( i+0x80, c ); else if ((CharTable[i+0x80] & ((1 << CHAR_TABLE_CHAR_BITS) - 1)) == c) CharTable.setChar(i+0x80, CharTable[i+0x80] | (1 << (i + CHAR_TABLE_CHAR_BITS))); } } // symbol character code from James Clark for( int i = 0; i < nSymbolFonts; i++ ) { for( int j = 0; j < 256; j++ ) { Char c = SymbolFonts[i].mapping[j]; if( c && !CharTable[c] ) CharTable.setChar( c, j | (i << CHAR_TABLE_CHAR_BITS) | CHAR_TABLE_SYMBOL_FLAG ); } } } void MifFOTBuilder::initMifBookComponent() { MifDoc::ParagraphFormat defaultParaFormat; defaultParaFormat.setDSSSLDefaults(); defaultParaFormat.setPgfTag( MifDoc::sDefaultPgfFormat ); mifDoc.pgfCatalog().ParaFormats.push_back( defaultParaFormat ); mifDoc.document().setDPageSize ( MifDoc::T_WH( MifDoc::T_dimension( format().FotPageWidth ), MifDoc::T_dimension( format().FotPageHeight ) ) ); mifDoc.document().setDMargins( MifDoc::T_LTRB( 1, 1, 1, 1 ) ); // MIF doesn't accept zeros mifDoc.document().setDColumns( 1 ); } long MifFOTBuilder::computeLengthSpec( const LengthSpec &spec ) const { if( spec.displaySizeFactor == 0.0 ) { return spec.length; } else { double tem = format().FotCurDisplaySize * spec.displaySizeFactor; return spec.length + long( tem >= 0.0 ? tem +.5 : tem - .5 ); } } MifFOTBuilder::EffectiveDisplaySpace MifFOTBuilder::createEffectiveDisplaySpace( const DisplaySpace &ds ) const { EffectiveDisplaySpace result; result.set( computeLengthSpec( ds.nominal ), computeLengthSpec( ds.min ), computeLengthSpec( ds.max ), ds.priority, ds.conditional, ds.force ); return result; } void MifFOTBuilder::EffectiveDisplaySpace::combine( const EffectiveDisplaySpace eds ) { if( eds.force ) { if( force ) { nominal += eds.nominal; min += eds.min; max += eds.max; } else *this = eds; } else { if( eds.priority > priority ) *this = eds; else { if( eds.priority == priority ) { if( eds.nominal > nominal ) *this = eds; else if( eds.nominal == nominal ) { if( eds.min < min ) { min = eds.min; } if( eds.max > max ) { max = eds.max; } } } } } } void MifFOTBuilder::synchronizeFontFormat() { if( mifDoc.curPara( false ) != NULL ) { // mifDoc.curPara()->curFormat().ffUpdateFrom( format() ); mifDoc.curPara()->curFormat().ffUpdateFrom( nextFormat ); mifDoc.curPara()->curFormat().ffOut( mifDoc.os(), MifDoc::FontFormat::stFont ); } else { // mifDoc.curFormat().ffUpdateFrom( format() ); mifDoc.curFormat().ffUpdateFrom( nextFormat ); mifDoc.curFormat().ffOut( mifDoc.os(), MifDoc::FontFormat::stFont ); } outPendingInlineStatements(); } void MifFOTBuilder::outString ( const Char *s, size_t n, MifTmpOutputByteStream *o, bool inParagraph, String *targetString ) { MifOutputByteStream *outS = ( o != NULL ) ? &o->stream() : ( ( targetString != NULL ) ? (MifOutputByteStream *)NULL : &mifDoc.os() ); enum { nStr, nCode, nChar, nNothing, nHardReturn, nSpecialChar } nextOut; union { const char *str; unsigned long code; char chr; } out; String out_specialChar; MifDoc::ParagraphFormat *curPFormat = inParagraph ? ( mifDoc.curPara( false ) != NULL ? &mifDoc.curPara()->curFormat() : &mifDoc.curFormat() ) : (MifDoc::ParagraphFormat*)NULL; MifDoc::T_string paraFFamily; if( curPFormat != NULL ) paraFFamily = curPFormat->FFamily; bool stringOpened = false; int prevSymbolFontNum = 0; int curSymbolFontNum = 0; bool thisFlowObjectIsWhitespace; for( ; n > 0; s++, n-- ) { thisFlowObjectIsWhitespace = false; nextOut = nNothing; switch( *s ) { case Char( '\n' ): break; case Char( '\r' ): if( !inParagraph ) { out.chr = ' '; nextOut = nChar; } else { switch( format().FotLines ) { case symbolNone: case symbolWrap: switch( format().FotInputWhitespaceTreatment ) { case symbolIgnore: break; case symbolCollapse: if( lastFlowObjectWasWhitespace ) break; case symbolPreserve: default: out.chr = ' '; nextOut = nChar; } break; default: nextOut = nHardReturn; } thisFlowObjectIsWhitespace = true; } break; case Char( '\t' ): if( !inParagraph ) { out.str = "\\t"; nextOut = nStr; } else { switch( format().FotInputWhitespaceTreatment ) { case symbolIgnore: break; case symbolCollapse: if( lastFlowObjectWasWhitespace ) break; case symbolPreserve: default: out.str = "\\t"; nextOut = nStr; } thisFlowObjectIsWhitespace = true; } break; case Char( '>' ): out.str = "\\>"; nextOut = nStr; break; case Char( '\'' ): out.str = "\\q"; nextOut = nStr; break; case Char( '`' ): out.str = "\\Q"; nextOut = nStr; break; case Char( '\\' ): out.str = "\\\\"; nextOut = nStr; break; case Char( ' ' ): if( !inParagraph ) { out.chr = ' '; nextOut = nChar; } else { switch( format().FotInputWhitespaceTreatment ) { case symbolIgnore: break; case symbolCollapse: if( lastFlowObjectWasWhitespace ) break; case symbolPreserve: default: out.chr = ' '; nextOut = nChar; } thisFlowObjectIsWhitespace = true; } break; case 0x00A0: out_specialChar = MifDoc::sHardSpace; nextOut = nSpecialChar; break; case 0x00A2: out_specialChar = MifDoc::sCent; nextOut = nSpecialChar; break; case 0x00A3: case 0x20A4: out_specialChar = MifDoc::sPound; nextOut = nSpecialChar; break; case 0x00A5: out_specialChar = MifDoc::sYen; nextOut = nSpecialChar; break; case 0x2002: out_specialChar = MifDoc::sEnSpace; nextOut = nSpecialChar; break; case 0x2003: out_specialChar = MifDoc::sEmSpace; nextOut = nSpecialChar; break; case 0x2009: out_specialChar = MifDoc::sThinSpace; nextOut = nSpecialChar; break; case 0x2010: out_specialChar = MifDoc::sSoftHyphen; nextOut = nSpecialChar; break; case 0x2011: out_specialChar = MifDoc::sHardHyphen; nextOut = nSpecialChar; break; case 0x2013: out_specialChar = MifDoc::sEnDash; nextOut = nSpecialChar; break; case 0x2014: out_specialChar = MifDoc::sEmDash; nextOut = nSpecialChar; break; case 0x2020: out_specialChar = MifDoc::sDagger; nextOut = nSpecialChar; break; case 0x2021: out_specialChar = MifDoc::sDoubleDagger; nextOut = nSpecialChar; break; case 0x2022: out_specialChar = MifDoc::sBullet; nextOut = nSpecialChar; break; default: if( *s >= 0x80 ) { unsigned long code = CharTable[*s]; if( code & CHAR_TABLE_SYMBOL_FLAG ) { if( curPFormat != NULL ) { curSymbolFontNum = ( ( code & ~CHAR_TABLE_SYMBOL_FLAG ) >> CHAR_TABLE_CHAR_BITS ) + 1; assert( curSymbolFontNum < nSymbolFonts ); out.code = code & 0xff; nextOut = nCode; } } else if( code ) { out.code = code & 0xff; nextOut = nCode; } } else { out.chr = char( *s ); nextOut = nChar; } } if( nextOut != nNothing ) { if( curSymbolFontNum != prevSymbolFontNum ) { if( stringOpened ) { *outS << "'>"; stringOpened = false; } MifDoc::T_string fontFamily( curSymbolFontNum == 0 ? paraFFamily : MifDoc::T_string( SymbolFonts[ curSymbolFontNum - 1 ].name ) ); curPFormat->setFFamily( fontFamily ); curPFormat->ffOut( *outS, MifDoc::FontFormat::stFont ); } if( curPFormat != NULL && !stringOpened ) { *outS << '\n' << MifOutputByteStream::INDENT << ""; stringOpened = false; } mifDoc.outSpecialChar( MifDoc::sHardReturn, outS ); MifDoc::ParaLine::outEpilog( *outS ); MifDoc::ParaLine::outProlog( *outS ); } break; case nSpecialChar: if( inParagraph ) { if( stringOpened ) { *outS << "'>"; stringOpened = false; } mifDoc.outSpecialChar( out_specialChar, outS ); } break; case nCode: if( targetString != NULL ) mifDoc.outHexChar( out.code, *targetString ); else mifDoc.outHexChar( out.code, outS ); break; break; case nStr: if( targetString != NULL ) targetString->append( out.str, strlen( out.str ) ); else *outS << out.str; break; case nNothing: break; } } prevSymbolFontNum = curSymbolFontNum; lastFlowObjectWasWhitespace = thisFlowObjectIsWhitespace; } if( stringOpened ) *outS << "'>"; if( curSymbolFontNum != 0 ) { curPFormat->setFFamily( paraFFamily ); curPFormat->ffOut( *outS, MifDoc::FontFormat::stFont ); curPFormat->ffSetProperties() &= ~MifDoc::FontFormat::fFFamily; } } void MifFOTBuilder::characters( const Char *s, size_t n ) { checkForParagraphReopening(); if( MifDoc::Para::currentlyOpened ) { if( inLeader ) { outString( s, n, &curLeaderStream(), false ); } else { synchronizeFontFormat(); outString( s, n, NULL, true ); } } } void MifFOTBuilder::checkForParagraphReopening() { DisplayInfo *curDs = displayStack.head(); // assert( curDs != NULL ); if( curDs != NULL && curDs->paragraphClosedInMif ) { Format f = format(); f.setPgfWithPrev( curDs->firstParaOutputed ? curDs->keepWithinPageInEffect : false ); f.setPgfWithNext( false ); // TMAI curDs->firstParaOutputed = true; processDisplaySpaceStack(); switch( pendingBreak ) { case symbolPage: f.setPgfPlacement( MifDoc::sPageTop ); break; case symbolColumn: f.setPgfPlacement( MifDoc::sColumnTop ); break; default: f.setPgfPlacement( MifDoc::sAnywhere ); } pendingBreak = symbolFalse; f.setPgfSpBefore( pendingEffectiveDisplaySpace.nominal ); pendingEffectiveDisplaySpace.clear(); f.setPgfFIndent( nextFormat.PgfLIndent ); MifDoc::Para *p = new MifDoc::Para( mifDoc.curTagStream().content().stream().CurTagIndent + 4 ); p->setParagraphFormat( mifDoc.curFormat() ); p->format().updateFrom( f ); p->format().FSize = mifDoc.curFormat().FSize; p->format().ffSetProperties() &= ~MifDoc::FontFormat::fFSize; Length lineSpacing = computeLengthSpec( f.FotLineSpacingSpec.length ); if( p->format().FSize != lineSpacing ) p->format().setFSize( lineSpacing ); p->curFormat() = p->format(); // assert( mifDoc.curPara( false ) == NULL ); mifDoc.setCurPara( p ); mifDoc.enterPara( *mifDoc.curPara() ); curDs->paragraphClosedInMif = false; } } void MifFOTBuilder::processDisplaySpaceStack() { pendingBreak = symbolFalse; EffectiveDisplaySpace effectiveDisplaySpace; DisplaySpaceInfo *curDSI; while( !displaySpaceQueue.empty() ) { curDSI = displaySpaceQueue.get(); if( curDSI->breakType == symbolPage || curDSI->breakType == symbolColumn ) { effectiveDisplaySpace.clear(); if( pendingBreak != symbolFalse ) mifDoc.outBreakingPara( curDSI->breakType == symbolPage ? MifDoc::sPageTop : MifDoc::sColumnTop ); pendingBreak = curDSI->breakType; if( !curDSI->breakIsAfter ) effectiveDisplaySpace.combine( createEffectiveDisplaySpace( curDSI->space ) ); } else effectiveDisplaySpace.combine( createEffectiveDisplaySpace( curDSI->space ) ); delete curDSI; } pendingEffectiveDisplaySpace = effectiveDisplaySpace; } void MifFOTBuilder::doStartParagraph ( const ParagraphNIC &nic, bool servesAsWrapper, MifDoc::T_dimension height, bool allowNegativeLeading ) { startDisplay( nic ); DisplayInfo *curDs = displayStack.head(); assert( curDs != NULL ); curDs->isParagraph = true; nextFormat.setPgfWithPrev( curDs->mayViolateKeepBefore ? curDs->keepWithPrevious : ( curDs->firstParaOutputed ? curDs->keepWithinPageInEffect : false ) ); nextFormat.setPgfWithNext( curDs->keepWithNext ); curDs->firstParaOutputed = true; processDisplaySpaceStack(); switch( pendingBreak ) { case symbolPage: nextFormat.setPgfPlacement( MifDoc::sPageTop ); break; case symbolColumn: nextFormat.setPgfPlacement( MifDoc::sColumnTop ); break; default: nextFormat.setPgfPlacement( MifDoc::sAnywhere ); } pendingBreak = symbolFalse; Length lineSpacing; Length extraSpaceBefore = 0; if( servesAsWrapper ) { if( height < 2000 ) { // FrameMaker minimum is 2pt if( allowNegativeLeading ) nextFormat.setPgfLeading( height - 2000 ); else pendingEffectiveDisplaySpace.nominal -= ( pendingEffectiveDisplaySpace.nominal > 2000 ) ? 2000 : pendingEffectiveDisplaySpace.nominal; // try to steal as much as possible from space before height = 2000; } //if( effectiveDisplaySpace.nominal <= 0 ) // extraSpaceBefore = 1; // FrameMaker bug workaround //nextFormat.setFSize( height ); lineSpacing = height; nextFormat.setFColor( MifDoc::sWhite ); nextFormat.setPgfLineSpacing( MifDoc::sFixed ); } else { //nextFormat.setFSize( computeLengthSpec( nextFormat.FotLineSpacingSpec.length ) ); lineSpacing = computeLengthSpec( nextFormat.FotLineSpacingSpec.length ); if( nextFormat.FotMinLeading.hasLength ) // but ignore the actual min-leading value nextFormat.PgfLineSpacing = MifDoc::sProportional; else nextFormat.PgfLineSpacing = MifDoc::sFixed; } nextFormat.setPgfSpBefore( pendingEffectiveDisplaySpace.nominal + extraSpaceBefore ); pendingEffectiveDisplaySpace.clear(); nextFormat.setPgfLIndent( computeLengthSpec( nextFormat.FotStartIndentSpec ) ); nextFormat.setPgfFIndent( computeLengthSpec( nextFormat.FotFirstLineStartIndentSpec ) + nextFormat.PgfLIndent ); nextFormat.setPgfRIndent( computeLengthSpec( nextFormat.FotEndIndentSpec ) ); nextFormat.setPgfPlacementStyle ( nextFormat.FotSpan > 1 ? MifDoc::sStraddle : MifDoc::sNormal ); start(); MifDoc::Para *p = new MifDoc::Para( mifDoc.curTagStream().content().stream().CurTagIndent + 4 ); p->setParagraphFormat( mifDoc.curFormat() ); p->format().updateFrom( format() ); p->format().FSize = mifDoc.curFormat().FSize; p->format().ffSetProperties() &= ~MifDoc::FontFormat::fFSize; if( p->format().FSize != lineSpacing ) p->format().setFSize( lineSpacing ); p->curFormat() = p->format(); // assert( mifDoc.curPara( false ) == NULL ); mifDoc.setCurPara( p ); mifDoc.enterPara( *mifDoc.curPara() ); lastFlowObjectWasWhitespace = false; outPendingInlineStatements(); // mifDoc.curFormat().out( mifDoc.os() ); // mifDoc.beginParaLine(); } void MifFOTBuilder::doEndParagraph ( bool sustainFormatStack, bool sustainDisplayStack, bool paragraphBreakTest, bool discardThisPara ) { // mifDoc.endParaLine(); // MifDoc::Para::outEpilog( mifDoc.os() ); DisplayInfo *curDs = displayStack.head(); assert( curDs != NULL ); if( !sustainFormatStack ) end(); if( !sustainDisplayStack ) endDisplay(); if( paragraphBreakTest && paragraphBreakInEffect ) { paragraphBreakInEffect = false; end(); } if( !curDs->paragraphClosedInMif ) { MifDoc::Para *p = mifDoc.curPara(); mifDoc.exitPara(); if( !discardThisPara ) { p->out( mifDoc.os() ); mifDoc.curFormat().updateFrom( p->format() ); } delete p; } } void MifFOTBuilder::startDisplayGroup( const DisplayGroupNIC &nic ) { startDisplay( nic ); start(); } void MifFOTBuilder::endDisplayGroup() { end(); endDisplay(); } void MifFOTBuilder::startDisplay( const DisplayNIC &nic ) { if( !inSimplePageSequence ) { if( !bookComponentOpened ) { mifDoc.enterBookComponent(); initMifBookComponent(); bookComponentOpened = true; } bookComponentAvailable = false; } displaySpaceQueue.append ( new DisplaySpaceInfo( nic.spaceBefore, nic.breakBefore, false ) ); DisplayInfo *di = displayStack.head(); if( di != NULL && di->isParagraph && !di->paragraphClosedInMif ) { if( mifDoc.curPara()->content().isEmpty() ) { doEndParagraph( true, true, true, true ); } else doEndParagraph( true, true ); di->paragraphClosedInMif = true; } if( curTable().CurCell != NULL ) nextFormat.FotCurDisplaySize = curTable().CurCell->displaySize; else if( nextFormat.FotSpan > 1 ) nextFormat.FotCurDisplaySize = nextFormat.FotPageWidth - nextFormat.FotLeftMargin - nextFormat.FotRightMargin; else nextFormat.FotCurDisplaySize = ( nextFormat.FotPageWidth - nextFormat.FotLeftMargin - nextFormat.FotRightMargin - nextFormat.FotPageColumnSep * ( nextFormat.FotPageNColumns - 1 ) ) / nextFormat.FotPageNColumns; displayStack.insert( new DisplayInfo( nic, displayStack.head() ) ); } void MifFOTBuilder::endDisplay() { DisplayInfo *di = displayStack.get(); displaySpaceQueue.append ( new DisplaySpaceInfo( di->spaceAfter, di->breakAfter, true ) ); delete di; } void MifFOTBuilder::startSimplePageSequenceSerial() { inSimplePageSequence = true; firstHeaderFooter = true; bool openBookComponent = true; if( bookComponentOpened ) { if( bookComponentAvailable ) { openBookComponent = false; bookComponentAvailable = false; } else mifDoc.exitBookComponent(); } if( openBookComponent ) { mifDoc.enterBookComponent(); initMifBookComponent(); bookComponentOpened = true; bookComponentAvailable = false; } nextFormat.FotCurDisplaySize = ( nextFormat.FotPageWidth - nextFormat.FotLeftMargin - nextFormat.FotRightMargin - nextFormat.FotPageColumnSep * ( nextFormat.FotPageNColumns - 1 ) ) / nextFormat.FotPageNColumns; mifDoc.document().setDColumns( nextFormat.FotPageNColumns ); if( nextFormat.FotPageNColumns > 1 ) mifDoc.document().setDColumnGap( nextFormat.FotPageColumnSep ); mifDoc.document().setProperties &= ~MifDoc::Document::fDMargins; start(); FotSimplePageSequence.paragraphFormat = format(); } void MifFOTBuilder::endSimplePageSequenceSerial() { end(); mifDoc.exitTextFlow(); mifDoc.exitBookComponent(); inSimplePageSequence = false; bookComponentOpened = false; bookComponentAvailable = false; } void MifFOTBuilder::makeEmptyTextFlow( MifDoc::TextRect &textRect ) { MifDoc::TextFlow &textFlow = *(new MifDoc::TextFlow( textRect, true )); mifDoc.textFlows().push_back( textFlow ); mifDoc.enterTextFlow( textFlow ); MifDoc::Para::outSimpleProlog( mifDoc.os() ); MifDoc::ParaLine::outProlog( mifDoc.os() ); MifDoc::ParaLine::outEpilog( mifDoc.os() ); MifDoc::Para::outEpilog( mifDoc.os() ); mifDoc.exitTextFlow(); } void MifFOTBuilder::beginHeaderFooter( bool header ) { start(); MifDoc::Para p; p.setPgfTag( header ? MifDoc::sHeader : MifDoc::sFooter ); p.setProperties &= ~MifDoc::Para::fParagraphFormat; p.outProlog( mifDoc.os() ); MifDoc::FontFormat ff; ff.setFSize( format().FSize ); ff.out( mifDoc.os(), MifDoc::FontFormat::fFSize, MifDoc::FontFormat::stFont ); mifDoc.beginParaLine(); } void MifFOTBuilder::endHeaderFooter() { mifDoc.endParaLine(); MifDoc::Para::outEpilog( mifDoc.os() ); end(); } void MifFOTBuilder::setupSimplePageSequence() { MifDoc::Page &firstMasterPage = *(new MifDoc::Page( MifDoc::sOtherMasterPage, MifDoc::sFirst )); MifDoc::Page &rightMasterPage = *(new MifDoc::Page( MifDoc::sRightMasterPage, MifDoc::sRight )); MifDoc::Page &leftMasterPage = *(new MifDoc::Page( MifDoc::sLeftMasterPage, MifDoc::sLeft )); MifDoc::Page &bodyPage = *(new MifDoc::Page( MifDoc::sBodyPage, MifDoc::sNONE, MifDoc::sFirst )); MifDoc::T_LTWH bodyRect; MifDoc::T_LTWH headerRect; MifDoc::T_LTWH footerRect; bodyRect.l = format().FotLeftMargin; bodyRect.t = format().FotTopMargin; bodyRect.w = format().FotPageWidth - format().FotLeftMargin - format().FotRightMargin; bodyRect.h = format().FotPageHeight - format().FotTopMargin - format().FotBottomMargin; headerRect.l = format().FotLeftMargin; headerRect.t = 0; headerRect.w = bodyRect.w; headerRect.h = format().FotTopMargin; footerRect.l = format().FotLeftMargin; footerRect.t = format().FotPageHeight - format().FotBottomMargin; footerRect.w = bodyRect.w; footerRect.h = format().FotBottomMargin; { MifDoc::TextRect &firstBodyTextRect = *(new MifDoc::TextRect( bodyRect, format().FotPageNColumns, format().FotPageColumnSep, format().FotPageBalanceColumns )); MifDoc::TextRect &rightBodyTextRect = *(new MifDoc::TextRect( bodyRect, format().FotPageNColumns, format().FotPageColumnSep, format().FotPageBalanceColumns)); MifDoc::TextRect &leftBodyTextRect = *(new MifDoc::TextRect( bodyRect, format().FotPageNColumns, format().FotPageColumnSep, format().FotPageBalanceColumns )); MifDoc::TextRect &bodyTextRect = *(new MifDoc::TextRect( bodyRect, format().FotPageNColumns, format().FotPageColumnSep, format().FotPageBalanceColumns )); MifDoc::TextRect &firstHeaderTextRect = *(new MifDoc::TextRect( headerRect )); MifDoc::TextRect &rightHeaderTextRect = *(new MifDoc::TextRect( headerRect )); MifDoc::TextRect &leftHeaderTextRect = *(new MifDoc::TextRect( headerRect )); MifDoc::TextRect &firstFooterTextRect = *(new MifDoc::TextRect( footerRect )); MifDoc::TextRect &rightFooterTextRect = *(new MifDoc::TextRect( footerRect )); MifDoc::TextRect &leftFooterTextRect = *(new MifDoc::TextRect( footerRect )); firstMasterPage.TextRects.push_back( firstHeaderTextRect ); firstMasterPage.TextRects.push_back( firstBodyTextRect ); firstMasterPage.TextRects.push_back( firstFooterTextRect ); rightMasterPage.TextRects.push_back( rightHeaderTextRect ); rightMasterPage.TextRects.push_back( rightBodyTextRect ); rightMasterPage.TextRects.push_back( rightFooterTextRect ); leftMasterPage.TextRects.push_back( leftHeaderTextRect ); leftMasterPage.TextRects.push_back( leftBodyTextRect ); leftMasterPage.TextRects.push_back( leftFooterTextRect ); bodyPage.TextRects.push_back( bodyTextRect ); mifDoc.pages().push_back( bodyPage ); mifDoc.pages().push_back( firstMasterPage ); mifDoc.pages().push_back( rightMasterPage ); mifDoc.pages().push_back( leftMasterPage ); MifDoc::ParagraphFormat headerPF; headerPF.setDSSSLDefaults(); MifDoc::ParagraphFormat footerPF; footerPF.setDSSSLDefaults(); setupHeaderFooterParagraphFormat( headerPF, footerPF, bodyRect.w ); FotSimplePageSequence.BodyTextFlow = new MifDoc::TextFlow( bodyTextRect, true, &FotSimplePageSequence.paragraphFormat, MifDoc::sDefaultPgfFormat ); FotSimplePageSequence.FirstHeaderTextFlow = new MifDoc::TextFlow( firstHeaderTextRect, false, &headerPF, MifDoc::sHeader ); FotSimplePageSequence.FirstFooterTextFlow = new MifDoc::TextFlow( firstFooterTextRect, false, &footerPF, MifDoc::sFooter ); FotSimplePageSequence.LeftHeaderTextFlow = new MifDoc::TextFlow( leftHeaderTextRect, false, &headerPF, MifDoc::sHeader ); FotSimplePageSequence.LeftFooterTextFlow = new MifDoc::TextFlow( leftFooterTextRect, false, &footerPF, MifDoc::sFooter ); FotSimplePageSequence.RightHeaderTextFlow = new MifDoc::TextFlow( rightHeaderTextRect, false, &headerPF, MifDoc::sHeader ); FotSimplePageSequence.RightFooterTextFlow = new MifDoc::TextFlow( rightFooterTextRect, false, &footerPF, MifDoc::sFooter ); makeEmptyTextFlow( firstBodyTextRect ); makeEmptyTextFlow( leftBodyTextRect ); makeEmptyTextFlow( rightBodyTextRect ); mifDoc.textFlows().push_back( *FotSimplePageSequence.BodyTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.FirstHeaderTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.FirstFooterTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.LeftHeaderTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.LeftFooterTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.RightHeaderTextFlow ); mifDoc.textFlows().push_back( *FotSimplePageSequence.RightFooterTextFlow ); mifDoc.document().setDTwoSides( true ); mifDoc.document().setDParity( MifDoc::sFirstRight ); } mifDoc.enterTextFlow( *FotSimplePageSequence.BodyTextFlow ); } void MifFOTBuilder::startSimplePageSequenceHeaderFooter( unsigned hfPart ) { if( firstHeaderFooter ) { setupSimplePageSequence(); firstHeaderFooter = false; } MifDoc::TextFlow *curTextFlow; if( hfPart & firstHF ) if( hfPart & frontHF ) if( hfPart & headerHF ) curTextFlow = FotSimplePageSequence.FirstHeaderTextFlow; else curTextFlow = FotSimplePageSequence.FirstFooterTextFlow; else return; else if( hfPart & frontHF ) if( hfPart & headerHF ) curTextFlow = FotSimplePageSequence.RightHeaderTextFlow; else curTextFlow = FotSimplePageSequence.RightFooterTextFlow; else if( hfPart & headerHF ) curTextFlow = FotSimplePageSequence.LeftHeaderTextFlow; else curTextFlow = FotSimplePageSequence.LeftFooterTextFlow; mifDoc.enterTextFlow( *curTextFlow ); if( hfPart & (centerHF | rightHF) ) mifDoc.outSpecialChar( MifDoc::sTab ); else // leftHF (hfPart & headerHF) ? beginHeader() : beginFooter(); } void MifFOTBuilder::endSimplePageSequenceHeaderFooter( unsigned hfPart ) { if( hfPart & rightHF && (hfPart & frontHF || !(hfPart & firstHF)) ) { endHeaderFooter(); } if( !(hfPart & firstHF) || hfPart & frontHF ) mifDoc.exitTextFlow(); } void MifFOTBuilder::setupHeaderFooterParagraphFormat ( MifDoc::ParagraphFormat &hpf, MifDoc::ParagraphFormat &fpf, MifDoc::T_dimension textRectWidth ) { MifDoc::TabStop centerTS( MifDoc::sCenter, textRectWidth / 2 ); MifDoc::TabStop rightTS( MifDoc::sRight, textRectWidth ); hpf.setFrom( FotSimplePageSequence.paragraphFormat, 0, MifDoc::FontFormat::fAll ); hpf.TabStops.push_back( centerTS ); hpf.TabStops.push_back( rightTS ); hpf.setProperties |= MifDoc::ParagraphFormat::fTabStops; fpf = hpf; hpf.setFSize( ( ( format().FotBottomMargin - format().FotFooterMargin ) * 3 ) / 2 ); fpf.setFSize( ( format().FotHeaderMargin * 3 ) / 2 ); hpf.setPgfTag( MifDoc::sHeader ); fpf.setPgfTag( MifDoc::sFooter ); mifDoc.pgfCatalog().ParaFormats.push_back( hpf ); mifDoc.pgfCatalog().ParaFormats.push_back( fpf ); hpf.clearSetProperties(); fpf.clearSetProperties(); } void MifFOTBuilder::endAllSimplePageSequenceHeaderFooter() { // mifDoc.enterTextFlow( *FotSimplePageSequence.BodyTextFlow ); } inline void MifFOTBuilder::pageNumber() { mifDoc.outPageNumber(); } // --------- MifFOTBuilder::Table --------------------------------------------- void MifFOTBuilder::Table::resolveBorders ( Vector &rows, bool hasFirstTableRow, bool hasLastTableRow ) { bool isFirstRow; bool isLastRow; bool isFirstColumn; bool isLastColumn; Cell *cell = NULL; size_t r, c, rr, cc; bool leftEdge, topEdge; for( r = 0; r < rows.size(); r++ ) { for( c = 0; c < rows[r].Cells.size()-1; c++ ) { cell = &rows[r].Cells[c]; if( cell->OverlappingCell == NULL ) { for( rr = r; rr < r + cell->nRowsSpanned; rr++ ) { for( cc = c, leftEdge = true; cc < c + cell->nColumnsSpanned; cc++ ) { rows[rr].Cells[cc].OverlappingCell = cell; } } } } } for( r = 0; r < rows.size(); r++ ) { for( c = 0; c < rows[r].Cells.size() - 1; c++ ) { cell = &rows[r].Cells[c]; if( cell->OverlappingCell == cell ) { for( rr = r, topEdge = true; rr < r + cell->nRowsSpanned; rr++ ) { isFirstRow = ( rr == 0 ) ? true : false; isLastRow = ( rr == rows.size() - 1 ) ? true : false; for( cc = c, leftEdge = true; cc < c + cell->nColumnsSpanned; cc++ ) { isFirstColumn = ( cc == 0 ) ? true : false; isLastColumn = ( cc == rows[rr].Cells.size() - 2 ) ? true : false; if( leftEdge ) if( isFirstColumn ) { cell->beforeColumnBorder.resolve( beforeColumnBorder ); } else cell->beforeColumnBorder.resolve ( rows[rr].Cells[cc-1].OverlappingCell->afterColumnBorder ); if( topEdge ) if( isFirstRow && hasFirstTableRow ) cell->beforeRowBorder.resolve( beforeRowBorder ); else if( !isFirstRow ) cell->beforeRowBorder.resolve ( rows[rr-1].Cells[cc].OverlappingCell->afterRowBorder ); if( isLastColumn ) cell->afterColumnBorder.resolve( afterColumnBorder ); if( isLastRow && hasLastTableRow ) cell->afterRowBorder.resolve( afterRowBorder ); leftEdge = false; } topEdge = false; } } } } } void MifFOTBuilder::Table::begin( MifDoc &mifDoc ) { CurCell = NULL; NoTablePartsSeen = true; TableParts.resize( 0 ); TableParts.resize( 1 ); TableParts.back().begin( *this, mifDoc ); } // --------- MifFOTBuilder::TablePart ----------------------------------------- void MifFOTBuilder::TablePart::begin( Table &parent, MifDoc &mifDoc ) { Columns.resize( 0 ); Header.resize( 0 ); Body.resize( 0 ); Footer.resize( 0 ); columnsProcessed = false; needsColumnReprocessing = false; ParentTable = &parent; parentTable().CurRows = &Body; parentTable().CurTablePart = this; if( MifTableNum == 0 ) { mifDoc.tbls().resize( mifDoc.tbls().size() + 1 ); MifTableNum = mifDoc.tbls().size(); MifDoc::CurInstance->setCurTblNum( MifTableNum ); } } void MifFOTBuilder::TablePart::translate( MifDoc &mifDoc ) { if( needsColumnReprocessing ) processColumns(); MifDoc::Tbl &mifTbl = mifTable( mifDoc ); if( parentTable().startIndent != 0 ) { // DSSSL default mifTbl.tblFormat.setTblLIndent( parentTable().startIndent ); mifTbl.setProperties |= MifDoc::Tbl::fTblFormat; } if( parentTable().displayAlignment != symbolStart ) { mifTbl.setProperties |= MifDoc::Tbl::fTblFormat; MifDoc::T_keyword mifAlignment = MifDoc::sLeft; switch( parentTable().displayAlignment ) { case symbolStart: mifAlignment = MifDoc::sLeft; break; case symbolEnd: mifAlignment = MifDoc::sRight; break; case symbolCenter: mifAlignment = MifDoc::sCenter; break; case symbolInside: mifAlignment = MifDoc::sInside; break; case symbolOutside: mifAlignment = MifDoc::sOutside; break; default: assert( false ); } mifTbl.tblFormat.setTblAlignment( mifAlignment ); } bool putHeaderInBody = Body.size() == 0 && Header.size() > 0; bool putFooterInBody = !putHeaderInBody && Body.size() == 0 && Footer.size() > 0; for( size_t i = 0; i < Header.size(); i++ ) Header[i].translate( putHeaderInBody ? mifTbl.TblBody : mifTbl.TblH, mifDoc ); for( size_t i = 0; i < Body.size(); i++) Body[i].translate( mifTbl.TblBody, mifDoc ); for( size_t i = 0; i < Footer.size(); i++ ) Footer[i].translate( putFooterInBody ? mifTbl.TblBody : mifTbl.TblF, mifDoc ); } void MifFOTBuilder::TablePart::processColumns() { MifDoc::Tbl &mifTbl = mifTable( *MifDoc::CurInstance ); mifTbl.setTblNumColumns( 0 ); mifTbl.setTblNumColumns( Columns.size() ); mifTbl.TblColumnWidths.resize( 0 ); mifTbl.TblColumnWidths.resize( Columns.size() ); mifTbl.TblColumnWidthsAreSet(); long totalNonproportionalWidth = 0L; double totalProportionalUnits = 0.0; for( size_t i = 0; i < Columns.size(); i++ ) { if( Columns[i].hasWidth ) { if( Columns[i].width.tableUnitFactor ) { totalProportionalUnits += Columns[i].width.tableUnitFactor; } else { mifTbl.TblColumnWidths[i] = MifFOTBuilder::curInstance().computeLengthSpec( Columns[i].width ); totalNonproportionalWidth += mifTbl.TblColumnWidths[i]; } } } double proportionalUnit = 0.0; if( totalProportionalUnits ) proportionalUnit = ( parentTable().tableWidth - totalNonproportionalWidth ) / totalProportionalUnits; for( size_t i = 0; i < Columns.size(); i++ ) { if( Columns[i].hasWidth ) { if( Columns[i].width.tableUnitFactor ) mifTbl.TblColumnWidths[i] = long(proportionalUnit * Columns[i].width.tableUnitFactor); } else mifTbl.TblColumnWidths[i] = long(proportionalUnit); } columnsProcessed = true; } void MifFOTBuilder::TablePart::normalizeRows() { size_t maxCellsInRow = Columns.size()+1; Vector *rows; for( int step = 0; step < 2; step++ ) { for( int rowType = 0; rowType < 3; rowType++ ) { switch( rowType ) { case 0: rows = &Header; break; case 1: rows = &Body; break; default: rows = &Footer; } for( size_t r = 0; r < rows->size(); r++ ) { if( step == 0 ) { if( (*rows)[r].Cells.size() > 1 ) { size_t lastCellIdx = (*rows)[r].Cells.size()-2; Cell &lastCell = (*rows)[r].Cells[lastCellIdx]; if( !lastCell.missing && lastCellIdx+lastCell.nColumnsSpanned+1 > maxCellsInRow ) maxCellsInRow = lastCellIdx+lastCell.nColumnsSpanned+1; } } else if( (*rows)[r].Cells.size() < maxCellsInRow ) (*rows)[r].Cells.resize( maxCellsInRow ); } } } } // --------- MifFOTBuilder::Row ----------------------------------------------- void MifFOTBuilder::Row::translate( Vector &mifRows, MifDoc &mifDoc ) { mifRows.resize( mifRows.size() + 1 ); MifDoc::Row &mifRow = mifRows.back(); mifRow.Cells.resize( Cells.size() - 1 ); for( size_t i = 0; i + 1 < Cells.size(); i++ ) { Cells[i].translate( Cells[i].mifCell(), mifDoc ); mifRow.Cells[i] = Cells[i].mifCell(); } } // --------- MifFOTBuilder::Cell ---------------------------------------------- void MifFOTBuilder::Cell::translate( MifDoc::Cell &mifCell, MifDoc &mifDoc ) { MifDoc::T_tagstring rulingTag; rulingTag = beforeRowBorder.makeMifRuling( mifDoc ); if( rulingTag.size() ) mifCell.setCellTRuling( rulingTag ); rulingTag = afterRowBorder.makeMifRuling( mifDoc ); if( rulingTag.size() ) mifCell.setCellBRuling( rulingTag ); rulingTag = beforeColumnBorder.makeMifRuling( mifDoc ); if( rulingTag.size() ) mifCell.setCellLRuling( rulingTag ); rulingTag = afterColumnBorder.makeMifRuling( mifDoc ); if( rulingTag.size() ) mifCell.setCellRRuling( rulingTag ); } // --------- MifFOTBuilder::Border -------------------------------------------- void MifFOTBuilder::Border::setFromFot() { MifFOTBuilder::Format &f = MifFOTBuilder::curInstance().format(); borderPriority = f.FotBorderPriority; borderPresent = f.FotBorderPresent; lineThickness = f.FotLineThickness; lineRepeat = f.FotLineRepeat; lineSep = f.FotLineSep; color = f.FColor; } MifDoc::T_tagstring MifFOTBuilder::Border::makeMifRuling( MifDoc &mifDoc ) { MifDoc::T_tagstring result; if( borderPresent ) { MifDoc::Ruling *mifRuling = new MifDoc::Ruling; mifRuling->setRulingPenWidth( lineThickness ); mifRuling->setRulingLines( lineRepeat >= 2 ? 2 : lineRepeat ); mifRuling->setRulingGap( lineRepeat >= 2 ? lineSep - lineThickness : 0 ); mifRuling->setRulingColor( color ); result = MifDoc::T_tagstring( mifRuling->key( *mifRuling ) ); mifRuling->setRulingTag( result ); if( mifDoc.rulingCatalog().Rulings.lookup( result ) == NULL ) { mifDoc.rulingCatalog().Rulings.insert( mifRuling ); } else delete mifRuling; } return result; } void MifFOTBuilder::Border::resolve( Border &adjacentBorder ) { if( adjacentBorder.borderPriority > borderPriority || ( adjacentBorder.borderPriority == borderPriority && !adjacentBorder.cellBorder && adjacentBorder.borderPresent ) ) { lineThickness = adjacentBorder.lineThickness; borderPresent = adjacentBorder.borderPresent; lineRepeat = adjacentBorder.lineRepeat; lineSep = adjacentBorder.lineSep; color = adjacentBorder.color; if( adjacentBorder.cellBorder ) adjacentBorder.borderPresent = false; } } //----------------------------------------------------------------------------- void MifFOTBuilder::setFontSize( long n ) { nextFormat.FSize = n; } void MifFOTBuilder::setLineSpacing( const LengthSpec &l ) { nextFormat.FotLineSpacingSpec = l; } void MifFOTBuilder::setFontWeight( Symbol weight ) { if( weight > symbolMedium ) { nextFormat.FWeight = MifDoc::sBold; } else { nextFormat.FWeight = MifDoc::sRegular; } } void MifFOTBuilder::setFontPosture( Symbol posture ) { switch( posture ) { case symbolOblique: case symbolBackSlantedOblique: case symbolItalic: case symbolBackSlantedItalic: nextFormat.FAngle = MifDoc::sItalic; break; default: nextFormat.FAngle = MifDoc::sRegular; } } inline void MifFOTBuilder::setStartIndent( const LengthSpec &l ) { nextFormat.FotStartIndentSpec = l; } inline void MifFOTBuilder::setEndIndent( const LengthSpec &l ) { nextFormat.FotEndIndentSpec = l; } inline void MifFOTBuilder::setFirstLineStartIndent( const LengthSpec &l ) { nextFormat.FotFirstLineStartIndentSpec = l; } void MifFOTBuilder::setQuadding( Symbol quadding ) { switch( quadding ) { case symbolEnd: nextFormat.PgfAlignment = MifDoc::sRight; break; case symbolCenter: nextFormat.PgfAlignment = MifDoc::sCenter; break; case symbolJustify: nextFormat.PgfAlignment = MifDoc::sLeftRight; break; default: // symbolStart nextFormat.PgfAlignment = MifDoc::sLeft; } } inline void MifFOTBuilder::setKern( bool kern ) { nextFormat.FPairKern = kern; } inline void MifFOTBuilder::setLanguage( Letter2 code ) { nextFormat.FotLanguage = code; nextFormat.computePgfLanguage(); } inline void MifFOTBuilder::setCountry( Letter2 code ) { nextFormat.FotCountry = code; nextFormat.computePgfLanguage(); } inline void MifFOTBuilder::setHyphenate( bool hyphenate ) { nextFormat.PgfHyphenate = hyphenate; } inline void MifFOTBuilder::setHyphenationRemainCharCount( long n ) { nextFormat.HyphenMinPrefix = n; } inline void MifFOTBuilder::setHyphenationPushCharCount( long n ) { nextFormat.HyphenMinSuffix = n; } inline void MifFOTBuilder::setHyphenationLadderCount( long n ) { nextFormat.HyphenMaxLines = n; } void MifFOTBuilder::setFontFamilyName( const StringC &s ) { nextFormat.FFamily.resize( 0 ); for( size_t i = 0; i < s.size(); i++ ) nextFormat.FFamily += char(s[i]); } inline void MifFOTBuilder::setWidowCount( long n ) { nextFormat.PgfBlockSize = n; } inline void MifFOTBuilder::setOrphanCount( long n ) { nextFormat.PgfBlockSize = n; } inline void MifFOTBuilder::setPageWidth( Length pWidth ) { nextFormat.FotPageWidth = pWidth; } inline void MifFOTBuilder::setPageHeight( Length pHeight ) { nextFormat.FotPageHeight = pHeight; } inline void MifFOTBuilder::setLeftMargin( Length leftM ) { nextFormat.FotLeftMargin = leftM; } inline void MifFOTBuilder::setRightMargin( Length rightM ) { nextFormat.FotRightMargin = rightM; } inline void MifFOTBuilder::setTopMargin( Length topM ) { nextFormat.FotTopMargin = topM; } inline void MifFOTBuilder::setBottomMargin( Length bottomM ) { nextFormat.FotBottomMargin = bottomM; } void MifFOTBuilder::setHeaderMargin( Length headerM ) { nextFormat.FotHeaderMargin = headerM; } void MifFOTBuilder::setFooterMargin( Length footerM ) { nextFormat.FotFooterMargin = footerM; } void MifFOTBuilder::setDisplayAlignment( Symbol alignment ) { nextFormat.FotDisplayAlignment = alignment; } //--------- LEADERS ----------------------------------------------------------- void MifFOTBuilder::startLeader( const LeaderNIC & ) { checkForParagraphReopening(); lastFlowObjectWasWhitespace = false; mifDoc.outSpecialChar( MifDoc::sTab ); inLeader = true; setCurLeaderStream( new MifTmpOutputByteStream() ); } void MifFOTBuilder::endLeader() { if( !mifDoc.curPara()->leaderTabsSet ) { String leaderStr; curLeaderStream().commit( leaderStr ); int numTabs = mifDoc.curFormat().PgfNumTabs + 1; mifDoc.curFormat().setPgfNumTabs( numTabs ); mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sRight, format().FotCurDisplaySize - mifDoc.curFormat().PgfRIndent - 1, MifDoc::T_string( leaderStr ) ) ); mifDoc.curPara()->format().setPgfNumTabs( numTabs ); mifDoc.curPara()->curFormat().setPgfNumTabs( numTabs ); mifDoc.curPara()->format().setProperties |= MifDoc::ParagraphFormat::fTabStops; mifDoc.curPara()->leaderTabsSet = true; } if( CurLeaderStream ) { delete CurLeaderStream; CurLeaderStream = NULL; } inLeader = false; lastFlowObjectWasWhitespace = false; } //--------- LINE FIELDS ------------------------------------------------------- void MifFOTBuilder::startLineField( const LineFieldNIC & ) { checkForParagraphReopening(); lastFlowObjectWasWhitespace = false; Length fieldWidth = computeLengthSpec( nextFormat.FotFieldWidth ); Length firstLineIndent = mifDoc.curPara()->format().PgfFIndent; bool leadingTab = true; switch( nextFormat.FotFieldAlign ) { case symbolStart: default: mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sLeft, firstLineIndent + fieldWidth ) ); leadingTab = false; break; case symbolEnd: mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sRight, firstLineIndent + fieldWidth ) ); mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sLeft, firstLineIndent + fieldWidth + 1 ) ); break; case symbolCenter: mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sCenter, firstLineIndent + fieldWidth / 2 ) ); mifDoc.curPara()->format().TabStops.push_back ( MifDoc::TabStop( MifDoc::sLeft, firstLineIndent + fieldWidth + 1 ) ); } int numTabs = mifDoc.curFormat().PgfNumTabs + leadingTab ? 2 : 1; mifDoc.curFormat().setPgfNumTabs( numTabs ); mifDoc.curPara()->format().setPgfNumTabs( numTabs ); mifDoc.curPara()->curFormat().setPgfNumTabs( numTabs ); mifDoc.curPara()->format().setProperties |= MifDoc::ParagraphFormat::fTabStops; start(); if( leadingTab ) mifDoc.outSpecialChar( MifDoc::sTab ); } void MifFOTBuilder::endLineField() { mifDoc.outSpecialChar( MifDoc::sTab ); end(); lastFlowObjectWasWhitespace = false; } //--------- PARAGRAPH BREAKS -------------------------------------------------- void MifFOTBuilder::paragraphBreak( const ParagraphNIC &nic ) { if( MifDoc::Para::currentlyOpened ) { if( paragraphBreakInEffect ) doEndParagraph( false, false, false ); else { doEndParagraph( true, false, false ); paragraphBreakInEffect = true; } doStartParagraph( nic ); } } //--------- SCORES ------------------------------------------------------------ void MifFOTBuilder::startScore( Symbol scoreType ) { checkForParagraphReopening(); switch( scoreType ) { case symbolBefore: nextFormat.setFOverline( true ); break; case symbolThrough: nextFormat.setFStrike( true ); break; case symbolAfter: default: nextFormat.setFUnderlining ( nextFormat.FotLineRepeat > 1 ? MifDoc::sFDouble : MifDoc::sFSingle ); break; } start(); } void MifFOTBuilder::endScore() { end(); } //--------- ANCHORED FRAMES (GENERAL) ----------------------------------------- MifDoc::Frame &MifFOTBuilder::makeAnchoredFrame ( MifDoc::T_keyword frameType, long width, long height, MifDoc::T_keyword anchorAlign ) { mifDoc.aFrames().resize( mifDoc.aFrames().size() + 1 ); MifDoc::Frame &frame = mifDoc.aFrames().back(); frame.setFrameType( frameType ); frame.setAnchorAlign( anchorAlign ); frame.setShapeRect( MifDoc::T_LTWH( 0, 0, width, height ) ); return frame; } //--------- EXTERNAL GRAPHICS ------------------------------------------------- void MifFOTBuilder::externalGraphic( const ExternalGraphicNIC &nic ) { bool isInline = MifDoc::Para::currentlyOpened ? true : false; if( !isInline ) startDisplay( nic ); start(); MifDoc::T_pathname mifPathname; if( systemIdToMifPathname( nic.entitySystemId, mifPathname ) ) { MifDoc::T_keyword mifAlignment = MifDoc::sLeft; switch( format().FotDisplayAlignment ) { case symbolStart: mifAlignment = MifDoc::sLeft; break; case symbolEnd: mifAlignment = MifDoc::sRight; break; case symbolCenter: mifAlignment = MifDoc::sCenter; break; case symbolInside: mifAlignment = MifDoc::sInside; break; case symbolOutside: mifAlignment = MifDoc::sOutside; break; default: assert( false ); } MifDoc::Frame &frame = makeAnchoredFrame( isInline ? MifDoc::sInline : MifDoc::sBelow, nic.hasMaxWidth ? computeLengthSpec( nic.maxWidth ) : 72000, nic.hasMaxHeight ? computeLengthSpec( nic.maxHeight ) : 72000, mifAlignment ); MifDoc::ImportObject *importObject = new MifDoc::ImportObject( mifPathname, frame.ShapeRect ); frame.Objects.resize( frame.Objects.size() + 1 ); frame.Objects.back() = importObject; if( !isInline ) doStartParagraph( nic, true, 0, false ); else checkForParagraphReopening(); mifDoc.outAFrame( frame.ID, mifDoc.os() ); if( !isInline ) endParagraph(); else lastFlowObjectWasWhitespace = false; } end(); if( !isInline ) endDisplay(); } enum TComponent { cName, cUp, cRoot, cRootDrive }; void addComponent( MifDoc::T_pathname &target, TComponent cType, StringC &component ) { target += '<'; target += cType == cName ? 'c' : ( cType == cUp ? 'u' : 'r' ); target += '\\'; target += '>'; if( cType == cName || cType == cRootDrive ) for( size_t i = 0; i < component.size(); i++ ) target += char( component[i] ); } bool MifFOTBuilder::systemIdToMifPathname ( const StringC &systemId, MifDoc::T_pathname &mifPathname ) { StringC filename; StringC component; int result; if( ( result = systemIdFilename( systemId, filename ) ) < 0 ) { App->message( MifMessages::systemIdNotFilename, StringMessageArg( systemId ) ); return false; } else { bool firstComponent = true; size_t i = 0; do { component.resize( 0 ); while( i < filename.size() && filename[i] != '\\' && filename[i] != '/' ) component += char( filename[i++] ); switch( component.size() ) { case 2: if( firstComponent && component[1] == ':' ) addComponent( mifPathname, cRootDrive, component ); else if( component[0] == '.' && component[1] == '.' ) addComponent( mifPathname, cUp, component ); else goto add_component; break; case 1: if( component[0] != '.' ) goto add_component; break; case 0: if( firstComponent && filename.size() > 0 ) addComponent( mifPathname, cRoot, component ); break; add_component: default: addComponent( mifPathname, cName, component ); } firstComponent = false; i++; } while( i < filename.size() ); } return result == 0 ? false : true; } // System Id Resolution from James Clark // Return -1 if an error should be generated // FIXME in some cases should copy the entity into a file in the same // directory as the output file. int MifFOTBuilder::systemIdFilename(const StringC &systemId, StringC &filename) { if (systemId.size() == 0) return -1; Owner in(EntityManager->open(systemId, *SystemCharset, InputSourceOrigin::make(), 0, *App)); if (!in) return 0; Xchar c = in->get(*App); StorageObjectLocation soLoc; ParsedSystemId parsedBuf; if (c == InputSource::eE && in->accessError()) { if (!EntityManager->parseSystemId(systemId, *SystemCharset, 0, 0, *App, parsedBuf)) return 0; if (parsedBuf.size() != 1 || parsedBuf[0].baseId.size()) return 0; soLoc.storageObjectSpec = &parsedBuf[0]; soLoc.actualStorageId = parsedBuf[0].specId; } else { const Location &loc = in->currentLocation(); if (loc.origin().isNull()) return -1; const InputSourceOrigin *tem = loc.origin()->asInputSourceOrigin(); if (!tem) return -1; const ParsedSystemId *psi = ExtendEntityManager::externalInfoParsedSystemId(tem->externalInfo()); if (!psi || psi->size() != 1) return -1; if (!ExtendEntityManager::externalize(tem->externalInfo(), 0, soLoc)) return -1; } if (strcmp(soLoc.storageObjectSpec->storageManager->type(), "OSFILE") != 0) return -1; filename = soLoc.actualStorageId; return 1; } //--------- RULES ------------------------------------------------------------- void MifFOTBuilder::rule( const RuleNIC &nic ) { bool isInline = ( nic.orientation == symbolHorizontal || nic.orientation == symbolVertical ) ? false : true; if( isInline ) checkForParagraphReopening(); if( !isInline ) startDisplay( nic ); start(); long indentlessDisplaySize = format().FotCurDisplaySize - computeLengthSpec( format().FotStartIndentSpec ) - computeLengthSpec( format().FotEndIndentSpec ); MifDoc::T_dimension ruleHeight = format().FotLineThickness + format().FotLineSep * ( format().FotLineRepeat - 1 ); if( ruleHeight < 0 ) ruleHeight = 0; MifDoc::T_dimension ruleLength; MifDoc::T_dimension ruleOffset; if( nic.hasLength && ( ruleLength = computeLengthSpec( nic.length ) ) > 0 ) { switch( format().FotDisplayAlignment ) { case symbolStart: default: ruleOffset = 0; break; case symbolCenter: ruleOffset = ( indentlessDisplaySize - ruleLength ) / 2; break; case symbolEnd: ruleOffset = indentlessDisplaySize - ruleLength; } } else { ruleOffset = 0; ruleLength = indentlessDisplaySize; } MifDoc::Frame &frame = makeAnchoredFrame( MifDoc::sInline, isInline ? long(ruleLength) : indentlessDisplaySize, ruleHeight ); if( isInline ) frame.setBLOffset( computeLengthSpec( format().FotPositionPointShiftSpec ) ); else frame.setBLOffset( -ruleHeight / 2 + 4000 / 3 ); // min font baseline correction MifDoc::T_keyword capType; switch( format().FotLineCap ) { case symbolButt: default: capType = MifDoc::sButt; break; case symbolRound: capType = MifDoc::sRound; break; case symbolSquare: capType = MifDoc::sSquare; } MifDoc::PolyLine *polyLine; Length curLineVOffset = format().FotLineThickness / 2; for( long i = format().FotLineRepeat; i > 0; i--, curLineVOffset += format().FotLineSep ) { polyLine = new MifDoc::PolyLine( capType, 0, 0, format().FotLineThickness, format().FColor ); frame.Objects.resize( frame.Objects.size() + 1 ); frame.Objects.back() = polyLine; polyLine->setHeadCap( capType ); polyLine->setTailCap( capType ); polyLine->Points.resize( polyLine->Points.size() + 1 ); polyLine->Points.back() = MifDoc::T_XY( ruleOffset, curLineVOffset ); polyLine->Points.resize( polyLine->Points.size() + 1 ); polyLine->Points.back() = MifDoc::T_XY( ruleOffset + ruleLength, curLineVOffset ); } if( !isInline ) doStartParagraph( nic, true, 0, true ); mifDoc.outAFrame( frame.ID, mifDoc.os() ); if( !isInline ) endParagraph(); else lastFlowObjectWasWhitespace = false; end(); if( !isInline ) endDisplay(); } //--------- TABLES ------------------------------------------------------------ void MifFOTBuilder::startTable( const TableNIC &nic ) { startDisplay( nic ); start(); if( !curTable().DefaultTblFormatGenerated ) { MifDoc::TblFormat defaultTblFormat( MifDoc::sDefaultTblFormat ); defaultTblFormat.setDSSSLDefaults(); mifDoc.tblCatalog().TblFormats.push_back( defaultTblFormat ); curTable().DefaultTblFormatGenerated = true; } Length curStartIndent = computeLengthSpec( format().FotStartIndentSpec ); curTable().startIndent = curStartIndent; curTable().begin( mifDoc ); // curTable().nic = nic; curTable().displayAlignment = format().FotDisplayAlignment; if( nic.widthType == TableNIC::widthExplicit ) curTable().tableWidth = computeLengthSpec( nic.width ); else curTable().tableWidth = format().FotCurDisplaySize - curStartIndent - computeLengthSpec( format().FotEndIndentSpec ); doStartParagraph( nic, true, 0 ); endParagraph(); } void MifFOTBuilder::endTable() { bool firstPart, lastPart, hasHeader, hasFooter; for( size_t i = 0; i < curTable().TableParts.size(); i++ ) { firstPart = ( i == 0 ) ? true : false; lastPart = ( i == curTable().TableParts.size() - 1 ) ? true : false; TablePart &tablePart = curTable().TableParts[i]; tablePart.normalizeRows(); hasHeader = tablePart.Header.size() > 0 ? true : false; hasFooter = tablePart.Footer.size() > 0 ? true : false; if( hasHeader ) curTable().resolveBorders( tablePart.Header, firstPart ? true : false, false ); curTable().resolveBorders( tablePart.Body, hasHeader ? false : true, hasFooter ? false : true ); if( hasFooter ) curTable().resolveBorders( tablePart.Footer, false, lastPart ? true : false ); tablePart.translate( mifDoc ); } MifDoc::CurInstance->setCurTblNum( 0 ); endDisplay(); end(); } void MifFOTBuilder::tableColumn( const TableColumnNIC &nic ) { if( nic.columnIndex >= curTable().curTablePart().Columns.size() ) curTable().curTablePart().Columns.resize( nic.columnIndex + 1 ); curTable().curTablePart().Columns[nic.columnIndex].hasWidth = nic.hasWidth; if( nic.hasWidth ) { curTable().curTablePart().Columns[nic.columnIndex].width = nic.width; } } void MifFOTBuilder::startTableRow() { curTable().curRows().resize( curTable().curRows().size() + 1 ); } void MifFOTBuilder::endTableRow() { } void MifFOTBuilder::startTableCell( const TableCellNIC &nic ) { start(); TablePart &tp = curTable().curTablePart(); if( !tp.columnsProcessed ) tp.processColumns(); Vector &Cells = curTable().curRows().back().Cells; if( nic.columnIndex >= Cells.size() ) Cells.resize( nic.columnIndex + 1 ); Cell &cell = Cells[nic.columnIndex]; curTable().CurCell = &cell; cell.missing = nic.missing; if( nic.nColumnsSpanned != 1 ) { cell.nColumnsSpanned = nic.nColumnsSpanned; cell.mifCell().setCellColumns( nic.nColumnsSpanned ); } if( nic.nRowsSpanned != 1 ) { cell.nRowsSpanned = nic.nRowsSpanned; cell.mifCell().setCellRows( nic.nRowsSpanned ); } if( format().FotCellBackground && format().MifBackgroundColor.size() > 0 ) { cell.mifCell().setCellFill( 0 ); cell.mifCell().setCellColor( format().MifBackgroundColor ); } long newDisplaySize = 0; for( size_t i = nic.columnIndex; i < nic.columnIndex + nic.nColumnsSpanned; i++ ) if( i < tp.Columns.size() ) { if( tp.Columns[i].hasWidth ) newDisplaySize += computeLengthSpec( tp.Columns[i].width ); } else if( !nic.missing ) { App->message( MifMessages::missingTableColumnFlowObject ); // NOTE: at this point there's already a danger of not realizing // right display space sizes inside cells tp.Columns.resize( tp.Columns.size() + 1 ); tp.Columns.back().hasWidth = true; TableLengthSpec tls; tls.tableUnitFactor = 1.0; tp.Columns.back().width = tls; tp.needsColumnReprocessing = true; if( (MifDoc::T_integer)i > tp.mifTable( mifDoc ).TblNumColumns ) tp.mifTable( mifDoc ).setTblNumColumns( i ); } newDisplaySize -= format().PgfCellMargins.l + format().PgfCellMargins.r; if( newDisplaySize > 0 ) format().FotCurDisplaySize = newDisplaySize; cell.displaySize = format().FotCurDisplaySize; mifDoc.enterTableCell( cell.mifCell() ); } void MifFOTBuilder::endTableCell() { mifDoc.exitTableCell(); end(); curTable().CurCell = NULL; } void MifFOTBuilder::startTablePartSerial( const TablePartNIC &nic ) { startDisplay( nic ); start(); if( curTable().NoTablePartsSeen ) curTable().NoTablePartsSeen = false; else curTable().TableParts.resize( curTable().TableParts.size() + 1 ); curTable().TableParts.back().begin( curTable(), mifDoc ); doStartParagraph( nic, true, 0 ); endParagraph(); } void MifFOTBuilder::endTablePartSerial() { curTable().CurTablePart = NULL; endDisplay(); end(); } void MifFOTBuilder::startTablePartHeader() { curTable().CurRows = &curTable().curTablePart().Header; } void MifFOTBuilder::endTablePartHeader() { curTable().CurRows = &curTable().curTablePart().Body; } void MifFOTBuilder::startTablePartFooter() { curTable().CurRows = &curTable().curTablePart().Footer; } void MifFOTBuilder::endTablePartFooter() { curTable().CurRows = &curTable().curTablePart().Body; } void MifFOTBuilder::setCellBeforeRowMargin( Length l ) { nextFormat.PgfCellMargins.t = l; } void MifFOTBuilder::setCellAfterRowMargin( Length l ) { nextFormat.PgfCellMargins.b = l; } void MifFOTBuilder::setCellBeforeColumnMargin( Length l ) { nextFormat.PgfCellMargins.l = l; } void MifFOTBuilder::setCellAfterColumnMargin( Length l ) { nextFormat.PgfCellMargins.r = l; } void MifFOTBuilder::setCellRowAlignment( Symbol alignment ) { switch( alignment ) { case symbolEnd: nextFormat.PgfCellAlignment = MifDoc::sBottom; break; case symbolCenter: nextFormat.PgfCellAlignment = MifDoc::sMiddle; break; default: nextFormat.PgfCellAlignment = MifDoc::sTop; break; } } //--------- TABLE BORDERS ----------------------------------------------------- void MifFOTBuilder::setBorderPresent( bool b ) { nextFormat.FotBorderPresent = b; } void MifFOTBuilder::setBorderPriority( long p ) { nextFormat.FotBorderPriority = p; } void MifFOTBuilder::setBorderOmitAtBreak(bool) { } void MifFOTBuilder::tableBeforeRowBorder() { start(); curTable().beforeRowBorder.setFromFot(); end(); } void MifFOTBuilder::tableAfterRowBorder() { start(); curTable().afterRowBorder.setFromFot(); end(); } void MifFOTBuilder::tableBeforeColumnBorder() { start(); curTable().beforeColumnBorder.setFromFot(); end(); } void MifFOTBuilder::tableAfterColumnBorder() { start(); curTable().afterColumnBorder.setFromFot(); end(); } void MifFOTBuilder::tableCellBeforeRowBorder() { start(); curTable().curCell().beforeRowBorder.setFromFot(); end(); } void MifFOTBuilder::tableCellAfterRowBorder() { start(); curTable().curCell().afterRowBorder.setFromFot(); end(); } void MifFOTBuilder::tableCellBeforeColumnBorder() { start(); curTable().curCell().beforeColumnBorder.setFromFot(); end(); } void MifFOTBuilder::tableCellAfterColumnBorder() { start(); curTable().curCell().afterColumnBorder.setFromFot(); end(); } //--------- CROSS-REFERENCES, LINKS, AND INDEX-ENTRIES ------------------------ void MifFOTBuilder::outPendingInlineStatements() { if( linkStack.size() > 1 && linkStack[linkStack.size()-2].openedInMif && !linkStack[linkStack.size()-2].forcesNoLink() ) { LinkInfo::pendingMifClosings++; linkStack[linkStack.size()-2].openedInMif = false; } for( ; LinkInfo::pendingMifClosings > 0; LinkInfo::pendingMifClosings-- ) { MifDoc::Marker marker( MifDoc::T_string( "" ), MifDoc::Marker::Hypertext ); marker.out( mifDoc.os() ); } if( indexEntryStack.size() > 0 ) { indexEntryStack.back().out( mifDoc.os() ); indexEntryStack.resize( indexEntryStack.size() - 1 ); } for( size_t i = 0; i < nodeStack.size(); i++ ) { unsigned long n; if( nodeStack[i].node->elementIndex( n ) == accessOK ) { GroveString id; nodeStack[i].node->getId( id ); unsigned long groveIndex = nodeStack[i].node->groveIndex(); mifDoc.os() << MifDoc::CrossRefInfo ( groveIndex, n, mifDoc.os().CurTagIndent, MifDoc::CrossRefInfo::PotentialMarker, id.data(), id.size() ); if( id.size() > 0 ) mifDoc.elements().setBookComponentIndex ( groveIndex, StringC( id.data(), id.size() ), mifDoc.bookComponents().size() - 1 ); else mifDoc.elements().setBookComponentIndex ( groveIndex, n, mifDoc.bookComponents().size() - 1 ); } } NodeInfo::nonEmptyElementsOpened = 0; nodeStack.resize(0); if( linkStack.size() > 0 && !linkStack.back().openedInMif && !linkStack.back().forcesNoLink() ) { linkStack.back().crossRefInfo->tagIndent = mifDoc.os().CurTagIndent; mifDoc.os() << *linkStack.back().crossRefInfo; linkStack.back().openedInMif = true; } } //--------- LINKS ------------------------------------------------------------- void MifFOTBuilder::startLink( const Address &address ) { switch( address.type ) { case Address::resolvedNode: { unsigned long n; if( address.node->elementIndex( n ) == accessOK ) { GroveString id; address.node->getId( id ); unsigned long groveIndex = address.node->groveIndex(); linkStack.resize( linkStack.size() + 1 ); linkStack.back().crossRefInfo = new MifDoc::CrossRefInfo ( groveIndex, n, 0, MifDoc::CrossRefInfo::HypertextLink, id.data(), id.size() ); if( id.size() > 0 ) mifDoc.elements().setReferencedFlag ( MifDoc::ElementSet::LinkReference, groveIndex, StringC( id.data(), id.size() ) ); else mifDoc.elements().setReferencedFlag ( MifDoc::ElementSet::LinkReference, groveIndex, n ); } break; } case Address::idref: { const StringC &id = address.params[0]; size_t i; for( i = 0; i < id.size(); i++ ) if( id[i] == ' ') break; linkStack.resize( linkStack.size() + 1 ); linkStack.back().crossRefInfo = new MifDoc::CrossRefInfo ( address.node->groveIndex(), 0, 0, MifDoc::CrossRefInfo::HypertextLink, id.data(), i ); mifDoc.elements().setReferencedFlag ( MifDoc::ElementSet::LinkReference, address.node->groveIndex(), StringC( id.data(), i ) ); break; } case Address::none: default: linkStack.resize( linkStack.size() + 1 ); } } void MifFOTBuilder::endLink() { assert( linkStack.size() > 0 ); if( linkStack.back().openedInMif ) LinkInfo::pendingMifClosings++; linkStack.resize( linkStack.size() - 1 ); // MifDoc::Marker marker( MifDoc::T_string( "" ), MifDoc::Marker::Hypertext ); // marker.out( mifDoc.os() ); } //--------- CROSS-REFERENCES -------------------------------------------------- void MifFOTBuilder::startNode( const NodePtr &node, const StringC &mode ) { NodeInfo::curNodeLevel++; if( mode.size() == 0 ) nodeStack.push_back( NodeInfo( node, NodeInfo::curNodeLevel ) ); } void MifFOTBuilder::endNode() { if( nodeStack.size() > 0 && nodeStack.back().nodeLevel == NodeInfo::curNodeLevel && NodeInfo::nonEmptyElementsOpened < nodeStack.size() ) nodeStack.resize( nodeStack.size() - 1 ); NodeInfo::curNodeLevel--; } void MifFOTBuilder::currentNodePageNumber( const NodePtr &node ) { unsigned long n; if( node->elementIndex( n ) == accessOK ) { GroveString id; node->getId( id ); if( !mifDoc.bookComponent().pageNumXRefFormatGenerated ) { mifDoc.bookComponent().XRefFormats.push_back ( MifDoc::XRefFormat( MifDoc::sPageNumXRefFormatName, "<$pagenum\\>" ) ); mifDoc.bookComponent().pageNumXRefFormatGenerated = true; } unsigned long groveIndex = node->groveIndex(); mifDoc.os() << MifDoc::CrossRefInfo ( groveIndex, n, mifDoc.os().CurTagIndent, MifDoc::CrossRefInfo::XRef, id.data(), id.size() ); if( id.size() > 0 ) mifDoc.elements().setReferencedFlag ( MifDoc::ElementSet::PageReference, groveIndex, StringC( id.data(), id.size() ) ); else mifDoc.elements().setReferencedFlag ( MifDoc::ElementSet::PageReference, groveIndex, n ); } } //--------- INDEX-ENTRIES ----------------------------------------------------- void MifFOTBuilder::indexEntry( const IndexEntryNIC &nic ) { MifDoc::T_string mText; if( nic.components.size() > 0 ) { if( !nic.pageNumber ) mText += MifDoc::T_string( "<$nopage>" ); if( nic.startsPageRange ) mText += MifDoc::T_string( "<$startrange>" ); if( nic.endsPageRange ) mText += MifDoc::T_string( "<$endrange>" ); bool first = true; for( size_t i = 0; i < nic.components.size(); first = false, i++ ) { if( !first ) mText += ':'; for( size_t ii = 0; ii < nic.components[i].size(); ii++ ) mText += char( nic.components[i][ii] ); } if( nic.sortString.size() > 0 ) { mText += '['; for( size_t i = 0; i < nic.sortString.size(); i++ ) mText += char( nic.sortString[i] ); mText += ']'; } indexEntryStack.resize( indexEntryStack.size() + 1 ); indexEntryStack.back() = MifDoc::Marker( mText, MifDoc::Marker::Index ); } } //----------------------------------------------------------------------------- void MifFOTBuilder::setCellBackground( bool to ) { nextFormat.FotCellBackground = to; } void MifFOTBuilder::setBackgroundColor( const DeviceRGBColor &rgbColor ) { MifDoc::Color *color = new MifDoc::Color( rgbColor.red, rgbColor.green, rgbColor.blue ); nextFormat.MifBackgroundColor = color->ColorTag; if( mifDoc.colorCatalog().Colors.lookup( color->ColorTag ) == NULL ) { mifDoc.colorCatalog().Colors.insert( color ); } else delete color; } void MifFOTBuilder::setBackgroundColor() { nextFormat.MifBackgroundColor = MifDoc::T_tagstring(); } void MifFOTBuilder::setColor( const DeviceRGBColor &rgbColor ) { MifDoc::Color *color = new MifDoc::Color( rgbColor.red, rgbColor.green, rgbColor.blue ); nextFormat.FColor = color->ColorTag; if( mifDoc.colorCatalog().Colors.lookup( color->ColorTag ) == NULL ) { mifDoc.colorCatalog().Colors.insert( color ); } else delete color; } void MifFOTBuilder::setSpan( long n ) { nextFormat.FotSpan = n; } void MifFOTBuilder::setPageNColumns( long n ) { nextFormat.FotPageNColumns = n; mifDoc.document().setDColumns( n ); } void MifFOTBuilder::setPageColumnSep( Length l ) { nextFormat.FotPageColumnSep = l; mifDoc.document().setDColumnGap( l ); } void MifFOTBuilder::setPageBalanceColumns( bool b ) { nextFormat.FotPageBalanceColumns = b; } void MifFOTBuilder::setLines( Symbol s ) { nextFormat.FotLines = s; } void MifFOTBuilder::setInputWhitespaceTreatment( Symbol s ) { nextFormat.FotInputWhitespaceTreatment = s; } void MifFOTBuilder::setMinLeading( const OptLengthSpec &ol ) { nextFormat.FotMinLeading = ol; } void MifFOTBuilder::setPositionPointShift( const LengthSpec &l ) { nextFormat.FotPositionPointShiftSpec = l; } void MifFOTBuilder::setLineThickness( Length l ) { nextFormat.FotLineThickness = l; } void MifFOTBuilder::setLineRepeat( long n ) { nextFormat.FotLineRepeat = n; } void MifFOTBuilder::setLineSep( Length l ) { nextFormat.FotLineSep = l; } void MifFOTBuilder::setFieldWidth( const LengthSpec &l ) { nextFormat.FotFieldWidth = l; } void MifFOTBuilder::setLineCap( Symbol s ) { nextFormat.FotLineCap = s; } void MifFOTBuilder::setFieldAlign( Symbol s ) { nextFormat.FotFieldAlign = s; } //--------------------------------------------------------------------------------------------- void MifFOTBuilder::extension( const ExtensionFlowObj &fo, const NodePtr &node ) { ((const MifExtensionFlowObj &)fo).atomic( *this, node ); } bool MifFOTBuilder::IndexEntryFlowObj::hasNIC( const StringC &name ) const { return name == "components" || name == "page-number?" || name == "sort-string" || name == "starts-page-range?" || name == "ends-page-range?" ; } void MifFOTBuilder::IndexEntryFlowObj::setNIC( const StringC &name, const Value &value ) { if( name == "components" ) value.convertStringList( nic.components ); else if( name == "page-number?" ) value.convertBoolean( nic.pageNumber ); else if( name == "sort-string" ) { bool hasString; value.convertBoolean( hasString ); if( hasString ) value.convertString( nic.sortString ); } else if( name == "starts-page-range?" ) value.convertBoolean( nic.startsPageRange ); else if( name == "ends-page-range?" ) value.convertBoolean( nic.endsPageRange ); } //--------------------------------------------------------------------------------------------- unsigned long StringHash::hash( const String &str ) { const char *p = str.data(); unsigned long h = 0; for( size_t n = str.size(); n > 0; n-- ) h = (h << 5) + h + *p++; // from Chris Torek return h; } FOTBuilder *makeMifFOTBuilder( const String &fileLoc, const Ptr &entityManager, const CharsetInfo &systemCharset, CmdLineApp *app, const FOTBuilder::Description *&descr) { MifFOTBuilder::IndexEntryFlowObj *indexEntryFlowObject = new MifFOTBuilder::IndexEntryFlowObj; static const FOTBuilder::Extension extensions[] = { { "UNREGISTERED::ISOGEN//Flow Object Class::index-entry", 0, 0, 0, 0, indexEntryFlowObject }, { "UNREGISTERED::James Clark//Characteristic::page-n-columns", 0, 0, (void (FOTBuilder::*)(long))&MifFOTBuilder::setPageNColumns, 0 }, { "UNREGISTERED::James Clark//Characteristic::page-column-sep", 0, 0, 0, (void (FOTBuilder::*)(FOTBuilder::Length))&MifFOTBuilder::setPageColumnSep, }, { "UNREGISTERED::James Clark//Characteristic::page-balance-columns?", (void (FOTBuilder::*)(bool))&MifFOTBuilder::setPageBalanceColumns, 0, 0 }, { 0, 0, 0} }; static const FOTBuilder::Feature features[] = { { "table", 0}, { "simple-page", 0}, { 0, 0} }; static const char *media[] = { "print", 0 }; static const FOTBuilder::Description description = { extensions, features, false, media }; descr = &description; return new MifFOTBuilder( fileLoc, entityManager, systemCharset, app ); } const Char MifFOTBuilder::FrameCharsetMap[] = { // Latin-1 -> Frame Charset 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00c1, 0x00a2, 0x00a3, 0x00db, 0x00b4, 0x007c, 0x00a4, 0x00ac, 0x00a9, 0x00bb, 0x00c7, 0x00c2, 0x002d, 0x00a8, 0x00f8, 0x00fb, 0x0000, 0x0000, 0x0000, 0x00ab, 0x0000, 0x00a6, 0x00a5, 0x00fc, 0x0000, 0x00bc, 0x00c8, 0x0000, 0x0000, 0x0000, 0x00c0, 0x00cb, 0x00e7, 0x00e5, 0x00cc, 0x0080, 0x0081, 0x00ae, 0x0082, 0x00e9, 0x0083, 0x00e6, 0x00e9, 0x00ed, 0x00ea, 0x00eb, 0x00ec, 0x0000, 0x0084, 0x00f1, 0x00ee, 0x00ef, 0x00cd, 0x0085, 0x0000, 0x00af, 0x00f4, 0x00f2, 0x00f3, 0x0086, 0x0000, 0x0000, 0x00a7, 0x0088, 0x0087, 0x0089, 0x008b, 0x008a, 0x008c, 0x00be, 0x008d, 0x008f, 0x008e, 0x0090, 0x0091, 0x0093, 0x0092, 0x0094, 0x0095, 0x0000, 0x0096, 0x0098, 0x0097, 0x0099, 0x009b, 0x009a, 0x0000, 0x00bf, 0x009d, 0x009c, 0x009e, 0x009f, 0x0000, 0x0000, 0x00d8 }; const MifFOTBuilder::SymbolFont MifFOTBuilder::SymbolFonts[MifFOTBuilder::nSymbolFonts] = { { "Symbol", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x2206, 0x0395, 0x03A6, 0x0393, 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0, 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x2126, 0x039E, 0x03A8, 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F, 0x203E, 0x03B1, 0x03B2, 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03D5, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BF, 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03D6, 0x03C9, 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, 0x223C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D2, 0x2032, 0x2264, 0x2215, 0x221E, 0x0192, 0x2663, 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x2033, 0x2265, 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, 0x0000, 0x0000, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209, 0x2220, 0x2207, 0x00AE, 0x00A9, 0x2122, 0x220F, 0x221A, 0x22C5, 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA, 0x2329, 0x00AE, 0x00A9, 0x2122, 0x2211, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x232A, 0x222B, 0x2320, 0x0000, 0x2321, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 } }, // I created this table by hand. It's sometimes not obvious what // the appropriate mapping is (James Clark) { "Wingdings", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2702, 0x2701, 0x0000, 0x0000, 0x0000, 0x0000, 0x260e, 0x2706, 0x2709, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2328, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2707, 0x270d, 0x0000, 0x270c, 0x0000, 0x0000, 0x0000, 0x261c, 0x261e, 0x261d, 0x261f, 0x0000, 0x263a, 0x0000, 0x2639, 0x0000, 0x2620, 0x0000, 0x0000, 0x2708, 0x263c, 0x0000, 0x2744, 0x0000, 0x271e, 0x0000, 0x2720, 0x2721, 0x262a, 0x262f, 0x0950, 0x2638, 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f, 0x2650, 0x2651, 0x2652, 0x2653, 0x0000, 0x0000, 0x25cf, 0x274d, 0x25a0, 0x25a1, 0x0000, 0x2751, 0x2752, 0x0000, 0x0000, 0x25c6, 0x2756, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, 0x2788, 0x2789, 0x0000, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f, 0x2790, 0x2791, 0x2792, 0x2793, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25cb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25aa, 0x0000, 0x0000, 0x2726, 0x2605, 0x2736, 0x0000, 0x2739, 0x0000, 0x0000, 0x0000, 0x2727, 0x0000, 0x0000, 0x272a, 0x2730, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x232b, 0x2326, 0x0000, 0x27a2, 0x0000, 0x0000, 0x0000, 0x27b2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25ab, 0x2718, 0x2714, 0x2612, 0x2611, 0x0000 } }, { "ZapfDingbats", { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2701, 0x2702, 0x2703, 0x2704, 0x260E, 0x2706, 0x2707, 0x2708, 0x2709, 0x261B, 0x261E, 0x270C, 0x270D, 0x270E, 0x270F, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E, 0x271F, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 0x273A, 0x273B, 0x273C, 0x273D, 0x273E, 0x273F, 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274A, 0x274B, 0x0000, 0x274D, 0x25A0, 0x274F, 0x2750, 0x2751, 0x2752, 0x25B2, 0x25BC, 0x25C6, 0x2756, 0x0000, 0x2758, 0x2759, 0x275A, 0x275B, 0x275C, 0x275D, 0x275E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x277F, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E, 0x278F, 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195, 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F, 0x27A0, 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7, 0x27A8, 0x27A9, 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF, 0x0000, 0x27B1, 0x27B2, 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7, 0x27B8, 0x27B9, 0x27BA, 0x27BB, 0x27BC, 0x27BD, 0x27BE, 0x0000 } }, }; // --------- static ----------------------------------------------------------- #define CONST_STRING( symbolName ) \ const String MifDoc::s ## symbolName ( #symbolName, sizeof( #symbolName ) - 1 ) const String MifDoc::sNONE; const String MifDoc::sSPACE( " ", sizeof( " " ) - 1 ); const String MifDoc::sDefaultTblFormat ( "Default Tbl Format", sizeof( "Default Tbl Format" ) - 1 ); const String MifDoc::sDefaultPgfFormat ( "Default Pgf Format", sizeof( "Default Pgf Format" ) - 1 ); const String MifDoc::sTimesNewRoman ( "Times New Roman", sizeof( "Times New Roman" ) - 1 ); const String MifDoc::sPageNumXRefFormatName ( "Page Number Format", sizeof( "Page Number Format" ) - 1 ); CONST_STRING( A ); CONST_STRING( Regular ); CONST_STRING( Bold ); CONST_STRING( Italic ); CONST_STRING( FNoUnderlining ); CONST_STRING( FSingle ); CONST_STRING( FDouble ); CONST_STRING( FNumeric ); CONST_STRING( FNormal ); CONST_STRING( FSuperscript ); CONST_STRING( FSubscript ); CONST_STRING( FAsTyped ); CONST_STRING( FSmallCaps ); CONST_STRING( FLowercase ); CONST_STRING( FUppercase ); CONST_STRING( LeftRight ); CONST_STRING( Left ); CONST_STRING( Right ); CONST_STRING( Center ); CONST_STRING( Fixed ); CONST_STRING( Proportional ); CONST_STRING( Top ); CONST_STRING( Middle ); CONST_STRING( Bottom ); CONST_STRING( NoLanguage ); CONST_STRING( USEnglish ); CONST_STRING( UKEnglish ); CONST_STRING( German ); CONST_STRING( SwissGerman ); CONST_STRING( French ); CONST_STRING( CanadianFrench ); CONST_STRING( Spanish ); CONST_STRING( Catalan ); CONST_STRING( Italian ); CONST_STRING( Portuguese ); CONST_STRING( Brazilian ); CONST_STRING( Danish ); CONST_STRING( Dutch ); CONST_STRING( Norwegian ); CONST_STRING( Nynorsk ); CONST_STRING( Finnish ); CONST_STRING( Swedish ); CONST_STRING( LeftMasterPage ); CONST_STRING( RightMasterPage ); CONST_STRING( OtherMasterPage ); CONST_STRING( BodyPage ); CONST_STRING( Decimal ); CONST_STRING( Tab ); CONST_STRING( HardSpace ); CONST_STRING( SoftHyphen ); CONST_STRING( HardHyphen ); CONST_STRING( HardReturn ); CONST_STRING( NumberSpace ); CONST_STRING( ThinSpace ); CONST_STRING( EnSpace ); CONST_STRING( EmSpace ); CONST_STRING( Header ); CONST_STRING( Footer ); CONST_STRING( Arabic ); CONST_STRING( UCRoman ); CONST_STRING( LCRoman ); CONST_STRING( UCAlpha ); CONST_STRING( LCAlpha ); CONST_STRING( FirstLeft ); CONST_STRING( FirstRight ); CONST_STRING( Anywhere ); CONST_STRING( ColumnTop ); CONST_STRING( PageTop ); CONST_STRING( LPageTop ); CONST_STRING( RPageTop ); CONST_STRING( First ); CONST_STRING( Inside ); CONST_STRING( Outside ); CONST_STRING( None ); CONST_STRING( RunIntoParagraph ); CONST_STRING( Inline ); CONST_STRING( Below ); CONST_STRING( Butt ); CONST_STRING( Round ); CONST_STRING( Square ); CONST_STRING( White ); CONST_STRING( Black ); CONST_STRING( Normal ); CONST_STRING( Straddle ); CONST_STRING( Cent ); CONST_STRING( Pound ); CONST_STRING( Yen ); CONST_STRING( EnDash ); CONST_STRING( EmDash ); CONST_STRING( Dagger ); CONST_STRING( DoubleDagger ); CONST_STRING( Bullet); MifDoc *MifDoc::CurInstance = NULL; MifDoc::T_ID MifDoc::Object::IDCnt = 0; MifDoc::T_indent MifOutputByteStream::INDENT = MifDoc::T_indent( 0xFFF ); bool MifDoc::Para::currentlyOpened = false; unsigned MifDoc::ParaLine::setProperties = 0; MifDoc::T_ID MifDoc::ParaLine::TextRectID; MifDoc::T_ID MifDoc::ParaLine::ATbl; // ---------------------------------------------------------------------------- int operator!=( const MifDoc::T_LTRB &o1, const MifDoc::T_LTRB &o2 ) { return o1.l != o2.l || o1.t != o2.t || o1.r != o2.r || o1.b != o2.b; } // --------- MifTmpOutputByteStream ------------------------------------------- void MifTmpOutputByteStream::commit( OutputByteStream &os, bool resolveCrossReferences ) { MifOutputByteStream outS( os ); TmpOutputByteStream::Iter iter( *this ); const char *s; size_t n; unsigned crossRefInfoIdx; char *byteDestPtr = NULL; size_t neededBytesNum = 0; enum { normal, waitingForCrossRefInfoIdx } state = normal; while( iter.next( s, n ) ) { while( n > 0 ) { switch( state ) { case waitingForCrossRefInfoIdx: { int bytesCopiedNum = neededBytesNum > n ? n : neededBytesNum; memcpy( byteDestPtr, s, bytesCopiedNum ); byteDestPtr += bytesCopiedNum; n -= bytesCopiedNum; s += bytesCopiedNum; neededBytesNum -= bytesCopiedNum; if( neededBytesNum == 0 ) { assert( crossRefInfoIdx < MifDoc::CurInstance->crossRefInfos().size() ); MifDoc::CrossRefInfo &crossRefInfo = MifDoc::CurInstance->crossRefInfos()[crossRefInfoIdx]; crossRefInfo.out( outS ); state = normal; } } break; case normal: if( resolveCrossReferences ) { const char *escapeCharPtr = (char*)memchr( s, MifDoc::escapeChar(), n ); if( escapeCharPtr != NULL ) { outS.stream().sputn( s, escapeCharPtr - s); n -= (escapeCharPtr - s); s = escapeCharPtr; n--; s++; state = waitingForCrossRefInfoIdx; byteDestPtr = (char*)&crossRefInfoIdx; neededBytesNum = sizeof( unsigned ); break; } } outS.stream().sputn( s, n ); n = 0; } } } assert( neededBytesNum == 0 ); } void MifTmpOutputByteStream::commit( String &str ) { TmpOutputByteStream::Iter iter( *this ); const char *s; size_t n; while( iter.next( s, n ) ) { str.append( s, n ); } } // --------- MifDoc::T_string ------------------------------------------------- void MifDoc::T_string::escapeSpecialChars() { T_string newValue; bool changes = false; for( size_t i = 0; i < size(); i++ ) { switch( (*this)[i] ) { case '\n': case '\r': changes = true; break; case '\t': newValue.append( "\\t", 2 ); changes = true; break; case '>': newValue.append( "\\>", 2 ); changes = true; break; case '\'': newValue.append( "\\q", 2 ); changes = true; break; case '`': newValue.append( "\\Q", 2 ); changes = true; break; case '\\': newValue.append( "\\\\", 2 ); changes = true; break; default: if( (unsigned)(*this)[i] >= 0x80 ) { changes = true; MifDoc::CurInstance->outHexChar( (*this)[i], newValue ); } else newValue += (*this)[i]; } } if( changes ) *this = newValue; } // --------- MifDoc::CrossRefInfo --------------------------------------------- MifDoc::T_string MifDoc::CrossRefInfo::crossRefText() const { char buf[32]; if( sgmlId.size() > 0 ) { sprintf( buf, "NODE%lu.", groveIndex ); T_string result( buf ); for( size_t i = 0; i < sgmlId.size(); i++ ) result += char( sgmlId[i] ); return result; } else { sprintf( buf, "NODE%lu.%lu", groveIndex, elementIndex ); return T_string( buf ); } } void MifDoc::CrossRefInfo::out( MifOutputByteStream &os ) { switch( type() ) { case PotentialMarker: { bool regularMarkerOut = false; bool linkMarkerOut = false; if( sgmlId.size() > 0 ) { if( MifDoc::CurInstance->elements().hasBeenReferenced ( MifDoc::ElementSet::PageReference, groveIndex, sgmlId ) ) regularMarkerOut = true; if( MifDoc::CurInstance->elements().hasBeenReferenced ( MifDoc::ElementSet::LinkReference, groveIndex, sgmlId ) ) linkMarkerOut = true; } else { if( MifDoc::CurInstance->elements().hasBeenReferenced ( MifDoc::ElementSet::PageReference, groveIndex, elementIndex ) ) regularMarkerOut = true; if( MifDoc::CurInstance->elements().hasBeenReferenced ( MifDoc::ElementSet::LinkReference, groveIndex, elementIndex ) ) linkMarkerOut = true; } if( regularMarkerOut ) { os.CurTagIndent = tagIndent; MifDoc::Marker marker( *this ); marker.out( os ); } if( linkMarkerOut ) { os.CurTagIndent = tagIndent; MifDoc::Marker marker( *this, true ); marker.out( os ); } } break; case HypertextLink: { os.CurTagIndent = tagIndent; MifDoc::Marker marker( *this ); marker.out( os ); } break; case XRef: { os.CurTagIndent = tagIndent; MifDoc::XRef xRef( *this ); xRef.out( os ); } break; default: assert( false ); } } // ---------------------------------------------------------------------------- #define CHECK_PROPERTY( propertyName ) \ \ if( setProperties & f ## propertyName ) \ os << '\n' << MifOutputByteStream::INDENT \ << "<" #propertyName " " << propertyName << ">"; #define CHECK_VECTOR_OF_PROPERTIES( propertyName ) \ \ if( setProperties & f ## propertyName ## s) \ for( size_t i = 0; i < propertyName ## s.size(); i++ ) { \ os << '\n' << MifOutputByteStream::INDENT \ << "<" #propertyName " " << propertyName ## s[i] << ">"; \ } // --------- MifDoc::TagStream ------------------------------------------------ MifDoc::TagStream::TagStream( MifDoc::T_indent osIndent ) : Format(), Content( new MifTmpOutputByteStream( osIndent ) ), PgfTagUsed( false ), InitialPgfTag( sDefaultPgfFormat ), TagStreamClass( tsTagStream ) { } MifDoc::TagStream::~TagStream() { if( Content ) delete Content; } // --------- MifDoc::TextFlow ------------------------------------------------- MifDoc::TextFlow::TextFlow( const TextRect &textRect, bool body, ParagraphFormat *format, T_tagstring pgfTag ) : TagStream(), TextRectID( textRect.ID ), setProperties( 0 ), TextRectIDUsed( false ), TextRect_( &textRect ) { TagStreamClass = tsTextFlow; InitialPgfTag = pgfTag; if( format ) Format = *format; if( body ) { setTFTag( MifDoc::sA ); setTFAutoConnect( true ); } } void MifDoc::TextFlow::out( MifOutputByteStream &os, bool resolveCrossReferences ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Color ---------------------------------------------------- MifDoc::Color::Color( unsigned char red, unsigned char green, unsigned char blue ) : setProperties( 0 ) { char colorTag[64]; sprintf( colorTag, "RGB-%i-%i-%i", int( red ), int( green ), int( blue ) ); setColorTag( T_tagstring( colorTag ) ); if( red >= green && red >= blue ) { setColorBlack( double( 255 - red ) / 2.55 ); setColorYellow( double( red - blue ) / 2.55 ); setColorMagenta( double( red - green ) / 2.55 ); setColorCyan( 0.0 ); } else if( green >= red && green >= blue ) { setColorBlack( double( 255 - green ) / 2.55 ); setColorCyan( double( green - red ) / 2.55 ); setColorYellow( double( green - blue ) / 2.55 ); setColorMagenta( 0.0 ); } else { // blue is largest setColorBlack( double( 255 - blue ) / 2.55 ); setColorCyan( double( blue - red ) / 2.55 ); setColorMagenta( double( blue - green ) / 2.55 ); setColorYellow( 0.0 ); } } void MifDoc::Color::out( MifOutputByteStream &os ) const { os << '\n' << MifOutputByteStream::INDENT << ""; } const String &MifDoc::Color::key( Color &color ) { return color.ColorTag; } // --------- MifDoc::ColorCatalog --------------------------------------------- void MifDoc::ColorCatalog::out( MifOutputByteStream &os ) { if( Colors.count() > 0 ) { os << '\n' << MifOutputByteStream::INDENT << ",StringHash,Color> iter( Colors ); const Color *color; while( ( color = iter.next() ) != NULL ) color->out( os ); os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } } // --------- MifDoc::Ruling --------------------------------------------------- const String &MifDoc::Ruling::key( Ruling &r ) { if( r.Key.size() < 1 ) { char keyStr[ 48 ]; sprintf( keyStr, "Ruling-%li-%li-%li-%li-", long( r.RulingPenWidth ), long( r.RulingGap ), r.RulingPen, r.RulingLines ); r.Key.assign( keyStr, strlen( keyStr ) ); r.Key += r.RulingColor; } return r.Key; } void MifDoc::Ruling::out( MifOutputByteStream &os ) const { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::RulingCatalog -------------------------------------------- void MifDoc::RulingCatalog::out( MifOutputByteStream &os ) { if( Rulings.count() > 0 ) { os << '\n' << MifOutputByteStream::INDENT << ",StringHash,Ruling> iter( Rulings ); const Ruling *ruling; while( ( ruling = iter.next() ) != NULL ) ruling->out( os ); os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } } // --------- MifDoc::Cell ----------------------------------------------------- void MifDoc::Cell::out( MifOutputByteStream &os, bool resolveCrossReferences ) { os << '\n' << MifOutputByteStream::INDENT << ""; os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::Row ------------------------------------------------------ void MifDoc::Row::out( MifOutputByteStream &os, bool resolveCrossReferences ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::TblColumn ------------------------------------------------ void MifDoc::TblColumn::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::TblFormat ------------------------------------------------ void MifDoc::TblFormat::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Tbl ------------------------------------------------------ void MifDoc::Tbl::out( MifOutputByteStream &os, bool resolveCrossReferences ) { os << '\n' << MifOutputByteStream::INDENT << ""; } if( TblBody.size() ) { os << '\n' << MifOutputByteStream::INDENT << ""; } if( TblF.size() ) { os << '\n' << MifOutputByteStream::INDENT << ""; } os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::Document ------------------------------------------------- void MifDoc::Document::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::XRefFormat ----------------------------------------------- void MifDoc::XRefFormat::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::XRef ----------------------------------------------------- MifDoc::XRef::XRef( CrossRefInfo &crossRefInfo ) { switch( crossRefInfo.type() ) { case CrossRefInfo::XRef: { MifDoc::T_pathname targetFileName( "" ); int bookComponentIdx = crossRefInfo.sgmlId.size() > 0 ? MifDoc::CurInstance->elements().bookComponentIndex ( crossRefInfo.groveIndex, crossRefInfo.sgmlId ) : MifDoc::CurInstance->elements().bookComponentIndex ( crossRefInfo.groveIndex, crossRefInfo.elementIndex ); targetFileName += MifDoc::T_pathname ( MifDoc::CurInstance->bookComponents()[bookComponentIdx].FileName ); setXRefSrcFile( targetFileName ); setXRefName( MifDoc::sPageNumXRefFormatName ); setXRefSrcText( crossRefInfo.crossRefText() ); setXRefText( "000" ); break; } default: assert( false ); } } void MifDoc::XRef::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; if( setProperties & fXRefText ) os << '\n' << MifOutputByteStream::INDENT << ""; os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Marker --------------------------------------------------- MifDoc::Marker::Marker( CrossRefInfo &crossRefInfo, bool linkDestinationMode ) { switch( crossRefInfo.type() ) { case CrossRefInfo::PotentialMarker: if( linkDestinationMode ) { setMType( Hypertext ); setMText( "newlink " ); MText += crossRefInfo.crossRefText(); } else { setMType( XRef ); setMText( crossRefInfo.crossRefText() ); } break; case CrossRefInfo::HypertextLink: { setMType( Hypertext ); MifDoc::T_pathname targetFileName( "" ); int bookComponentIdx = crossRefInfo.sgmlId.size() > 0 ? MifDoc::CurInstance->elements().bookComponentIndex ( crossRefInfo.groveIndex, crossRefInfo.sgmlId ) : MifDoc::CurInstance->elements().bookComponentIndex ( crossRefInfo.groveIndex, crossRefInfo.elementIndex ); targetFileName += MifDoc::T_pathname ( MifDoc::CurInstance->bookComponents()[bookComponentIdx].FileName ); setMText( T_string( "gotolink " ) ); MText += targetFileName; MText += ':'; MText += crossRefInfo.crossRefText(); break; } case HypertextDestination: setMText( T_string( "newlink " ) ); MText += crossRefInfo.crossRefText(); break; default: assert( false ); } } void MifDoc::Marker::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Object --------------------------------------------------- void MifDoc::Object::outObjectProperties( MifOutputByteStream &os ) { CHECK_PROPERTY( ID ); CHECK_PROPERTY( Pen ); CHECK_PROPERTY( Fill ); CHECK_PROPERTY( PenWidth ); CHECK_PROPERTY( ObColor ); } // --------- MifDoc::PolyLine ------------------------------------------------- void MifDoc::PolyLine::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::ImportObject --------------------------------------------- void MifDoc::ImportObject::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Frame ---------------------------------------------------- void MifDoc::Frame::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << "out( os ); os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::TextRect ------------------------------------------------- void MifDoc::TextRect::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Page ----------------------------------------------------- void MifDoc::Page::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::TabStop -------------------------------------------------- void MifDoc::TabStop::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::Para ----------------------------------------------------- void MifDoc::Para::out( MifOutputByteStream &os ) { outProlog( os ); MifDoc::ParaLine::outProlog( os ); content().commit( os.stream() ); MifDoc::ParaLine::outEpilog( os ); outEpilog( os ); } void MifDoc::Para::outSimpleProlog( MifOutputByteStream &os ) { currentlyOpened = true; os << '\n' << MifOutputByteStream::INDENT << ""; currentlyOpened = false; } // --------- MifDoc::ParaLine ------------------------------------------------- void MifDoc::ParaLine::outProlog( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << "curTextFlow(); if( tf != NULL && !tf->TextRectIDUsed ) { setTextRectID( tf->TextRectID ); CHECK_PROPERTY( TextRectID ); setProperties &= ~fTextRectID; tf->TextRectIDUsed = true; } MifDoc::Tbl *tbl = MifDoc::CurInstance->curTbl( false ); if( tbl != NULL && !tbl->TblIDUsed ) { setATbl( tbl->TblID ); CHECK_PROPERTY( ATbl ); setProperties &= ~fATbl; tbl->TblIDUsed = true; } } void MifDoc::ParaLine::outEpilog( MifOutputByteStream &os ) { os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::PgfCatalog ----------------------------------------------- void MifDoc::PgfCatalog::out( MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } // --------- MifDoc::TblCatalog ----------------------------------------------- void MifDoc::TblCatalog::out( MifOutputByteStream &os ) { if( TblFormats.size() > 0 ) { os << '\n' << MifOutputByteStream::INDENT << ""; } } // ---------------------------------------------------------------------------- #define COMPARE_PROPERTY( propertyName ) \ \ if( propertyName != f.propertyName ) \ differingProperties |= f ## propertyName; #define COND_SET_PROPERTY( propertyName ) \ \ if( properties & f ## propertyName ) \ propertyName = f.propertyName; #define PROPERTY_OUT( propertyName ) \ \ if( properties & f ## propertyName ) \ os << '\n' << MifOutputByteStream::INDENT \ << "<" #propertyName " " << propertyName << ">"; // --------- MifDoc::FontFormat ----------------------------------------------- unsigned MifDoc::FontFormat::compare( FontFormat &f ) { unsigned differingProperties = 0; COMPARE_PROPERTY( FFamily ); COMPARE_PROPERTY( FAngle ); COMPARE_PROPERTY( FWeight ); COMPARE_PROPERTY( FVar ); COMPARE_PROPERTY( FSize ); COMPARE_PROPERTY( FColor ); COMPARE_PROPERTY( FUnderlining ); COMPARE_PROPERTY( FOverline ); COMPARE_PROPERTY( FStrike ); COMPARE_PROPERTY( FPosition ); COMPARE_PROPERTY( FPairKern ); COMPARE_PROPERTY( FCase ); COMPARE_PROPERTY( FDX ); COMPARE_PROPERTY( FDY ); COMPARE_PROPERTY( FDW ); return differingProperties; } void MifDoc::FontFormat::setFrom( FontFormat &f, unsigned properties ) { COND_SET_PROPERTY( FFamily ); COND_SET_PROPERTY( FAngle ); COND_SET_PROPERTY( FWeight ); COND_SET_PROPERTY( FVar ); COND_SET_PROPERTY( FSize ); COND_SET_PROPERTY( FColor ); COND_SET_PROPERTY( FUnderlining ); COND_SET_PROPERTY( FOverline ); COND_SET_PROPERTY( FStrike ); COND_SET_PROPERTY( FPosition ); COND_SET_PROPERTY( FPairKern ); COND_SET_PROPERTY( FCase ); COND_SET_PROPERTY( FDX ); COND_SET_PROPERTY( FDY ); COND_SET_PROPERTY( FDW ); } void MifDoc::FontFormat::out( MifOutputByteStream &os, unsigned properties, FontStatement fontStatement ) { const char *statementName = (fontStatement == stPgfFont) ? "PgfFont" : "Font"; if( properties ) { os << '\n' << MifOutputByteStream::INDENT << "<" << statementName << " "; os.indent(); PROPERTY_OUT( FFamily ); PROPERTY_OUT( FAngle ); PROPERTY_OUT( FWeight ); PROPERTY_OUT( FVar ); PROPERTY_OUT( FSize ); PROPERTY_OUT( FColor ); PROPERTY_OUT( FUnderlining ); PROPERTY_OUT( FOverline ); PROPERTY_OUT( FStrike ); PROPERTY_OUT( FPosition ); PROPERTY_OUT( FPairKern ); PROPERTY_OUT( FCase ); PROPERTY_OUT( FDX ); PROPERTY_OUT( FDY ); PROPERTY_OUT( FDW ); os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } } void MifDoc::FontFormat::updateFrom( FontFormat &f ) { unsigned differingProperties = FontFormat::compare( f ); setFrom( f, differingProperties ); setProperties = differingProperties; } // --------- MifDoc::ParagraphFormat ------------------------------------------ unsigned MifDoc::ParagraphFormat::compare( ParagraphFormat &f ) { unsigned differingProperties = 0; COMPARE_PROPERTY( PgfTag ); COMPARE_PROPERTY( PgfLanguage ); COMPARE_PROPERTY( PgfFIndent ); COMPARE_PROPERTY( PgfLIndent ); COMPARE_PROPERTY( PgfRIndent ); COMPARE_PROPERTY( PgfAlignment ); COMPARE_PROPERTY( PgfSpBefore ); COMPARE_PROPERTY( PgfSpAfter ); COMPARE_PROPERTY( PgfLineSpacing ); COMPARE_PROPERTY( PgfLeading ); COMPARE_PROPERTY( PgfNumTabs ); COMPARE_PROPERTY( PgfPlacement ); COMPARE_PROPERTY( PgfPlacementStyle ); COMPARE_PROPERTY( PgfWithPrev ); COMPARE_PROPERTY( PgfWithNext ); COMPARE_PROPERTY( PgfBlockSize ); COMPARE_PROPERTY( PgfAutoNum ); COMPARE_PROPERTY( PgfNumFormat ); COMPARE_PROPERTY( PgfNumberFont ); COMPARE_PROPERTY( PgfHyphenate ); COMPARE_PROPERTY( HyphenMaxLines ); COMPARE_PROPERTY( HyphenMinPrefix ); COMPARE_PROPERTY( HyphenMinSuffix ); COMPARE_PROPERTY( HyphenMinWord ); COMPARE_PROPERTY( PgfLetterSpace ); COMPARE_PROPERTY( PgfCellAlignment ); COMPARE_PROPERTY( PgfCellMargins ); COMPARE_PROPERTY( PgfCellLMarginFixed ); COMPARE_PROPERTY( PgfCellTMarginFixed ); COMPARE_PROPERTY( PgfCellRMarginFixed ); COMPARE_PROPERTY( PgfCellBMarginFixed ); return differingProperties; } void MifDoc::ParagraphFormat::setFrom( ParagraphFormat &f, unsigned properties, unsigned fontProperties ) { COND_SET_PROPERTY( PgfTag ); COND_SET_PROPERTY( PgfLanguage ); COND_SET_PROPERTY( PgfFIndent ); COND_SET_PROPERTY( PgfLIndent ); COND_SET_PROPERTY( PgfRIndent ); COND_SET_PROPERTY( PgfAlignment ); COND_SET_PROPERTY( PgfSpBefore ); COND_SET_PROPERTY( PgfSpAfter ); COND_SET_PROPERTY( PgfLineSpacing ); COND_SET_PROPERTY( PgfLeading ); COND_SET_PROPERTY( PgfNumTabs ); COND_SET_PROPERTY( PgfPlacement ); COND_SET_PROPERTY( PgfPlacementStyle ); COND_SET_PROPERTY( PgfWithPrev ); COND_SET_PROPERTY( PgfWithNext ); COND_SET_PROPERTY( PgfBlockSize ); COND_SET_PROPERTY( PgfAutoNum ); COND_SET_PROPERTY( PgfNumFormat ); COND_SET_PROPERTY( PgfNumberFont ); COND_SET_PROPERTY( PgfHyphenate ); COND_SET_PROPERTY( HyphenMaxLines ); COND_SET_PROPERTY( HyphenMinPrefix ); COND_SET_PROPERTY( HyphenMinSuffix ); COND_SET_PROPERTY( HyphenMinWord ); COND_SET_PROPERTY( PgfLetterSpace ); COND_SET_PROPERTY( PgfCellAlignment ); COND_SET_PROPERTY( PgfCellMargins ); COND_SET_PROPERTY( PgfCellLMarginFixed ); COND_SET_PROPERTY( PgfCellTMarginFixed ); COND_SET_PROPERTY( PgfCellRMarginFixed ); COND_SET_PROPERTY( PgfCellBMarginFixed ); FontFormat::setFrom( f, fontProperties ); } void MifDoc::ParagraphFormat::out( MifOutputByteStream &os, unsigned properties, unsigned fontProperties, bool excludeCellProperties ) { bool outPgfTag = false; T_tagstring pgfTag; if( !( properties & fPgfTag ) ) { MifDoc::TagStream &ts = MifDoc::CurInstance->curTagStream(); if( !ts.PgfTagUsed ) { pgfTag = ts.InitialPgfTag; outPgfTag = true; ts.PgfTagUsed = true; } } if( properties != 0 || fontProperties != 0 || outPgfTag ) { os << '\n' << MifOutputByteStream::INDENT << ""; else PROPERTY_OUT( PgfTag ); FontFormat::out( os, fontProperties, FontFormat::stPgfFont ); PROPERTY_OUT( PgfLanguage ); PROPERTY_OUT( PgfFIndent ); PROPERTY_OUT( PgfLIndent ); PROPERTY_OUT( PgfRIndent ); PROPERTY_OUT( PgfAlignment ); PROPERTY_OUT( PgfSpBefore ); PROPERTY_OUT( PgfSpAfter ); PROPERTY_OUT( PgfLineSpacing ); PROPERTY_OUT( PgfLeading ); PROPERTY_OUT( PgfNumTabs ); if( properties & fTabStops ) for( size_t i = 0; i < TabStops.size(); i++ ) TabStops[i].out( os ); PROPERTY_OUT( PgfPlacement ); PROPERTY_OUT( PgfPlacementStyle ); PROPERTY_OUT( PgfWithPrev ); PROPERTY_OUT( PgfWithNext ); PROPERTY_OUT( PgfBlockSize ); PROPERTY_OUT( PgfAutoNum ); PROPERTY_OUT( PgfNumFormat ); PROPERTY_OUT( PgfNumberFont ); PROPERTY_OUT( PgfHyphenate ); PROPERTY_OUT( HyphenMaxLines ); PROPERTY_OUT( HyphenMinPrefix ); PROPERTY_OUT( HyphenMinSuffix ); PROPERTY_OUT( HyphenMinWord ); PROPERTY_OUT( PgfLetterSpace ); if( MifDoc::CurInstance->curCell() != NULL || !excludeCellProperties ) { PROPERTY_OUT( PgfCellAlignment ); PROPERTY_OUT( PgfCellMargins ); PROPERTY_OUT( PgfCellLMarginFixed ); PROPERTY_OUT( PgfCellTMarginFixed ); PROPERTY_OUT( PgfCellRMarginFixed ); PROPERTY_OUT( PgfCellBMarginFixed ); } os.undent(); os << '\n' << MifOutputByteStream::INDENT << ">"; } } void MifDoc::ParagraphFormat::updateFrom( ParagraphFormat &f ) { FontFormat::updateFrom( f ); unsigned differingProperties = compare( f ); setFrom( f, differingProperties, 0 ); setProperties = differingProperties; } // --------- MifDoc::BookComponent -------------------------------------------- MifDoc::BookComponent::BookComponent( MifTmpOutputByteStream *epilogOs ) : epilogOs( epilogOs ), pageNumXRefFormatGenerated( false ) { } void MifDoc::BookComponent::commit ( const String &dirName, bool resolveCrossReferences ) { assert( FileName.size() > 0 ); String fileLoc; fileLoc += dirName; fileLoc += FileName; fileLoc += 0; FileOutputByteStream outFile; if( outFile.open( fileLoc.data() ) ) { MifOutputByteStream os( outFile ); os << ""; colorCatalog.out( os ); pgfCatalog.out( os ); rulingCatalog.out( os ); size_t i; if( AFrames.size() ) { os << "\n"; } if( XRefFormats.size() ) { os << "\n"; } tblCatalog.out( os ); document.out( os ); if( Tbls.size() ) { os << "\n"; } for( i = 0; i < Pages.size(); i++ ) Pages[i].out( os ); for( i = 0; i < TextFlows.size(); i++ ) TextFlows[i].out( os, resolveCrossReferences ); if( epilogOs ) epilogOs->commit( os.stream(), resolveCrossReferences ); } else { MifDoc::curInstance().App->message ( MifMessages::cannotOpenOutputError, StringMessageArg( MifDoc::curInstance().App->convertInput( fileLoc.data() ) ), ErrnoMessageArg( errno ) ); return; } } // --------- MifDoc ----------------------------------------------------------- MifDoc::MifDoc( const String &fileLoc, CmdLineApp *app ) : App( app ), RootOutputFileLoc( fileLoc ), CurTblNum( 0 ), CurTextFlow( NULL ), CurCell( NULL ), CurPara( NULL ), NextID( 0 ) { if( RootOutputFileLoc.size() > 0 && RootOutputFileLoc[RootOutputFileLoc.size()-1] == 0 ) RootOutputFileLoc.resize( RootOutputFileLoc.size() - 1 ); CurInstance = this; enterBookComponent(); } MifDoc::~MifDoc() { commit(); } void MifDoc::commit() { String outDir = rootOutputFileLoc(); String outFileName; { int i; for( i = outDir.size() - 1; i >= 0; i-- ) if( outDir[i] == '/' || outDir[i] == '\\' ) break; if( outDir.size() - (i+1) > 0 ) outFileName.assign( &outDir.data()[i+1], outDir.size() - (i+1) ); outDir.resize( i + 1 ); } if( BookComponents.size() > 1 ) { String bookFileLoc( rootOutputFileLoc() ); String fileNameExt; { size_t idx; for( idx = bookFileLoc.size(); idx > 0; idx-- ) if( bookFileLoc[idx-1] == char( '.' ) ) break; if( idx > 0 && bookFileLoc.size() - idx > 0 ) fileNameExt.assign( &bookFileLoc[idx], bookFileLoc.size() - idx ); else { fileNameExt += 'm'; fileNameExt += 'i'; fileNameExt += 'f'; } } String fileName; char idxStr[32]; for( size_t i = 0; i < BookComponents.size(); i++ ) { fileName.resize( 0 ); sprintf( idxStr, "%u", i+1 ); for( const char *c = idxStr; *c; c++) fileName += CmdLineApp::AppChar(*c); fileName += '.'; fileName += fileNameExt; BookComponents[i].FileName = fileName; } bookFileLoc += 0; FileOutputByteStream bookFile; if( bookFile.open( bookFileLoc.data() ) ) { MifOutputByteStream os( bookFile ); os << ""; for( size_t i = 0; i < BookComponents.size(); i++ ) os << "\n" << BookComponents[i].FileName << "\'>" << "\n>"; } else { MifDoc::curInstance().App->message ( MifMessages::cannotOpenOutputError, StringMessageArg( MifDoc::curInstance().App->convertInput( bookFileLoc.data() ) ), ErrnoMessageArg( errno ) ); } } else if( BookComponents.size() == 1 ) BookComponents[0].FileName = outFileName; for( size_t i = 0; i < BookComponents.size(); i++ ) BookComponents[i].commit( outDir ); } void MifDoc::enterBookComponent() { TagStream *defaultTagStream = new TagStream( MifDoc::T_indent( 0 ) ); enterTagStream( *defaultTagStream ); BookComponent newBookComponent( &defaultTagStream->content() ); bookComponents().push_back( newBookComponent ); } void MifDoc::exitBookComponent() { exitTagStream(); } void MifDoc::outAFrame( T_ID ID, MifOutputByteStream &os ) { os << '\n' << MifOutputByteStream::INDENT << ""; } void MifDoc::switchToTagStream( TagStream &tagStream, bool startWithDefaultPgfFormat ) { if( tagStream.TagStreamClass == TagStream::tsTextFlow ) setCurTextFlow( (MifDoc::TextFlow*)&tagStream ); else if( tagStream.TagStreamClass == TagStream::tsCell ) setCurCell( (MifDoc::Cell*)&tagStream ); if( tagStream.TagStreamClass == TagStream::tsPara ) { MifDoc::Para::currentlyOpened = true; } else if( startWithDefaultPgfFormat ) { tagStream.PgfTagUsed = false; MifDoc::ParagraphFormat defaultPgfFormat; defaultPgfFormat.setDSSSLDefaults(); setCurParagraphFormat( defaultPgfFormat ); } setCurOs( tagStream.content().stream() ); } void MifDoc::enterTagStream( TagStream &tagStream ) { TagStreamStack.resize( TagStreamStack.size() + 1 ); TagStreamStack.back() = &tagStream; switchToTagStream( *TagStreamStack.back() ); } void MifDoc::exitTagStream() { bool startWithDefaultPgfFormat = true; assert( TagStreamStack.size() > 0 ); if( TagStreamStack.back()->TagStreamClass == TagStream::tsPara ) { MifDoc::Para::currentlyOpened = false; startWithDefaultPgfFormat = false; } TagStreamStack.resize( TagStreamStack.size() - 1 ); if( TagStreamStack.size() >= 1 ) switchToTagStream( *TagStreamStack.back(), startWithDefaultPgfFormat ); } void MifDoc::outTagEnd() { os() << ">"; } void MifDoc::outHexChar( unsigned code, MifOutputByteStream *o ) { MifOutputByteStream &outS = ( o != NULL ) ? *o : os(); static const char hex[] = "0123456789abcdef"; outS << "\\x" << hex[(code >> 4) & 0xf] << hex[code & 0xf] << " "; } void MifDoc::outHexChar( unsigned code, String &targetString ) { static const char hex[] = "0123456789abcdef"; targetString += '\\'; targetString += 'x'; targetString += hex[(code >> 4) & 0xf]; targetString += hex[code & 0xf]; targetString += ' '; } void MifDoc::outSpecialChar( const String &charName, MifOutputByteStream *o ) { MifOutputByteStream &outS = ( o != NULL ) ? *o : os(); outS << '\n' << MifOutputByteStream::INDENT << ""; } void MifDoc::outBreakingPara( MifDoc::T_keyword pgfPlacement ) { curFormat().setPgfSpBefore( 0 ), curFormat().setPgfSpAfter( 0 ), curFormat().setPgfPlacement( pgfPlacement ); Para::outSimpleProlog( os() ); curFormat().out( os() ); ParaLine::outProlog( os() ); ParaLine::outEpilog( os() ); Para::outEpilog( os() ); } void MifDoc::beginParaLine() { MifDoc::ParaLine::outProlog( os() ); } void MifDoc::endParaLine() { MifDoc::ParaLine::outEpilog( os() ); } void MifDoc::outPageNumber() { os() << '\n' << MifOutputByteStream::INDENT << ">"; } // --------- MifDoc::ElementSet ----------------------------------------------- MifDoc::ElementSet::ElementSet() {} int MifDoc::ElementSet::bookComponentIndex( unsigned long groveIndex, unsigned long n ) const { unsigned short flags; if( getFlags( groveIndex, n, flags ) ) return int( flags & BOOK_COMPONENT_INDEX_M() ); assert( false ); return 0; } int MifDoc::ElementSet::bookComponentIndex ( unsigned long groveIndex, const StringC &sgmlId ) { SgmlIdInfo &sgmlIdInfo = enforceSgmlId( sgmlId, groveIndex ); return int( sgmlIdInfo.flags & BOOK_COMPONENT_INDEX_M() ); } void MifDoc::ElementSet::setBookComponentIndex ( unsigned long groveIndex, unsigned long n, int i ) { unsigned short flags = 0; getFlags( groveIndex, n, flags ); add( groveIndex, n, ( flags & LINK_TYPE_MASK( AnyReference ) ) | (unsigned short)( i & BOOK_COMPONENT_INDEX_M() ) ); } void MifDoc::ElementSet::setBookComponentIndex ( unsigned long groveIndex, const StringC &sgmlId, int i ) { SgmlIdInfo &sgmlIdInfo = enforceSgmlId( sgmlId, groveIndex ); unsigned short flags = sgmlIdInfo.flags; sgmlIdInfo.flags = ( flags & LINK_TYPE_MASK( AnyReference ) ) | (unsigned short)( i & BOOK_COMPONENT_INDEX_M() ); } bool MifDoc::ElementSet::hasBeenReferenced ( ReferenceType refType, unsigned long groveIndex, unsigned long n ) const { unsigned short flags = 0; getFlags( groveIndex, n, flags ); return ( flags & LINK_TYPE_MASK( refType ) ) != 0 ? true : false; } bool MifDoc::ElementSet::hasBeenReferenced ( ReferenceType refType, unsigned long groveIndex, const StringC &sgmlId ) { SgmlIdInfo &sgmlIdInfo = enforceSgmlId( sgmlId, groveIndex ); return ( sgmlIdInfo.flags & LINK_TYPE_MASK( refType ) ) != 0 ? true : false; } MifDoc::ElementSet::SgmlIdInfo &MifDoc::ElementSet::enforceSgmlId ( const StringC &sgmlId, unsigned long groveIndex ) { SgmlIdInfo *result = SgmlIdInfos.lookup( sgmlId ); if( result == NULL ) { result = new SgmlIdInfo( sgmlId, groveIndex ); SgmlIdInfos.insert( result ); } return *result; } void MifDoc::ElementSet::setReferencedFlag ( ReferenceType refType, unsigned long groveIndex, unsigned long n ) { assert( refType != AnyReference ); unsigned short flags = 0; getFlags( groveIndex, n, flags ); add( groveIndex, n, flags | LINK_TYPE_MASK( refType ) ); } void MifDoc::ElementSet::setReferencedFlag ( ReferenceType refType, unsigned long groveIndex, const StringC &sgmlId ) { SgmlIdInfo &sgmlIdInfo = enforceSgmlId( sgmlId, groveIndex ); assert( refType != AnyReference ); sgmlIdInfo.flags |= LINK_TYPE_MASK( refType ); } void MifDoc::ElementSet::add ( unsigned long groveIndex, unsigned long n, unsigned short flags ) { if( groveIndex >= Flags.size() ) Flags.resize( groveIndex + 1 ); Vector &elems = Flags[groveIndex]; if( n >= elems.size() ) { for( size_t k = 1 + (n - elems.size()); k > 0; --k ) elems.push_back(0); } elems[n] = flags; } bool MifDoc::ElementSet::getFlags ( unsigned long groveIndex, unsigned long n, unsigned short &result ) const { if( groveIndex < Flags.size() && n < Flags[groveIndex].size() ) { result = Flags[groveIndex][n]; return true; } else return false; } #ifdef DSSSL_NAMESPACE } #endif #include "MifFOTBuilder_inst.cxx" #endif /* JADE_MIF */ OpenJade-1.4devel/jade/SgmlFOTBuilder.h0000644000021000000240000000071407025631165013370 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef SgmlFOTBuilder_INCLUDED #define SgmlFOTBuilder_INCLUDED 1 #include "FOTBuilder.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder *makeSgmlFOTBuilder(OutputCharStream *, const FOTBuilder::Description *&); #ifdef DSSSL_NAMESPACE } #endif #endif /* not SgmlFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/RtfFOTBuilder.h0000644000021000000240000000124207025631164013215 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef RtfFOTBuilder_INCLUDED #define RtfFOTBuilder_INCLUDED 1 #include #include "FOTBuilder.h" #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder * makeRtfFOTBuilder(OutputByteStream *, const Vector &options, const Ptr &, const CharsetInfo &, Messenger *, const FOTBuilder::Description *&); #ifdef DSSSL_NAMESPACE } #endif #endif /* not RtfFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/HtmlFOTBuilder.h0000644000021000000240000000101007025631163013356 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #ifndef HtmlFOTBuilder_INCLUDED #define HtmlFOTBuilder_INCLUDED 1 #include "FOTBuilder.h" #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder *makeHtmlFOTBuilder(const String &basename, CmdLineApp *app, const FOTBuilder::Description *&); #ifdef DSSSL_NAMESPACE } #endif #endif /* not HtmlFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/TeXFOTBuilder.h0000644000021000000240000000102607025631166013164 // This is a -*-c++-*- header. // TeXFOTBuilder.h: a generic TeX backend for Jade. // Written by David Megginson #ifndef TeXFOTBuilder_INCLUDED #define TeXFOTBuilder_INCLUDED 1 #include #include "FOTBuilder.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder *makeTeXFOTBuilder(OutputByteStream *, Messenger *, const FOTBuilder::Description *&); #ifdef DSSSL_NAMESPACE } #endif #endif /* not TeXFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/TransformFOTBuilder.h0000644000021000000240000000100107025631166014430 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #ifndef TransformFOTBuilder_INCLUDED #define TransformFOTBuilder_INCLUDED 1 #include "FOTBuilder.h" #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder *makeTransformFOTBuilder(CmdLineApp *app, bool xml, const Vector &options, const FOTBuilder::Description *&); #ifdef DSSSL_NAMESPACE } #endif #endif /* not TransformFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/MifFOTBuilder.h0000644000021000000240000000122607025631164013177 // Jade MIF backend // Copyright (c) 1997,1998 Kathleen Marszalek // Version 1.0a // Date: March 27th, 1998 #ifndef MifFOTBuilder_INCLUDED #define MifFOTBuilder_INCLUDED 1 #include "FOTBuilder.h" #include #include #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif FOTBuilder * makeMifFOTBuilder(const String &fileLoc, const Ptr &, const CharsetInfo &, CmdLineApp *app, const FOTBuilder::Description *&descr); #ifdef DSSSL_NAMESPACE } #endif #endif /* not MifFOTBuilder_INCLUDED */ OpenJade-1.4devel/jade/JadeMessages.h0000444000021000000240000000312507067722115013140 // This file was automatically generated from JadeMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct JadeMessages { // 1000 static const MessageType1 unknownType; // 1001 static const MessageType0 emptyOutputFilename; // 1002 static const MessageType2 cannotOpenOutputError; // 1003 static const MessageType1 tHelp; // 1004 static const MessageType1 oHelp; // 1005 static const MessageFragment file; // 1006 static const MessageFragment outputType; }; const MessageType1 JadeMessages::unknownType( MessageType::error, MessageFragment::xModule, 1000 #ifndef SP_NO_MESSAGE_TEXT ,"unknown output type %1" #endif ); const MessageType0 JadeMessages::emptyOutputFilename( MessageType::error, MessageFragment::xModule, 1001 #ifndef SP_NO_MESSAGE_TEXT ,"empty output filename" #endif ); const MessageType2 JadeMessages::cannotOpenOutputError( MessageType::error, MessageFragment::xModule, 1002 #ifndef SP_NO_MESSAGE_TEXT ,"cannot open output file %1 (%2)" #endif ); const MessageType1 JadeMessages::tHelp( MessageType::info, MessageFragment::xModule, 1003 #ifndef SP_NO_MESSAGE_TEXT ,"Use the backend %1." #endif ); const MessageType1 JadeMessages::oHelp( MessageType::info, MessageFragment::xModule, 1004 #ifndef SP_NO_MESSAGE_TEXT ,"Send output to %1." #endif ); const MessageFragment JadeMessages::file( MessageFragment::xModule, 1005 #ifndef SP_NO_MESSAGE_TEXT ,"FILE" #endif ); const MessageFragment JadeMessages::outputType( MessageFragment::xModule, 1006 #ifndef SP_NO_MESSAGE_TEXT ,"TYPE" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/jade/HtmlMessages.h0000444000021000000240000000070507067722116013203 // This file was automatically generated from HtmlMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct HtmlMessages { // 3000 static const MessageType2 cannotOpenOutputError; }; const MessageType2 HtmlMessages::cannotOpenOutputError( MessageType::error, MessageFragment::xModule, 3000 #ifndef SP_NO_MESSAGE_TEXT ,"cannot open output file %1 (%2)" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/jade/RtfMessages.h0000444000021000000240000000164607067722121013033 // This file was automatically generated from RtfMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct RtfMessages { // 4000 static const MessageType0 nestedTable; // 4001 static const MessageType1 systemIdNotFilename; // 4002 static const MessageType2 cannotEmbedFilename; }; const MessageType0 RtfMessages::nestedTable( MessageType::error, MessageFragment::xModule, 4000 #ifndef SP_NO_MESSAGE_TEXT ,"nested tables are not allowed in RTF" #endif ); const MessageType1 RtfMessages::systemIdNotFilename( MessageType::error, MessageFragment::xModule, 4001 #ifndef SP_NO_MESSAGE_TEXT ,"could not convert system identifier %1 to a single filename" #endif ); const MessageType2 RtfMessages::cannotEmbedFilename( MessageType::error, MessageFragment::xModule, 4002 #ifndef SP_NO_MESSAGE_TEXT ,"could not embed %1 with clsid %2" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/jade/TeXMessages.h0000444000021000000240000000417407067722122013000 // This file was automatically generated from TeXMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct TeXMessages { // 5000 static const MessageType0 unsupportedPageNumberNonElement; // 5001 static const MessageType0 unsupportedLinkNonElement; // 5002 static const MessageType0 unsupportedLinkEntity; // 5003 static const MessageType0 unsupportedLinkSgmlDoc; // 5004 static const MessageType0 unsupportedLinkHyTime; // 5005 static const MessageType0 unsupportedLinkTei; // 5006 static const MessageType0 unsupportedGlyphSubstTable; }; const MessageType0 TeXMessages::unsupportedPageNumberNonElement( MessageType::warning, MessageFragment::xModule, 5000 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support references to page numbers of nodes other than elements" #endif ); const MessageType0 TeXMessages::unsupportedLinkNonElement( MessageType::warning, MessageFragment::xModule, 5001 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support links to nodes other than elements" #endif ); const MessageType0 TeXMessages::unsupportedLinkEntity( MessageType::warning, MessageFragment::xModule, 5002 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support links to entities" #endif ); const MessageType0 TeXMessages::unsupportedLinkSgmlDoc( MessageType::warning, MessageFragment::xModule, 5003 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support links to other SGML documents" #endif ); const MessageType0 TeXMessages::unsupportedLinkHyTime( MessageType::warning, MessageFragment::xModule, 5004 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support HyTime linkends" #endif ); const MessageType0 TeXMessages::unsupportedLinkTei( MessageType::warning, MessageFragment::xModule, 5005 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support TEI links" #endif ); const MessageType0 TeXMessages::unsupportedGlyphSubstTable( MessageType::warning, MessageFragment::xModule, 5006 #ifndef SP_NO_MESSAGE_TEXT ,"TeX backend does not currently support glyph substitution tables" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/jade/MifMessages.h0000444000021000000240000000177007067722123013013 // This file was automatically generated from MifMessages.msg by msggen.pl. #include #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif struct MifMessages { // 7000 static const MessageType2 cannotOpenOutputError; // 7001 static const MessageType1 systemIdNotFilename; // 7002 static const MessageType0 missingTableColumnFlowObject; }; const MessageType2 MifMessages::cannotOpenOutputError( MessageType::error, MessageFragment::xModule, 7000 #ifndef SP_NO_MESSAGE_TEXT ,"cannot open output file %1 (%2)" #endif ); const MessageType1 MifMessages::systemIdNotFilename( MessageType::error, MessageFragment::xModule, 7001 #ifndef SP_NO_MESSAGE_TEXT ,"could not convert system identifier %1 to a single filename" #endif ); const MessageType0 MifMessages::missingTableColumnFlowObject( MessageType::warning, MessageFragment::xModule, 7002 #ifndef SP_NO_MESSAGE_TEXT ,"missing table column flow object (table-auto-width feature not fully supported)" #endif ); #ifdef SP_NAMESPACE } #endif OpenJade-1.4devel/jade/TmpOutputByteStream.h0000644000021000000240000000225507025631166014572 #ifndef TmpOutputByteStream_INCLUDED #define TmpOutputByteStream_INCLUDED 1 #include #include #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef SP_NAMESPACE using namespace SP_NAMESPACE; #endif class TmpOutputByteStream : public OutputByteStream { public: enum { bufSize = 1024 }; struct Block { Block *next; char buf[bufSize]; }; class Iter { public: Iter(const TmpOutputByteStream &sb) : block_(sb.head_), lastBlockUsed_(sb.lastBlockUsed()) { } bool next(const char *&p, size_t &n) { if (block_) { p = block_->buf; n = block_->next ? TmpOutputByteStream::bufSize : lastBlockUsed_; block_ = block_->next; return 1; } else return 0; } private: Block *block_; size_t lastBlockUsed_; }; TmpOutputByteStream(); ~TmpOutputByteStream(); bool isEmpty() { return head_ == 0; } void flush(); void flushBuf(char ch); private: friend class Iter; size_t lastBlockUsed() const { return last_ ? (ptr_ - last_->buf) : 0; } unsigned nFullBlocks_; Block *head_; Block *last_; }; #ifdef DSSSL_NAMESPACE } #endif #endif /* not OutputByteStream_INCLUDED */ OpenJade-1.4devel/jade/JadeMessages.msg0000644000021000000240000000052507067706431013505 # Copyright (c) 1996 James Clark, 1999 Matthias Clasen # See the file COPYING for copying permission =1000 E1+unknownType++unknown output type %1 E0+emptyOutputFilename++empty output filename E2+cannotOpenOutputError++cannot open output file %1 (%2) I1+tHelp++Use the backend %1. I1+oHelp++Send output to %1. +file++FILE +outputType++TYPE OpenJade-1.4devel/jade/JadeMessages.rc0000444000021000000240000000033207067722115013312 STRINGTABLE BEGIN 1000, "unknown output type %1" 1001, "empty output filename" 1002, "cannot open output file %1 (%2)" 1003, "Use the backend %1." 1004, "Send output to %1." 1005, "FILE" 1006, "TYPE" END OpenJade-1.4devel/jade/HtmlMessages.msg0000644000021000000240000000022107025631163013530 # Copyright (c) 1996 James Clark # See the file COPYING for copying permission =3000 E2+cannotOpenOutputError++cannot open output file %1 (%2) OpenJade-1.4devel/jade/HtmlMessages.rc0000444000021000000240000000010007067722116013345 STRINGTABLE BEGIN 3000, "cannot open output file %1 (%2)" END OpenJade-1.4devel/jade/RtfMessages.msg0000644000021000000240000000043107025631164013363 # Copyright (c) 1996 James Clark # See the file COPYING for copying permission =4000 E0+nestedTable++nested tables are not allowed in RTF E1+systemIdNotFilename++could not convert system identifier %1 to a single filename E2+cannotEmbedFilename++could not embed %1 with clsid %2 OpenJade-1.4devel/jade/RtfMessages.rc0000444000021000000240000000026607067722121013205 STRINGTABLE BEGIN 4000, "nested tables are not allowed in RTF" 4001, "could not convert system identifier %1 to a single filename" 4002, "could not embed %1 with clsid %2" END OpenJade-1.4devel/jade/TeXMessages.msg0000644000021000000240000000135607067706431013345 # Copyright (c) 1997 James Clark # See the file COPYING for copying permission =5000 W0+unsupportedPageNumberNonElement++TeX backend does not currently support references to page numbers of nodes other than elements W0+unsupportedLinkNonElement++TeX backend does not currently support links to nodes other than elements W0+unsupportedLinkEntity++TeX backend does not currently support links to entities W0+unsupportedLinkSgmlDoc++TeX backend does not currently support links to other SGML documents W0+unsupportedLinkHyTime++TeX backend does not currently support HyTime linkends W0+unsupportedLinkTei++TeX backend does not currently support TEI links W0+unsupportedGlyphSubstTable++TeX backend does not currently support glyph substitution tables OpenJade-1.4devel/jade/TeXMessages.rc0000444000021000000240000000105407067722122013147 STRINGTABLE BEGIN 5000, "TeX backend does not currently support references to page numbers of nodes other than elements" 5001, "TeX backend does not currently support links to nodes other than elements" 5002, "TeX backend does not currently support links to entities" 5003, "TeX backend does not currently support links to other SGML documents" 5004, "TeX backend does not currently support HyTime linkends" 5005, "TeX backend does not currently support TEI links" 5006, "TeX backend does not currently support glyph substitution tables" END OpenJade-1.4devel/jade/MifMessages.msg0000644000021000000240000000056207067706431013356 # Jade MIF backend # Copyright (c) 1997,1998 Kathleen Marszalek # Version 1.0a # Date: March 27th, 1998 # =7000 # E2+cannotOpenOutputError++cannot open output file %1 (%2) E1+systemIdNotFilename++could not convert system identifier %1 to a single filename W0+missingTableColumnFlowObject++missing table column flow object (table-auto-width feature not fully supported) #OpenJade-1.4devel/jade/MifMessages.rc0000444000021000000240000000034007067722124013161 STRINGTABLE BEGIN 7000, "cannot open output file %1 (%2)" 7001, "could not convert system identifier %1 to a single filename" 7002, "missing table column flow object (table-auto-width feature not fully supported)" END OpenJade-1.4devel/jade/HtmlFOTBuilder_inst.cxx0000644000021000000240000002604007067722124015004 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_4; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_5; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_6; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTable #else #ifdef __xlC__ #pragma define(OwnerTable) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTable; #else typedef OwnerTable Dummy_7; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTable #else #ifdef __xlC__ #pragma define(OwnerTable) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTable; #else typedef OwnerTable Dummy_8; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTable #else #ifdef __xlC__ #pragma define(OwnerTable) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTable; #else typedef OwnerTable Dummy_9; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_10; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_11; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_12; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTableIter #else #ifdef __xlC__ #pragma define(OwnerTableIter) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTableIter; #else typedef OwnerTableIter Dummy_13; #endif #endif #endif #ifdef __DECCXX #pragma define_template OwnerTableIter #else #ifdef __xlC__ #pragma define(OwnerTableIter) #else #ifdef SP_ANSI_CLASS_INST template class OwnerTableIter; #else typedef OwnerTableIter Dummy_14; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTableIter #else #ifdef __xlC__ #pragma define(PointerTableIter) #else #ifdef SP_ANSI_CLASS_INST template class PointerTableIter; #else typedef PointerTableIter Dummy_15; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTableIter #else #ifdef __xlC__ #pragma define(PointerTableIter) #else #ifdef SP_ANSI_CLASS_INST template class PointerTableIter; #else typedef PointerTableIter Dummy_16; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_17; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_18; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_19; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_20; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_21; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_22; #endif #endif #endif #ifdef __DECCXX #pragma define_template IListIter #else #ifdef __xlC__ #pragma define(IListIter) #else #ifdef SP_ANSI_CLASS_INST template class IListIter; #else typedef IListIter Dummy_23; #endif #endif #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/RtfFOTBuilder_inst.cxx0000644000021000000240000001127607067722124014640 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_4; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_5; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_6; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_7; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_8; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_9; #endif #endif #endif #ifdef __DECCXX #pragma define_template HashTableIter #else #ifdef __xlC__ #pragma define(HashTableIter) #else #ifdef SP_ANSI_CLASS_INST template class HashTableIter; #else typedef HashTableIter Dummy_10; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_11; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_12; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > > #else #ifdef __xlC__ #pragma define(Vector > >) #else #ifdef SP_ANSI_CLASS_INST template class Vector > >; #else typedef Vector > > Dummy_13; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_14; #endif #endif #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/TeXFOTBuilder_inst.cxx0000644000021000000240000000406307067722124014601 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif #include "config.h" #define OUTLINES #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_4; #endif #endif #endif #ifdef OUTLINES #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_5; #endif #endif #endif #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/TransformFOTBuilder_inst.cxx0000644000021000000240000000133207067722124016050 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_0; #endif #endif #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/MifFOTBuilder_inst.cxx0000644000021000000240000003042107067722124014611 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif #ifdef SP_NAMESPACE } #endif #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_0; #endif #endif #endif #ifdef __DECCXX #pragma define_template IList #else #ifdef __xlC__ #pragma define(IList) #else #ifdef SP_ANSI_CLASS_INST template class IList; #else typedef IList Dummy_1; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_2; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_3; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_4; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_5; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_6; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_7; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_8; #endif #endif #endif #ifdef __DECCXX #pragma define_template IQueue #else #ifdef __xlC__ #pragma define(IQueue) #else #ifdef SP_ANSI_CLASS_INST template class IQueue; #else typedef IQueue Dummy_9; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_10; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_11; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_12; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_13; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_14; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_15; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_16; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_17; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_18; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_19; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_20; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_21; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_22; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_23; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_24; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_25; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_26; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable, StringHash, MifDoc::Ruling> #else #ifdef __xlC__ #pragma define(PointerTable, StringHash, MifDoc::Ruling>) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable, StringHash, MifDoc::Ruling>; #else typedef PointerTable, StringHash, MifDoc::Ruling> Dummy_27; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTableIter, StringHash, MifDoc::Ruling> #else #ifdef __xlC__ #pragma define(PointerTableIter, StringHash, MifDoc::Ruling>) #else #ifdef SP_ANSI_CLASS_INST template class PointerTableIter, StringHash, MifDoc::Ruling>; #else typedef PointerTableIter, StringHash, MifDoc::Ruling> Dummy_28; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_29; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable, StringHash, MifDoc::Color> #else #ifdef __xlC__ #pragma define(PointerTable, StringHash, MifDoc::Color>) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable, StringHash, MifDoc::Color>; #else typedef PointerTable, StringHash, MifDoc::Color> Dummy_30; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTableIter, StringHash, MifDoc::Color> #else #ifdef __xlC__ #pragma define(PointerTableIter, StringHash, MifDoc::Color>) #else #ifdef SP_ANSI_CLASS_INST template class PointerTableIter, StringHash, MifDoc::Color>; #else typedef PointerTableIter, StringHash, MifDoc::Color> Dummy_31; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_32; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTable #else #ifdef __xlC__ #pragma define(PointerTable) #else #ifdef SP_ANSI_CLASS_INST template class PointerTable; #else typedef PointerTable Dummy_33; #endif #endif #endif #ifdef __DECCXX #pragma define_template PointerTableIter #else #ifdef __xlC__ #pragma define(PointerTableIter) #else #ifdef SP_ANSI_CLASS_INST template class PointerTableIter; #else typedef PointerTableIter Dummy_34; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_35; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_36; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector #else #ifdef __xlC__ #pragma define(Vector) #else #ifdef SP_ANSI_CLASS_INST template class Vector; #else typedef Vector Dummy_37; #endif #endif #endif #ifdef __DECCXX #pragma define_template Vector > #else #ifdef __xlC__ #pragma define(Vector >) #else #ifdef SP_ANSI_CLASS_INST template class Vector >; #else typedef Vector > Dummy_38; #endif #endif #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/HtmlFOTBuilder_inst.m40000644000021000000240000000473507025631163014525 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif __instantiate(IList) __instantiate(IListIter) __instantiate(IList) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector >) __instantiate(Vector >) __instantiate(`OwnerTable') __instantiate(`OwnerTable') __instantiate(`OwnerTable') __instantiate(`PointerTable') __instantiate(`PointerTable') __instantiate(`PointerTable') __instantiate(`OwnerTableIter') __instantiate(`OwnerTableIter') __instantiate(`PointerTableIter') __instantiate(`PointerTableIter') __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(IList) __instantiate(IList) __instantiate(IListIter) __instantiate(IListIter) #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/RtfFOTBuilder_inst.m40000644000021000000240000000205007025631164014341 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector >) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(`HashTableIter') __instantiate(IList) __instantiate(IList) __instantiate(Vector > >) __instantiate(Vector >) #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/TeXFOTBuilder_inst.m40000644000021000000240000000105307025631166014312 #include "config.h" #define OUTLINES #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) #ifdef OUTLINES __instantiate(Vector) #endif #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/TransformFOTBuilder_inst.m40000644000021000000240000000057607025631166015576 // Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #include "config.h" #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif __instantiate(IList) #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/MifFOTBuilder_inst.m40000644000021000000240000000441307025631164014326 #ifdef SP_MANUAL_INST #define SP_DEFINE_TEMPLATES #include #include #include #include #include #undef SP_DEFINE_TEMPLATES #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif __instantiate(IList) __instantiate(IList) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(IQueue) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(`PointerTable, StringHash, MifDoc::Ruling>') __instantiate(`PointerTableIter, StringHash, MifDoc::Ruling>') __instantiate(Vector) __instantiate(`PointerTable, StringHash, MifDoc::Color>') __instantiate(`PointerTableIter, StringHash, MifDoc::Color>') __instantiate(Vector) __instantiate(`PointerTable') __instantiate(`PointerTableIter') __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) __instantiate(Vector >) #ifdef DSSSL_NAMESPACE } #endif #endif /* SP_MANUAL_INST */ OpenJade-1.4devel/jade/jade.dsp0000644000021000000240000003370307025631166012055 # Microsoft Developer Studio Project File - Name="jade" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=jade - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "jade.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "jade.mak" CFG="jade - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "jade - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "jade - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "jade - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir ".\Release" # PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "JADE_HTML" /D "JADE_MIF" /YX /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\style" /I "..\grove" /I "..\spgrove" /D "_CONSOLE" /D "NDEBUG" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /D "JADE_HTML" /D "JADE_MIF" /YX /FD /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\bin\openjade.exe" # SUBTRACT LINK32 /profile /map !ELSEIF "$(CFG)" == "jade - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir ".\Debug" # PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "." # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "." # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "JADE_HTML" /D "JADE_MIF" /YX /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\include" /I "..\style" /I "..\grove" /I "..\spgrove" /D "_CONSOLE" /D "_DEBUG" /D DSSSL_NAMESPACE=James_Clark_DSSSL /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /D "JADE_HTML" /D "JADE_MIF" /YX /FD /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\dbgbin\openjade.exe" # SUBTRACT LINK32 /incremental:no !ENDIF # Begin Target # Name "jade - Win32 Release" # Name "jade - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" # Begin Source File SOURCE=..\dsssl\fot.dtd # End Source File # Begin Source File SOURCE=.\HtmlFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\HtmlFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\HtmlFOTBuilder_inst.m4 InputName=HtmlFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\HtmlFOTBuilder_inst.m4 InputName=HtmlFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\HtmlMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\HtmlMessages.msg InputName=HtmlMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\HtmlMessages.msg InputName=HtmlMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\jade.cxx # End Source File # Begin Source File SOURCE=.\JadeMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\JadeMessages.msg InputName=JadeMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\JadeMessages.msg InputName=JadeMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\MifFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\MifFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\MifFOTBuilder_inst.m4 InputName=MifFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\MifFOTBuilder_inst.m4 InputName=MifFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\MifMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\MifMessages.msg InputName=MifMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\MifMessages.msg InputName=MifMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\RtfFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\RtfFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\RtfFOTBuilder_inst.m4 InputName=RtfFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\RtfFOTBuilder_inst.m4 InputName=RtfFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\RtfMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\RtfMessages.msg InputName=RtfMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\RtfMessages.msg InputName=RtfMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\RtfOle.cxx # End Source File # Begin Source File SOURCE=.\SgmlFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\TeXFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\TeXFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TeXFOTBuilder_inst.m4 InputName=TeXFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TeXFOTBuilder_inst.m4 InputName=TeXFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\TeXMessages.msg !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TeXMessages.msg InputName=TeXMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TeXMessages.msg InputName=TeXMessages "$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" perl -w ..\msggen.pl $(InputPath) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\TextFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\TransformFOTBuilder.cxx # End Source File # Begin Source File SOURCE=.\TransformFOTBuilder_inst.m4 !IF "$(CFG)" == "jade - Win32 Release" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TransformFOTBuilder_inst.m4 InputName=TransformFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ELSEIF "$(CFG)" == "jade - Win32 Debug" # Begin Custom Build - Processing $(InputPath) InputDir=. InputPath=.\TransformFOTBuilder_inst.m4 InputName=TransformFOTBuilder_inst "$(InputDir)\$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" del /f $(InputDir)\$(InputName).cxx perl ..\lib\instmac.pl $(InputPath) >$(InputDir)\$(InputName).cxx attrib +r $(InputDir)\$(InputName).cxx # End Custom Build !ENDIF # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # Begin Source File SOURCE=.\HtmlMessages.h # End Source File # Begin Source File SOURCE=.\JadeMessages.h # End Source File # Begin Source File SOURCE=.\MifFOTBuilder.h # End Source File # Begin Source File SOURCE=.\MifMessages.h # End Source File # Begin Source File SOURCE=.\RtfFOTBuilder.h # End Source File # Begin Source File SOURCE=.\RtfMessages.h # End Source File # Begin Source File SOURCE=.\RtfOle.h # End Source File # Begin Source File SOURCE=.\TeXFOTBuilder.h # End Source File # Begin Source File SOURCE=.\TeXMessages.h # End Source File # Begin Source File SOURCE=.\TmpOutputByteStream.h # End Source File # Begin Source File SOURCE=.\TransformFOTBuilder.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=..\style\DssslAppMessages.rc # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\HtmlMessages.rc # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=..\style\InterpreterMessages.rc # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\jade.rc # ADD BASE RSC /l 0x809 /i "jade" # ADD RSC /l 0x809 /i "." /i "..\style" /i "jade" /d "JADE_MIF" # End Source File # Begin Source File SOURCE=.\JadeMessages.rc # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\RtfMessages.rc # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\TeXMessages.rc # PROP Exclude_From_Build 1 # End Source File # End Group # Begin Source File SOURCE=.\HtmlFOTBuilder_inst.cxx # PROP Ignore_Default_Tool 1 # End Source File # Begin Source File SOURCE=.\MifFOTBuilder_inst.cxx # PROP Ignore_Default_Tool 1 # End Source File # Begin Source File SOURCE=.\RtfFOTBuilder_inst.cxx # PROP Ignore_Default_Tool 1 # End Source File # Begin Source File SOURCE=.\TeXFOTBuilder_inst.cxx # PROP Ignore_Default_Tool 1 # End Source File # Begin Source File SOURCE=.\TransformFOTBuilder_inst.cxx # PROP Ignore_Default_Tool 1 # End Source File # End Target # End Project OpenJade-1.4devel/jade/jade.rc0000644000021000000240000000046307025631166011670 // Copyright (c) 1996 James Clark // See the file copying.txt for copying permission. #include "InterpreterMessages.rc" #include "JadeMessages.rc" #include "DssslAppMessages.rc" #include "HtmlMessages.rc" #include "RtfMessages.rc" #include "TeXMessages.rc" #ifdef JADE_MIF #include "MifMessages.rc" #endif OpenJade-1.4devel/jade/RtfOle.cxx0000644000021000000240000001577607025631165012372 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #include "config.h" #define STRICT #include #include "RtfOle.h" #include "StringC.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif class OleUninitializer { public: OleUninitializer() : enabled_(0) { } ~OleUninitializer() { if (enabled_) ::OleUninitialize(); } void enable() { enabled_ = 1; } bool enabled() const { return enabled_; } private: bool enabled_; }; static OleUninitializer oleUninit; struct ComException { ComException(HRESULT hRes, const char *fn, const char *ifn = 0) : hResult(hRes), functionName(fn), interfaceName(ifn) { } HRESULT hResult; const char *functionName; const char *interfaceName; }; inline void checkCom(HRESULT hRes, const char *functionName, const char *ifn = 0) { if (FAILED(hRes)) throw ComException(hRes, functionName, ifn); } #define COMFUNC(func, args) checkCom(func args, #func) #define COMMETH(obj, iface, meth, args) checkCom((obj)->meth args, #meth, #iface) static const char hexdigits[] = "0123456789ABCDEF"; class MyOleStream : public OLESTREAM { public: MyOleStream(OutputByteStream &os): os_(&os), col_(0) { static OLESTREAMVTBL vtbl = { get, put }; lpstbl = &vtbl; } unsigned long write(const char *p, unsigned long n) { for (size_t i = 0; i < n; i++) { if (col_++ % 64 == 0) *os_ << "\n"; *os_ << hexdigits[(p[i] >> 4) & 0xf] << hexdigits[p[i] & 0xf]; } return n; } private: static DWORD CALLBACK get(LPOLESTREAM, void *, DWORD) { return 0; } static DWORD CALLBACK put(LPOLESTREAM stm, const void *p, DWORD n) { return ((MyOleStream *)stm)->write((const char *)p, n); } unsigned col_; OutputByteStream *os_; }; template class ComPtr { public: ComPtr() : p_(0) { } ComPtr(const ComPtr &cp) : p_(cp) { if (p_) p_->AddRef(); } ~ComPtr() { if (p_) p_->Release(); } void operator=(const ComPtr &cp) { if (cp.p_) cp.p_->AddRef(); if (p_) p_->Release(); p_ = cp.p_; } operator T *() const { return p_; } T *operator->() const { return p_; } // Legal only when p_ is 0. T **operator&() { return &p_; } private: T *p_; }; template class GlobalPtr { public: GlobalPtr(HGLOBAL h) : h_(h), p_((T *)GlobalLock(h)) { } ~GlobalPtr() { if (p_) GlobalUnlock(h_); } operator T *() const { return p_; } T *operator->() const { return p_; } private: GlobalPtr(const GlobalPtr &); void operator=(const GlobalPtr &); T *p_; HGLOBAL h_; }; class StorageMedium : public STGMEDIUM { public: StorageMedium() { pUnkForRelease = 0; tymed = TYMED_NULL; } ~StorageMedium() { ReleaseStgMedium(this); } private: StorageMedium(const StorageMedium &); void operator=(const StorageMedium &); }; static const wchar_t *makeAbsolute(const wchar_t *filename, StringC &buf); int outputObject(const wchar_t *filename, const wchar_t *clsidString, OutputByteStream &os) { try { if (!oleUninit.enabled()) { COMFUNC(OleInitialize, (NULL)); oleUninit.enable(); } StringC buf; filename = makeAbsolute(filename, buf); FORMATETC fmt; fmt.cfFormat = CF_METAFILEPICT; fmt.ptd = 0; fmt.dwAspect = DVASPECT_CONTENT; fmt.lindex = -1; fmt.tymed = TYMED_MFPICT; ComPtr pStorage; #if 0 ComPtr pBytes; COMFUNC(CreateILockBytesOnHGlobal, (0, 1, &pBytes)); COMFUNC(StgCreateDocfileOnILockBytes,(pBytes, STGM_CREATE|STGM_TRANSACTED|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, 0, &pStorage)); #else COMFUNC(StgCreateDocfile,(NULL,STGM_DELETEONRELEASE|STGM_CREATE|STGM_TRANSACTED|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, 0, &pStorage)); #endif ComPtr pPersist; CLSID clsid; if (clsidString && *clsidString) COMFUNC(CLSIDFromString, ((wchar_t *)clsidString, &clsid)); else COMFUNC(GetClassFile, (filename, &clsid)); COMFUNC(CoCreateInstance, (clsid, NULL, CLSCTX_SERVER, IID_IPersistStorage, (void **)&pPersist)); COMMETH(pPersist, IPersistStorage, InitNew, (pStorage)); ComPtr pPersistF; COMMETH(pPersist, IUnknown, QueryInterface, (IID_IPersistFile, (void **)&pPersistF)); COMMETH(pPersistF, IPersistFile, Load, (filename, STGM_READ|STGM_SHARE_DENY_WRITE)); COMFUNC(OleSave, (pPersist, pStorage, 1)); COMMETH(pPersist, IPersistStorage, SaveCompleted, (pStorage)); #if 0 COMFUNC(OleCreateLinkToFile, (filename, IID_IPersistStorage, OLERENDER_FORMAT, &fmt, NULL, // pClientSite pStorage, (void **)&pPersist)); COMFUNC(OleSave, (pPersist, pStorage, 0)); #endif os << "{\\object\\objemb"; os << "{\\*\\objdata"; MyOleStream stm(os); COMFUNC(OleConvertIStorageToOLESTREAM, (pStorage, &stm)); os << "}"; ComPtr pData; COMMETH(pPersist, IUnknown, QueryInterface, (IID_IDataObject, (void **)&pData)); StorageMedium med; COMMETH(pData, IDataObject, GetData, (&fmt, &med)); if (med.tymed != TYMED_MFPICT) { return 0; } GlobalPtr pMeta(med.hMetaFilePict); os << "{\\result"; os << "{\\pict\\wmetafile" << pMeta->mm << "\\picw" << pMeta->xExt << "\\pich" << pMeta->yExt ; UINT n = GetMetaFileBitsEx(pMeta->hMF, 0, 0); if (n == 0) { return 0; } char *s = new char[n]; n = GetMetaFileBitsEx(pMeta->hMF, n, s); if (n == 0) { return 0; } for (size_t i = 0; i < n; i++) { if (i % 64 == 0) os << "\n"; os << hexdigits[(s[i] >> 4) & 0xf] << hexdigits[s[i] & 0xf]; } delete [] s; os << "}"; // pict os << "}"; // result os << "}"; // object } catch (const ComException &) { return 0; } return 1; } static void multiByteToWideChar(const char *mb, StringC &w) { int n = ::MultiByteToWideChar(CP_ACP, 0, mb, -1, 0, 0); w.resize(n); ::MultiByteToWideChar(CP_ACP, 0, mb, -1, &w[0], n); } static void wideCharToMultiByte(const wchar_t *w, String &mb) { int n = ::WideCharToMultiByte(CP_ACP, 0, w, -1, 0, 0, 0, 0); mb.resize(n); ::WideCharToMultiByte(CP_ACP, 0, w, -1, &mb[0], n, 0, 0); } static const wchar_t *makeAbsolute(const wchar_t *filename, StringC &fbuf) { { fbuf.resize(128); Char *tem; int n = GetFullPathNameW(filename, fbuf.size(), &fbuf[0], &tem); if (n > fbuf.size()) { fbuf.resize(n); n = GetFullPathNameW(filename, fbuf.size(), &fbuf[0], &tem); } if (n) { fbuf.resize(n + 1); return fbuf.data(); } } { String mb; wideCharToMultiByte(filename, mb); mb += 0; String buf; buf.resize(128); char *tem; int n = GetFullPathNameA(mb.data(), buf.size(), &buf[0], &tem); if (n > buf.size()) { buf.resize(n); n = GetFullPathNameA(mb.data(), buf.size(), &buf[0], &tem); } if (n) { buf.resize(n + 1); multiByteToWideChar(buf.data(), fbuf); fbuf += 0; return fbuf.data(); } } return filename; } #ifdef DSSSL_NAMESPACE } #endif OpenJade-1.4devel/jade/RtfOle.h0000644000021000000240000000064007025631165011777 // Copyright (c) 1997 James Clark // See the file copying.txt for copying permission. #ifndef RtfOle_INCLUDED #define RtfOle_INCLUDED 1 #include "dsssl_ns.h" #include "OutputByteStream.h" #ifdef DSSSL_NAMESPACE namespace DSSSL_NAMESPACE { #endif int outputObject(const wchar_t *filename, const wchar_t *clsidString, OutputByteStream &os); #ifdef DSSSL_NAMESPACE } #endif #endif /* not RtfOle_INCLUDED */ OpenJade-1.4devel/intl/0000777000021000000240000000000007070410064010553 5OpenJade-1.4devel/intl/VERSION0000644000021000000240000000005107023750665011547 GNU gettext library from gettext-0.10.35 OpenJade-1.4devel/intl/Makefile.in0000644000021000000240000001177307034613450012551 # Makefile for directory with message catalog handling in GNU NLS Utilities. # Copyright (C) 1995 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = $(prefix)/lib includedir = $(prefix)/include datadir = $(prefix)/@DATADIRNAME@ localedir = $(datadir)/locale gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext aliaspath = $(localedir):. subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ AR = ar CC = @CC@ RANLIB = @RANLIB@ DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \ -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = $(COMHDRS) libgettext.h COMHDRS = gettext.h gettextP.h hash-string.h SOURCES = $(COMSRCS) intl-compat.c cat-compat.c COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c OBJECTS = @INTLOBJS@ bindtextdom.o dcgettext.o dgettext.o gettext.o \ finddomain.o loadmsgcat.o localealias.o textdomain.o CATOBJS = cat-compat.o ../po/cat-id-tbl.o GETTOBJS = intl-compat.o DISTFILES.common = Makefile.in linux-msg.sed po2tbl.sed.in \ xopen-msg.sed $(HEADERS) $(SOURCES) DISTFILES = VERSION $(DISTFILES.common) DISTFILES.gettext = $(DISTFILES.common) libintl.glibc libintl.inst .SUFFIXES: .SUFFIXES: .c .o .c.o: $(COMPILE) $< INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib all: libintl.a libintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ ../po/cat-id-tbl.o: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot cd ../po && $(MAKE) cat-id-tbl.o check install: all installcheck: # This installation goal is only used in GNU gettext. Packages which # only use the library should use install instead. # # We must not install the libintl.h/libintl.a files if we are on a system # which has the gettext() function in its C library or in a separate # library. A special case is where configure found a previously installed # GNU gettext library. If you want to use the one which comes with this # version of the package, you have to use `configure --with-gnu-gettext'. install-src: install $(top_srcdir)/mkinstalldirs $(libdir) $(includedir) $(gettextsrcdir) if test -f libintl.h; then \ $(INSTALL_DATA) $(srcdir)/libintl.inst \ $(includedir)/libintl.h; \ $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \ fi cd $(srcdir) && \ for file in $(DISTFILES.common); do \ $(INSTALL_DATA) $$file $(gettextsrcdir)/intl-$$file; \ done $(INSTALL_DATA) VERSION $(gettextsrcdir)/intl-VERSION uninstall: for file in $(DISTFILES); do \ rm -f $(gettextsrcdir)/intl-$$file; \ done info dvi: $(OBJECTS): ../config.h libgettext.h bindtextdom.o finddomain.o loadmsgcat.o: gettextP.h gettext.h dcgettext.o: gettextP.h gettext.h hash-string.h tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.o core core.* clean: mostlyclean distclean: clean rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) distdir: Makefile $(DISTFILES) for file in $(DISTFILES); do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done # This dist goal is only used in GNU gettext. GNU gettext needs not contain # the file `VERSION' but contains some other files which should not be # distributed in other packages. dist-gettext: Makefile $(DISTFILES.gettext) for file in $(DISTFILES.gettext); do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done dist-libc: tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc Makefile: Makefile.in ../config.status cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/intl/linux-msg.sed0000644000021000000240000000520507021006751013111 # po2msg.sed - Convert Uniforum style .po file to Linux style .msg file # Copyright (C) 1995 Free Software Foundation, Inc. # Ulrich Drepper , 1995. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # The first directive in the .msg should be the definition of the # message set number. We use always set number 1. # 1 { i\ $set 1 # Automatically created by po2msg.sed h s/.*/0/ x } # # Mitch's old catalog format does not allow comments. # # We copy the original message as a comment into the .msg file. # /^msgid/ { s/msgid[ ]*"// # # This does not work now with the new format. # /"$/! { # s/\\$// # s/$/ ... (more lines following)"/ # } x # The following nice solution is by # Bruno td # Increment a decimal number in pattern space. # First hide trailing `9' digits. :d s/9\(_*\)$/_\1/ td # Assure at least one digit is available. s/^\(_*\)$/0\1/ # Increment the last digit. s/8\(_*\)$/9\1/ s/7\(_*\)$/8\1/ s/6\(_*\)$/7\1/ s/5\(_*\)$/6\1/ s/4\(_*\)$/5\1/ s/3\(_*\)$/4\1/ s/2\(_*\)$/3\1/ s/1\(_*\)$/2\1/ s/0\(_*\)$/1\1/ # Convert the hidden `9' digits to `0's. s/_/0/g x G s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p } # # The .msg file contains, other then the .po file, only the translations # but each given a unique ID. Starting from 1 and incrementing by 1 for # each message we assign them to the messages. # It is important that the .po file used to generate the cat-id-tbl.c file # (with po-to-tbl) is the same as the one used here. (At least the order # of declarations must not be changed.) # /^msgstr/ { s/msgstr[ ]*"\(.*\)"/# \1/ # Clear substitution flag. tb # Append the next line. :b N # Look whether second part is continuation line. s/\(.*\n\)"\(.*\)"/\1\2/ # Yes, then branch. ta P D # Note that D includes a jump to the start!! # We found a continuation line. But before printing insert '\'. :a s/\(.*\)\(\n.*\)/\1\\\2/ P # We cannot use D here. s/.*\n\(.*\)/\1/ tb } d OpenJade-1.4devel/intl/po2tbl.sed.in0000644000021000000240000000456507021006751013005 # po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets # Copyright (C) 1995 Free Software Foundation, Inc. # Ulrich Drepper , 1995. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # 1 { i\ /* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\ \ #if HAVE_CONFIG_H\ # include \ #endif\ \ #include "libgettext.h"\ \ const struct _msg_ent _msg_tbl[] = { h s/.*/0/ x } # # Write msgid entries in C array form. # /^msgid/ { s/msgid[ ]*\(".*"\)/ {\1/ tb # Append the next line :b N # Look whether second part is continuation line. s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/ # Yes, then branch. ta # Because we assume that the input file correctly formed the line # just read cannot be again be a msgid line. So it's safe to ignore # it. s/\(.*\)\n.*/\1/ bc # We found a continuation line. But before printing insert '\'. :a s/\(.*\)\(\n.*\)/\1\\\2/ P # We cannot use D here. s/.*\n\(.*\)/\1/ # Some buggy seds do not clear the `successful substitution since last ``t''' # flag on `N', so we do a `t' here to clear it. tb # Not reached :c x # The following nice solution is by # Bruno td # Increment a decimal number in pattern space. # First hide trailing `9' digits. :d s/9\(_*\)$/_\1/ td # Assure at least one digit is available. s/^\(_*\)$/0\1/ # Increment the last digit. s/8\(_*\)$/9\1/ s/7\(_*\)$/8\1/ s/6\(_*\)$/7\1/ s/5\(_*\)$/6\1/ s/4\(_*\)$/5\1/ s/3\(_*\)$/4\1/ s/2\(_*\)$/3\1/ s/1\(_*\)$/2\1/ s/0\(_*\)$/1\1/ # Convert the hidden `9' digits to `0's. s/_/0/g x G s/\(.*\)\n\([0-9]*\)/\1, \2},/ s/\(.*\)"$/\1/ p } # # Last line. # $ { i\ };\ g s/0*\(.*\)/int _msg_tbl_length = \1;/p } d OpenJade-1.4devel/intl/xopen-msg.sed0000644000021000000240000000537607021006751013114 # po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file # Copyright (C) 1995 Free Software Foundation, Inc. # Ulrich Drepper , 1995. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # The first directive in the .msg should be the definition of the # message set number. We use always set number 1. # 1 { i\ $set 1 # Automatically created by po2msg.sed h s/.*/0/ x } # # We copy all comments into the .msg file. Perhaps they can help. # /^#/ s/^#[ ]*/$ /p # # We copy the original message as a comment into the .msg file. # /^msgid/ { # Does not work now # /"$/! { # s/\\$// # s/$/ ... (more lines following)"/ # } s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/ p } # # The .msg file contains, other then the .po file, only the translations # but each given a unique ID. Starting from 1 and incrementing by 1 for # each message we assign them to the messages. # It is important that the .po file used to generate the cat-id-tbl.c file # (with po-to-tbl) is the same as the one used here. (At least the order # of declarations must not be changed.) # /^msgstr/ { s/msgstr[ ]*"\(.*\)"/\1/ x # The following nice solution is by # Bruno td # Increment a decimal number in pattern space. # First hide trailing `9' digits. :d s/9\(_*\)$/_\1/ td # Assure at least one digit is available. s/^\(_*\)$/0\1/ # Increment the last digit. s/8\(_*\)$/9\1/ s/7\(_*\)$/8\1/ s/6\(_*\)$/7\1/ s/5\(_*\)$/6\1/ s/4\(_*\)$/5\1/ s/3\(_*\)$/4\1/ s/2\(_*\)$/3\1/ s/1\(_*\)$/2\1/ s/0\(_*\)$/1\1/ # Convert the hidden `9' digits to `0's. s/_/0/g x # Bring the line in the format ` ' G s/^[^\n]*$/& / s/\(.*\)\n\([0-9]*\)/\2 \1/ # Clear flag from last substitution. tb # Append the next line. :b N # Look whether second part is a continuation line. s/\(.*\n\)"\(.*\)"/\1\2/ # Yes, then branch. ta P D # Note that `D' includes a jump to the start!! # We found a continuation line. But before printing insert '\'. :a s/\(.*\)\(\n.*\)/\1\\\2/ P # We cannot use the sed command `D' here s/.*\n\(.*\)/\1/ tb } d OpenJade-1.4devel/intl/gettext.h0000644000021000000240000000614107021006751012326 /* gettext.h - internal header for GNU gettext internationalization functions Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #include #if HAVE_LIMITS_H || _LIBC # include #endif /* @@ end of prolog @@ */ /* The magic number of the GNU message catalog format. */ #define _MAGIC 0x950412de #define _MAGIC_SWAPPED 0xde120495 /* Revision number of the currently used .mo (binary) file format. */ #define MO_REVISION_NUMBER 0 /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but doing that would require that the configure script compile and *run* the resulting executable. Locally running cross-compiled executables is usually not possible. */ #if __STDC__ # define UINT_MAX_32_BITS 4294967295U #else # define UINT_MAX_32_BITS 0xFFFFFFFF #endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ #ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS #endif #if UINT_MAX == UINT_MAX_32_BITS typedef unsigned nls_uint32; #else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short nls_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long nls_uint32; # else /* The following line is intended to throw an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif #endif /* Header for binary .mo file format. */ struct mo_file_header { /* The magic number. */ nls_uint32 magic; /* The revision number of the file format. */ nls_uint32 revision; /* The number of strings pairs. */ nls_uint32 nstrings; /* Offset of table with start offsets of original strings. */ nls_uint32 orig_tab_offset; /* Offset of table with start offsets of translation strings. */ nls_uint32 trans_tab_offset; /* Size of hashing table. */ nls_uint32 hash_tab_size; /* Offset of first hashing entry. */ nls_uint32 hash_tab_offset; }; struct string_desc { /* Length of addressed string. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* @@ begin of epilog @@ */ #endif /* gettext.h */ OpenJade-1.4devel/intl/gettextP.h0000644000021000000240000000355407021006751012453 /* gettextP.h -- header describing internals of gettext library Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H /* @@ end of prolog @@ */ #ifndef __P # if __STDC__ # define __P(args) args # else # define __P(args) () # endif #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif static nls_uint32 SWAP __P ((nls_uint32 i)); static inline nls_uint32 SWAP (i) nls_uint32 i; { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } struct loaded_domain { struct loaded_domain *next; struct loaded_domain *successor[31]; const char *filename; int decided; const char *data; int must_swap; nls_uint32 nstrings; struct string_desc *orig_tab; struct string_desc *trans_tab; nls_uint32 hash_size; nls_uint32 *hash_tab; }; struct binding { struct binding *next; char *domainname; char *dirname; }; struct loaded_domain *_nl_find_domain __P ((const char *__dirname, char *__locale, const char *__domainname)); void _nl_load_domain __P ((struct loaded_domain *__domain)); const char *_nl_expand_alias __P ((const char *__name)); /* @@ begin of epilog @@ */ #endif /* gettextP.h */ OpenJade-1.4devel/intl/hash-string.h0000644000021000000240000000333507021006751013073 /* hash-string - Implements a string hashing function. Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_VALUES_H # include #endif /* @@ end of prolog @@ */ #ifndef __P # if __STDC__ # define __P(Args) Args # else # define __P(Args) () # endif #endif /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ static unsigned long hash_string __P ((const char *__str_param)); static inline unsigned long hash_string (str_param) const char *str_param; { unsigned long int hval, g; const char *str = str_param; /* Compute the hash value for the given string. */ hval = 0; while (*str != '\0') { hval <<= 4; hval += (unsigned long) *str++; g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } OpenJade-1.4devel/intl/libgettext.h0000644000021000000240000001254207021006751013017 /* libgettext.h -- Message catalogs for internationalization. Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Because on some systems (e.g. Solaris) we sometimes have to include the systems libintl.h as well as this file we have more complex include protection above. But the systems header might perhaps also define _LIBINTL_H and therefore we have to protect the definition here. */ #if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H) #if !_LIBINTL_H # define _LIBINTL_H 1 #endif #define _LIBGETTEXT_H 1 /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 #include #if HAVE_LOCALE_H # include #endif #ifdef __cplusplus extern "C" { #endif /* @@ end of prolog @@ */ #ifndef __P # if __STDC__ # define __P(args) args # else # define __P(args) () # endif #endif #ifndef NULL # if !defined __cplusplus || defined __GNUC__ # define NULL ((void *) 0) # else # define NULL (0) # endif #endif #if !HAVE_LC_MESSAGES /* This value determines the behaviour of the gettext() and dgettext() function. But some system does not have this defined. Define it to a default value. */ # define LC_MESSAGES (-1) #endif /* Declarations for gettext-using-catgets interface. Derived from Jim Meyering's libintl.h. */ struct _msg_ent { const char *_msg; int _msg_number; }; #if HAVE_CATGETS /* These two variables are defined in the automatically by po-to-tbl.sed generated file `cat-id-tbl.c'. */ extern const struct _msg_ent _msg_tbl[]; extern int _msg_tbl_length; #endif /* For automatical extraction of messages sometimes no real translation is needed. Instead the string itself is the result. */ #define gettext_noop(Str) (Str) /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ extern char *gettext __P ((const char *__msgid)); extern char *gettext__ __P ((const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ extern char *dgettext __P ((const char *__domainname, const char *__msgid)); extern char *dgettext__ __P ((const char *__domainname, const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ extern char *dcgettext __P ((const char *__domainname, const char *__msgid, int __category)); extern char *dcgettext__ __P ((const char *__domainname, const char *__msgid, int __category)); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ extern char *textdomain __P ((const char *__domainname)); extern char *textdomain__ __P ((const char *__domainname)); /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ extern char *bindtextdomain __P ((const char *__domainname, const char *__dirname)); extern char *bindtextdomain__ __P ((const char *__domainname, const char *__dirname)); #if ENABLE_NLS /* Solaris 2.3 has the gettext function but dcgettext is missing. So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4 has dcgettext. */ # if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) # define gettext(Msgid) \ dgettext (NULL, Msgid) # define dgettext(Domainname, Msgid) \ dcgettext (Domainname, Msgid, LC_MESSAGES) # if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 # define dcgettext(Domainname, Msgid, Category) \ (__extension__ \ ({ \ char *result; \ if (__builtin_constant_p (Msgid)) \ { \ extern int _nl_msg_cat_cntr; \ static char *__translation__; \ static int __catalog_counter__; \ if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ { \ __translation__ = \ dcgettext__ ((Domainname), (Msgid), (Category)); \ __catalog_counter__ = _nl_msg_cat_cntr; \ } \ result = __translation__; \ } \ else \ result = dcgettext__ ((Domainname), (Msgid), (Category)); \ result; \ })) # endif # endif #else # define gettext(Msgid) (Msgid) # define dgettext(Domainname, Msgid) (Msgid) # define dcgettext(Domainname, Msgid, Category) (Msgid) # define textdomain(Domainname) while (0) /* nothing */ # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ #endif /* @@ begin of epilog @@ */ #ifdef __cplusplus } #endif #endif OpenJade-1.4devel/intl/bindtextdom.c0000644000021000000240000001065107021006751013157 /* bindtextdom.c -- implementation of the bindtextdomain(3) function Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #if defined STDC_HEADERS || defined _LIBC # include #else # ifdef HAVE_MALLOC_H # include # else void free (); # endif #endif #if defined HAVE_STRING_H || defined _LIBC # include #else # include #endif #ifdef _LIBC # include #else # include "libgettext.h" #endif #include "gettext.h" #include "gettextP.h" /* @@ end of prolog @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain #else # define BINDTEXTDOMAIN bindtextdomain__ #endif /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (domainname, dirname) const char *domainname; const char *dirname; { struct binding *binding; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') return NULL; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (dirname == NULL) /* The current binding has be to returned. */ return binding == NULL ? (char *) _nl_default_dirname : binding->dirname; if (binding != NULL) { /* The domain is already bound. Replace the old binding. */ char *new_dirname; if (strcmp (dirname, _nl_default_dirname) == 0) new_dirname = (char *) _nl_default_dirname; else { size_t len = strlen (dirname) + 1; new_dirname = (char *) malloc (len); if (new_dirname == NULL) return NULL; memcpy (new_dirname, dirname, len); } if (strcmp (binding->dirname, _nl_default_dirname) != 0) free (binding->dirname); binding->dirname = new_dirname; } else { /* We have to create a new binding. */ size_t len; struct binding *new_binding = (struct binding *) malloc (sizeof (*new_binding)); if (new_binding == NULL) return NULL; len = strlen (domainname) + 1; new_binding->domainname = (char *) malloc (len); if (new_binding->domainname == NULL) return NULL; memcpy (new_binding->domainname, domainname, len); if (strcmp (dirname, _nl_default_dirname) == 0) new_binding->dirname = (char *) _nl_default_dirname; else { len = strlen (dirname) + 1; new_binding->dirname = (char *) malloc (len); if (new_binding->dirname == NULL) return NULL; memcpy (new_binding->dirname, dirname, len); } /* Now enqueue it. */ if (_nl_domain_bindings == NULL || strcmp (domainname, _nl_domain_bindings->domainname) < 0) { new_binding->next = _nl_domain_bindings; _nl_domain_bindings = new_binding; } else { binding = _nl_domain_bindings; while (binding->next != NULL && strcmp (domainname, binding->next->domainname) > 0) binding = binding->next; new_binding->next = binding->next; binding->next = new_binding; } binding = new_binding; } return binding->dirname; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); #endif OpenJade-1.4devel/intl/dcgettext.c0000644000021000000240000003346007021006751012634 /* dcgettext.c -- implemenatation of the dcgettext(3) function Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #ifdef __GNUC__ # define alloca __builtin_alloca #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #if defined STDC_HEADERS || defined _LIBC # include #else char *getenv (); # ifdef HAVE_MALLOC_H # include # else void free (); # endif #endif #if defined HAVE_STRING_H || defined _LIBC # include #else # include #endif #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettext.h" #include "gettextP.h" #ifdef _LIBC # include #else # include "libgettext.h" #endif #include "hash-string.h" /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define getcwd __getcwd # define stpcpy __stpcpy #endif #if !defined HAVE_GETCWD && !defined _LIBC char *getwd (); # define getcwd(buf, max) getwd (buf) #else char *getcwd (); #endif /* Amount to increase buffer size by in each try. */ #define PATH_INCR 32 /* The following is from pathmax.h. */ /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ #if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__)) # include #endif #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 255 #endif #if !defined(PATH_MAX) && defined(_PC_PATH_MAX) # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) #endif /* Don't include sys/param.h if it already has been. */ #if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN) # include #endif #if !defined(PATH_MAX) && defined(MAXPATHLEN) # define PATH_MAX MAXPATHLEN #endif #ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX #endif /* XPG3 defines the result of `setlocale (category, NULL)' as: ``Directs `setlocale()' to query `category' and return the current setting of `local'.'' However it does not specify the exact format. And even worse: POSIX defines this not at all. So we can use this feature only on selected system (e.g. those using GNU C Library). */ #ifdef _LIBC # define HAVE_LOCALE_NULL #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] = "messages"; /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain = _nl_default_default_domain; /* Contains the default location of the message catalogs. */ const char _nl_default_dirname[] = GNULOCALEDIR; /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; /* Prototypes for local functions. */ static char *find_msg __P ((struct loaded_domain *domain, const char *msgid)); static const char *category_to_name __P((int category)); static const char *guess_category_value __P((int category, const char *categoryname)); /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCGETTEXT __dcgettext #else # define DCGETTEXT dcgettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (domainname, msgid, category) const char *domainname; const char *msgid; int category; { struct loaded_domain *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; char *dirname, *xdomainname; char *single_locale; char *retval; /* If no real MSGID is given return NULL. */ if (msgid == NULL) return NULL; /* If DOMAINNAME is NULL, we are interested in the default domain. If CATEGORY is not LC_MESSAGES this might not make much sense but the defintion left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; /* First find matching binding. */ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = (char *) _nl_default_dirname; else if (binding->dirname[0] == '/') dirname = binding->dirname; else { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (binding->dirname) + 1; size_t path_max; char *ret; path_max = (unsigned) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ dirname = (char *) alloca (path_max + dirname_len); errno = 0; while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE) { path_max += PATH_INCR; dirname = (char *) alloca (path_max + dirname_len); errno = 0; } if (ret == NULL) /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ return (char *) msgid; /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if defined _LIBC || defined HAVE_STPCPY stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); #else strcat (dirname, "/"); strcat (dirname, binding->dirname); #endif } /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); categoryvalue = guess_category_value (category, categoryname); xdomainname = (char *) alloca (strlen (categoryname) + strlen (domainname) + 5); /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if defined _LIBC || defined HAVE_STPCPY stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname), ".mo"); #else strcpy (xdomainname, categoryname); strcat (xdomainname, "/"); strcat (xdomainname, domainname); strcat (xdomainname, ".mo"); #endif /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for th translation. */ while (1) { /* Make CATEGORYVALUE point to the next element of the list. */ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ++categoryvalue; if (categoryvalue[0] == '\0') { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation by implicitely appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; } else { char *cp = single_locale; while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') *cp++ = *categoryvalue++; *cp = '\0'; } /* If the current locale value is C (or POSIX) we don't load a domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) return (char *) msgid; /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname); if (domain != NULL) { retval = find_msg (domain, msgid); if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { retval = find_msg (domain->successor[cnt], msgid); if (retval != NULL) break; } } if (retval != NULL) return retval; } } /* NOTREACHED */ } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcgettext, dcgettext); #endif static char * find_msg (domain, msgid) struct loaded_domain *domain; const char *msgid; { size_t top, act, bottom; if (domain->decided == 0) _nl_load_domain (domain); if (domain->data == NULL) return NULL; /* Locate the MSGID and its translation. */ if (domain->hash_size > 2 && domain->hash_tab != NULL) { /* Use the hashing table. */ nls_uint32 len = strlen (msgid); nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len && strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr - 1].offset)) == 0) return (char *) domain->data + W (domain->must_swap, domain->trans_tab[nstr - 1].offset); while (1) { if (idx >= W (domain->must_swap, domain->hash_size) - incr) idx -= W (domain->must_swap, domain->hash_size) - incr; else idx += incr; nstr = W (domain->must_swap, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len && strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr - 1].offset)) == 0) return (char *) domain->data + W (domain->must_swap, domain->trans_tab[nstr - 1].offset); } /* NOTREACHED */ } /* Now we try the default method: binary search in the sorted array of messages. */ bottom = 0; top = domain->nstrings; while (bottom < top) { int cmp_val; act = (bottom + top) / 2; cmp_val = strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[act].offset)); if (cmp_val < 0) top = act; else if (cmp_val > 0) bottom = act + 1; else break; } /* If an translation is found return this. */ return bottom >= top ? NULL : (char *) domain->data + W (domain->must_swap, domain->trans_tab[act].offset); } /* Return string representation of locale CATEGORY. */ static const char *category_to_name (category) int category; { const char *retval; switch (category) { #ifdef LC_COLLATE case LC_COLLATE: retval = "LC_COLLATE"; break; #endif #ifdef LC_CTYPE case LC_CTYPE: retval = "LC_CTYPE"; break; #endif #ifdef LC_MONETARY case LC_MONETARY: retval = "LC_MONETARY"; break; #endif #ifdef LC_NUMERIC case LC_NUMERIC: retval = "LC_NUMERIC"; break; #endif #ifdef LC_TIME case LC_TIME: retval = "LC_TIME"; break; #endif #ifdef LC_MESSAGES case LC_MESSAGES: retval = "LC_MESSAGES"; break; #endif #ifdef LC_RESPONSE case LC_RESPONSE: retval = "LC_RESPONSE"; break; #endif #ifdef LC_ALL case LC_ALL: /* This might not make sense but is perhaps better than any other value. */ retval = "LC_ALL"; break; #endif default: /* If you have a better idea for a default value let me know. */ retval = "LC_XXX"; } return retval; } /* Guess value of current locale from value of the environment variables. */ static const char *guess_category_value (category, categoryname) int category; const char *categoryname; { const char *retval; /* The highest priority value is the `LANGUAGE' environment variable. This is a GNU extension. */ retval = getenv ("LANGUAGE"); if (retval != NULL && retval[0] != '\0') return retval; /* `LANGUAGE' is not set. So we have to proceed with the POSIX methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL return setlocale (category, NULL); #else /* Setting of LC_ALL overwrites all other. */ retval = getenv ("LC_ALL"); if (retval != NULL && retval[0] != '\0') return retval; /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval != NULL && retval[0] != '\0') return retval; /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') return retval; /* We use C as the default domain. POSIX says this is implementation defined. */ return "C"; #endif } OpenJade-1.4devel/intl/dgettext.c0000644000021000000240000000332607021006751012467 /* dgettext.c -- implementation of the dgettext(3) function Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #if defined HAVE_LOCALE_H || defined _LIBC # include #endif #ifdef _LIBC # include #else # include "libgettext.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DGETTEXT __dgettext # define DCGETTEXT __dcgettext #else # define DGETTEXT dgettext__ # define DCGETTEXT dcgettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (domainname, msgid) const char *domainname; const char *msgid; { return DCGETTEXT (domainname, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dgettext, dgettext); #endif OpenJade-1.4devel/intl/gettext.c0000644000021000000240000000356307021006751012326 /* gettext.c -- implementation of gettext(3) function Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # ifdef STDC_HEADERS # include /* Just for NULL. */ # else # ifdef HAVE_STRING_H # include # else # define NULL ((void *) 0) # endif # endif #endif #ifdef _LIBC # include #else # include "libgettext.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define GETTEXT __gettext # define DGETTEXT __dgettext #else # define GETTEXT gettext__ # define DGETTEXT dgettext__ #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * GETTEXT (msgid) const char *msgid; { return DGETTEXT (NULL, msgid); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif OpenJade-1.4devel/intl/finddomain.c0000644000021000000240000003072707021006751012754 /* finddomain.c -- handle list of needed message catalogs Copyright (C) 1995 Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #if defined STDC_HEADERS || defined _LIBC # include #else # ifdef HAVE_MALLOC_H # include # else void free (); # endif #endif #if defined HAVE_STRING_H || defined _LIBC # include #else # include #endif #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettext.h" #include "gettextP.h" #ifdef _LIBC # include #else # include "libgettext.h" #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define stpcpy __stpcpy #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_CODESET 8 #define TERRITORY 16 #define CEN_AUDIENCE 32 #define XPG_MODIFIER 64 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_MODIFIER) /* List of already loaded domains. */ static struct loaded_domain *_nl_loaded_domains; /* Prototypes for local functions. */ static struct loaded_domain *make_entry_rec __P ((const char *dirname, int mask, const char *language, const char *territory, const char *codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *domainname, int do_allocate)); /* Substitution for systems lacking this function in their C library. */ #if !_LIBC && !HAVE_STPCPY static char *stpcpy __P ((char *dest, const char *src)); #endif /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_domain * _nl_find_domain (dirname, locale, domainname) const char *dirname; char *locale; const char *domainname; { enum { undecided, xpg, cen } syntax; struct loaded_domain *retval; const char *language; const char *modifier = NULL; const char *territory = NULL; const char *codeset = NULL; const char *special = NULL; const char *sponsor = NULL; const char *revision = NULL; const char *alias_value = NULL; char *cp; int mask; /* CATEGORYVALUE now possibly contains a colon separated list of locales. Each single locale can consist of up to four recognized parts for the XPG syntax: language[_territory[.codeset]][@modifier] and six parts for the CEN syntax: language[_territory][+audience][+special][,sponsor][_revision] Beside the first all of them are allowed to be missing. If the full specified locale is not found, the less specific one are looked for. The various part will be stripped of according to the following order: (1) revision (2) sponsor (3) special (4) codeset (5) territory (6) audience/modifier */ /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL, NULL, NULL, NULL, domainname, 0); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided == 0) _nl_load_domain (retval); /* @@@ */ if (retval->data != NULL) return retval; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt]); if (retval->successor[cnt]->data != NULL) break; } /* We really found some usable information. */ return cnt >= 0 ? retval : NULL; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = 0; syntax = undecided; language = cp = locale; while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@' && cp[0] != '+' && cp[0] != ',') ++cp; if (language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ cp = strchr (language, '\0'); else if (cp[0] == '_') { /* Next is the territory. */ cp[0] = '\0'; territory = ++cp; while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= TERRITORY; if (cp[0] == '.') { /* Next is the codeset. */ syntax = xpg; cp[0] = '\0'; codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; } } if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) { /* Next is the modifier. */ syntax = cp[0] == '@' ? xpg : cen; cp[0] = '\0'; modifier = ++cp; while (syntax == cen && cp[0] != '\0' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= XPG_MODIFIER | CEN_AUDIENCE; } if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) { syntax = cen; if (cp[0] == '+') { /* Next is special application (CEN syntax). */ cp[0] = '\0'; special = ++cp; while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= CEN_SPECIAL; } if (cp[0] == ',') { /* Next is sponsor (CEN syntax). */ cp[0] = '\0'; sponsor = ++cp; while (cp[0] != '\0' && cp[0] != '_') ++cp; mask |= CEN_SPONSOR; } if (cp[0] == '_') { /* Next is revision (CEN syntax). */ cp[0] = '\0'; revision = ++cp; mask |= CEN_REVISION; } } /* For CEN sytnax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { if (territory != NULL && territory[0] == '\0') mask &= ~TERRITORY; if (codeset != NULL && codeset[0] == '\0') mask &= ~XPG_CODESET; if (modifier != NULL && modifier[0] == '\0') mask &= ~XPG_MODIFIER; } /* Create all possible locale entries which might be interested in generalzation. */ retval = make_entry_rec (dirname, mask, language, territory, codeset, modifier, special, sponsor, revision, domainname, 1); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided == 0) _nl_load_domain (retval); if (retval->data == NULL) { int cnt; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt]); if (retval->successor[cnt]->data != NULL) break; /* Signal that locale is not available. */ retval->successor[cnt] = NULL; } if (retval->successor[cnt] == NULL) retval = NULL; } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); return retval; } static struct loaded_domain * make_entry_rec (dirname, mask, language, territory, codeset, modifier, special, sponsor, revision, domain, do_allocate) const char *dirname; int mask; const char *language; const char *territory; const char *codeset; const char *modifier; const char *special; const char *sponsor; const char *revision; const char *domain; int do_allocate; { char *filename = NULL; struct loaded_domain *last = NULL; struct loaded_domain *retval; char *cp; size_t entries; int cnt; /* Process the current entry described by the MASK only when it is valid. Because the mask can have in the first call bits from both syntaces set this is necessary to prevent constructing illegal local names. */ /* FIXME: Rewrite because test is necessary only in first round. */ if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0) { /* Allocate room for the full file name. */ filename = (char *) malloc (strlen (dirname) + 1 + strlen (language) + ((mask & TERRITORY) != 0 ? strlen (territory) : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) : 0) + ((mask & XPG_MODIFIER) != 0 ? strlen (modifier) : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) : 0) + ((mask & CEN_SPONSOR) != 0 ? strlen (sponsor) : 0) + ((mask & CEN_REVISION) != 0 ? strlen (revision) : 0) + 1 + strlen (domain) + 1); if (filename == NULL) return NULL; retval = NULL; last = NULL; /* Construct file name. */ cp = stpcpy (filename, dirname); *cp++ = '/'; cp = stpcpy (cp, language); if ((mask & TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) { /* This component can be part of both syntaces but has different leading characters. For CEN we use `+', else `@'. */ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; cp = stpcpy (cp, modifier); } if ((mask & CEN_SPECIAL) != 0) { *cp++ = '+'; cp = stpcpy (cp, special); } if ((mask & CEN_SPONSOR) != 0) { *cp++ = ','; cp = stpcpy (cp, sponsor); } if ((mask & CEN_REVISION) != 0) { *cp++ = '_'; cp = stpcpy (cp, revision); } *cp++ = '/'; stpcpy (cp, domain); /* Look in list of already loaded domains whether it is already available. */ last = NULL; for (retval = _nl_loaded_domains; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } last = retval; } if (retval != NULL || do_allocate == 0) { free (filename); return retval; } } retval = (struct loaded_domain *) malloc (sizeof (*retval)); if (retval == NULL) return NULL; retval->filename = filename; retval->decided = 0; if (last == NULL) { retval->next = _nl_loaded_domains; _nl_loaded_domains = retval; } else { retval->next = last->next; last->next = retval; } entries = 0; for (cnt = 126; cnt >= 0; --cnt) if (cnt < mask && (cnt & ~mask) == 0 && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)) retval->successor[entries++] = make_entry_rec (dirname, cnt, language, territory, codeset, modifier, special, sponsor, revision, domain, 1); retval->successor[entries] = NULL; return retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif OpenJade-1.4devel/intl/loadmsgcat.c0000644000021000000240000001236107021006751012754 /* loadmsgcat.c -- load needed message catalogs Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #if defined STDC_HEADERS || defined _LIBC # include #endif #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC # include #endif #include "gettext.h" #include "gettextP.h" /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define fstat __fstat # define open __open # define close __close # define read __read # define mmap __mmap # define munmap __munmap #endif /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ int _nl_msg_cat_cntr; /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void _nl_load_domain (domain) struct loaded_domain *domain; { int fd; struct stat st; struct mo_file_header *data = (struct mo_file_header *) -1; #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || defined _LIBC int use_mmap = 0; #endif domain->decided = 1; domain->data = NULL; /* If the record does not represent a valid locale the FILENAME might be NULL. This can happen when according to the given specification the locale file name is different for XPG and CEN syntax. */ if (domain->filename == NULL) return; /* Try to open the addressed file. */ fd = open (domain->filename, O_RDONLY); if (fd == -1) return; /* We must know about the size of the file. */ if (fstat (fd, &st) != 0 && st.st_size < (off_t) sizeof (struct mo_file_header)) { /* Something went wrong. */ close (fd); return; } #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || defined _LIBC /* Now we are ready to load the file. If mmap() is available we try this first. If not available or it failed we try to load it. */ data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (data != (struct mo_file_header *) -1) { /* mmap() call was successful. */ close (fd); use_mmap = 1; } #endif /* If the data is not yet available (i.e. mmap'ed) we try to load it manually. */ if (data == (struct mo_file_header *) -1) { off_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (st.st_size); if (data == NULL) return; to_read = st.st_size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb == -1) { close (fd); return; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); } /* Using the magic number we can test whether it really is a message catalog file. */ if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED) { /* The magic number is wrong: not a message catalog file. */ #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || defined _LIBC if (use_mmap) munmap ((caddr_t) data, st.st_size); else #endif free (data); return; } domain->data = (char *) data; domain->must_swap = data->magic != _MAGIC; /* Fill in the information about the available tables. */ switch (W (domain->must_swap, data->revision)) { case 0: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (struct string_desc *) ((char *) data + W (domain->must_swap, data->trans_tab_offset)); domain->hash_size = W (domain->must_swap, data->hash_tab_size); domain->hash_tab = (nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)); break; default: /* This is an illegal revision. */ #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || defined _LIBC if (use_mmap) munmap ((caddr_t) data, st.st_size); else #endif free (data); domain->data = NULL; return; } /* Show that one domain is changed. This might make some cached translation invalid. */ ++_nl_msg_cat_cntr; } OpenJade-1.4devel/intl/localealias.c0000644000021000000240000001614707021006751013115 /* localealias.c -- handle aliases for locale names Copyright (C) 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef __GNUC__ # define alloca __builtin_alloca #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #if defined STDC_HEADERS || defined _LIBC # include #else char *getenv (); # ifdef HAVE_MALLOC_H # include # else void free (); # endif #endif #if defined HAVE_STRING_H || defined _LIBC # include #else # include #endif #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #include "gettext.h" #include "gettextP.h" /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define strcasecmp __strcasecmp #endif struct alias_map { const char *alias; const char *value; }; static struct alias_map *map; static size_t nmap = 0; static size_t maxmap = 0; /* Prototypes for local functions. */ static size_t read_alias_file __P ((const char *fname, int fname_len)); static void extend_alias_table __P ((void)); static int alias_compare __P ((const struct alias_map *map1, const struct alias_map *map2)); const char * _nl_expand_alias (name) const char *name; { static const char *locale_alias_path = LOCALE_ALIAS_PATH; struct alias_map *retval; size_t added; do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) __P ((const void *, const void *))) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) return retval->value; /* Perhaps we can find another alias file. */ added = 0; while (added == 0 && locale_alias_path[0] != '\0') { const char *start; while (locale_alias_path[0] == ':') ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':') ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); return NULL; } static size_t read_alias_file (fname, fname_len) const char *fname; int fname_len; { FILE *fp; char *full_fname; size_t added; static const char aliasfile[] = "/locale.alias"; full_fname = (char *) alloca (fname_len + sizeof aliasfile); memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); fp = fopen (full_fname, "r"); if (fp == NULL) return 0; added = 0; while (!feof (fp)) { /* It is a reasonable approach to use a fix buffer here because a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long */ char buf[BUFSIZ]; char *alias; char *value; char *cp; if (fgets (buf, BUFSIZ, fp) == NULL) /* EOF reached. */ break; cp = buf; /* Ignore leading white space. */ while (isspace (cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace (cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace (cp[0])) ++cp; if (cp[0] != '\0') { char *tp; size_t len; value = cp++; while (cp[0] != '\0' && !isspace (cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') { /* This has to be done to make the following test for the end of line possible. We are looking for the terminating '\n' which do not overwrite here. */ *cp++ = '\0'; *cp = '\n'; } else if (cp[0] != '\0') *cp++ = '\0'; if (nmap >= maxmap) extend_alias_table (); /* We cannot depend on strdup available in the libc. Sigh! */ len = strlen (alias) + 1; tp = (char *) malloc (len); if (tp == NULL) return added; memcpy (tp, alias, len); map[nmap].alias = tp; len = strlen (value) + 1; tp = (char *) malloc (len); if (tp == NULL) return added; memcpy (tp, value, len); map[nmap].value = tp; ++nmap; ++added; } } /* Possibily not the whole line fitted into the buffer. Ignore the rest of the line. */ while (strchr (cp, '\n') == NULL) { cp = buf; if (fgets (buf, BUFSIZ, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ *cp = '\n'; } } /* Should we test for ferror()? I think we have to silently ignore errors. --drepper */ fclose (fp); if (added > 0) qsort (map, nmap, sizeof (struct alias_map), (int (*) __P ((const void *, const void *))) alias_compare); return added; } static void extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) malloc (new_size * sizeof (struct alias_map)); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return; memcpy (new_map, map, nmap * sizeof (struct alias_map)); if (maxmap != 0) free (map); map = new_map; maxmap = new_size; } static int alias_compare (map1, map2) const struct alias_map *map1; const struct alias_map *map2; { #if defined _LIBC || defined HAVE_STRCASECMP return strcasecmp (map1->alias, map2->alias); #else const unsigned char *p1 = (const unsigned char *) map1->alias; const unsigned char *p2 = (const unsigned char *) map2->alias; unsigned char c1, c2; if (p1 == p2) return 0; do { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ c1 = isupper (*p1) ? tolower (*p1) : *p1; c2 = isupper (*p2) ? tolower (*p2) : *p2; if (c1 == '\0') break; } while (c1 == c2); return c1 - c2; #endif } OpenJade-1.4devel/intl/textdomain.c0000644000021000000240000000554207021006751013015 /* textdomain.c -- implementation of the textdomain(3) function Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #if defined STDC_HEADERS || defined _LIBC # include #endif #if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC # include #else # include #endif #ifdef _LIBC # include #else # include "libgettext.h" #endif /* @@ end of prolog @@ */ /* Name of the default text domain. */ extern const char _nl_default_default_domain[]; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain #else # define TEXTDOMAIN textdomain__ #endif /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ char * TEXTDOMAIN (domainname) const char *domainname; { char *old; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; old = (char *) _nl_current_default_domain; /* If domain name is the null string set to default domain "messages". */ if (domainname[0] == '\0' || strcmp (domainname, _nl_default_default_domain) == 0) _nl_current_default_domain = _nl_default_default_domain; else { /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ size_t len = strlen (domainname) + 1; char *cp = (char *) malloc (len); if (cp != NULL) memcpy (cp, domainname, len); _nl_current_default_domain = cp; } if (old != _nl_default_default_domain) free (old); return (char *) _nl_current_default_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif OpenJade-1.4devel/intl/intl-compat.c0000644000021000000240000000315607021006751013067 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "libgettext.h" /* @@ end of prolog @@ */ #undef gettext #undef dgettext #undef dcgettext #undef textdomain #undef bindtextdomain char * bindtextdomain (domainname, dirname) const char *domainname; const char *dirname; { return bindtextdomain__ (domainname, dirname); } char * dcgettext (domainname, msgid, category) const char *domainname; const char *msgid; int category; { return dcgettext__ (domainname, msgid, category); } char * dgettext (domainname, msgid) const char *domainname; const char *msgid; { return dgettext__ (domainname, msgid); } char * gettext (msgid) const char *msgid; { return gettext__ (msgid); } char * textdomain (domainname) const char *domainname; { return textdomain__ (domainname); } OpenJade-1.4devel/intl/cat-compat.c0000644000021000000240000001413207021006751012664 /* Compatibility code for gettext-using-catgets interface. Copyright (C) 1995 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #ifdef STDC_HEADERS # include # include #else char *getenv (); # ifdef HAVE_MALLOC_H # include # endif #endif #ifdef HAVE_NL_TYPES_H # include #endif #include "libgettext.h" /* @@ end of prolog @@ */ /* The catalog descriptor. */ static nl_catd catalog = (nl_catd) -1; /* Name of the default catalog. */ static const char default_catalog_name[] = "messages"; /* Name of currently used catalog. */ static const char *catalog_name = default_catalog_name; /* Get ID for given string. If not found return -1. */ static int msg_to_cat_id __P ((const char *msg)); /* Substitution for systems lacking this function in their C library. */ #if !_LIBC && !HAVE_STPCPY static char *stpcpy __P ((char *dest, const char *src)); #endif /* Set currently used domain/catalog. */ char * textdomain (domainname) const char *domainname; { nl_catd new_catalog; char *new_name; size_t new_name_len; char *lang; #if HAVE_SETLOCALE && HAVE_LC_MESSAGES && HAVE_SETLOCALE_NULL lang = setlocale (LC_MESSAGES, NULL); #else lang = getenv ("LC_ALL"); if (lang == NULL || lang[0] == '\0') { lang = getenv ("LC_MESSAGES"); if (lang == NULL || lang[0] == '\0') lang = getenv ("LANG"); } #endif if (lang == NULL || lang[0] == '\0') lang = "C"; /* See whether name of currently used domain is asked. */ if (domainname == NULL) return (char *) catalog_name; if (domainname[0] == '\0') domainname = default_catalog_name; /* Compute length of added path element. */ new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang) + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1 + sizeof (".cat"); new_name = (char *) malloc (new_name_len); if (new_name == NULL) return NULL; strcpy (new_name, PACKAGE); new_catalog = catopen (new_name, 0); if (new_catalog == (nl_catd) -1) { /* NLSPATH search didn't work, try absolute path */ sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang, PACKAGE); new_catalog = catopen (new_name, 0); if (new_catalog == (nl_catd) -1) { free (new_name); return (char *) catalog_name; } } /* Close old catalog. */ if (catalog != (nl_catd) -1) catclose (catalog); if (catalog_name != default_catalog_name) free ((char *) catalog_name); catalog = new_catalog; catalog_name = new_name; return (char *) catalog_name; } char * bindtextdomain (domainname, dirname) const char *domainname; const char *dirname; { #if HAVE_SETENV || HAVE_PUTENV char *old_val, *new_val, *cp; size_t new_val_len; /* This does not make much sense here but to be compatible do it. */ if (domainname == NULL) return NULL; /* Compute length of added path element. If we use setenv we don't need the first byts for NLSPATH=, but why complicate the code for this peanuts. */ new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname) + sizeof ("/%L/LC_MESSAGES/%N.cat"); old_val = getenv ("NLSPATH"); if (old_val == NULL || old_val[0] == '\0') { old_val = NULL; new_val_len += 1 + sizeof (LOCALEDIR) - 1 + sizeof ("/%L/LC_MESSAGES/%N.cat"); } else new_val_len += strlen (old_val); new_val = (char *) malloc (new_val_len); if (new_val == NULL) return NULL; # if HAVE_SETENV cp = new_val; # else cp = stpcpy (new_val, "NLSPATH="); # endif cp = stpcpy (cp, dirname); cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:"); if (old_val == NULL) { # if __STDC__ stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat"); # else cp = stpcpy (cp, LOCALEDIR); stpcpy (cp, "/%L/LC_MESSAGES/%N.cat"); # endif } else stpcpy (cp, old_val); # if HAVE_SETENV setenv ("NLSPATH", new_val, 1); free (new_val); # else putenv (new_val); /* Do *not* free the environment entry we just entered. It is used from now on. */ # endif #endif return (char *) domainname; } #undef gettext char * gettext (msg) const char *msg; { int msgid; if (msg == NULL || catalog == (nl_catd) -1) return (char *) msg; /* Get the message from the catalog. We always use set number 1. The message ID is computed by the function `msg_to_cat_id' which works on the table generated by `po-to-tbl'. */ msgid = msg_to_cat_id (msg); if (msgid == -1) return (char *) msg; return catgets (catalog, 1, msgid, (char *) msg); } /* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries for the one equal to msg. If it is found return the ID. In case when the string is not found return -1. */ static int msg_to_cat_id (msg) const char *msg; { int cnt; for (cnt = 0; cnt < _msg_tbl_length; ++cnt) if (strcmp (msg, _msg_tbl[cnt]._msg) == 0) return _msg_tbl[cnt]._msg_number; return -1; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif OpenJade-1.4devel/po/0000777000021000000240000000000007070410066010225 5OpenJade-1.4devel/po/Makefile.in.in0000644000021000000240000001535307070154067012630 # Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. PACKAGE = @OPENJADE_MESSAGE_DOMAIN@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ PERL = @PERL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = $(prefix)/@DATADIRNAME@ localedir = $(datadir)/locale gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext/po subdir = po DESTDIR = INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ MSGMERGE = PATH=../src:$$PATH msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = cat-id-tbl.c POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \ stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) .cvsignore POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ INSTOBJEXT = @INSTOBJEXT@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && $(GENCAT) $@ $*.msg all: all-@USE_NLS@ all-yes: cat-id-tbl.c $(CATALOGS) all-no: $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(PERL) -w ../msggen.pl -p $(PACKAGE).po $(POTFILES) if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \ rm -f $(PACKAGE).po; \ else \ rm -f $(srcdir)/$(PACKAGE).pot \ && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \ fi $(srcdir)/cat-id-tbl.c: stamp-cat-id; @: $(srcdir)/stamp-cat-id: $(PACKAGE).pot rm -f cat-id-tbl.tmp sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ rm cat-id-tbl.tmp; \ else \ echo cat-id-tbl.c changed; \ rm -f $(srcdir)/cat-id-tbl.c; \ mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ fi cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ *.gmo) destdir=$(gnulocaledir);; \ *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $$dir; \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ fi; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ fi; \ if test -r $$cat.m; then \ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ else \ if test -r $(srcdir)/$$cat.m ; then \ $(INSTALL_DATA) $(srcdir)/$$cat.m \ $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ else \ true; \ fi; \ fi; \ done if test "$(PACKAGE)" = "gettext"; then \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(gettextsrcdir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ done rm -f $(gettextsrcdir)/po-Makefile.in.in check: all cat-id-tbl.o: ../intl/libgettext.h dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: update-po $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(PACKAGE).pot PATH=`pwd`/../src:$$PATH; \ cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ mv $$lang.po $$lang.old.po; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ rm -f $$lang.old.po; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$lang.po; \ mv $$lang.old.po $$lang.po; \ fi; \ done POTFILES: POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) Makefile: Makefile.in.in ../config.status POTFILES cd .. \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: OpenJade-1.4devel/po/POTFILES.in0000644000021000000240000000024407021775536011732 jade/HtmlMessages.msg jade/JadeMessages.msg jade/MifMessages.msg jade/RtfMessages.msg jade/TeXMessages.msg style/DssslAppMessages.msg style/InterpreterMessages.msg OpenJade-1.4devel/po/jade.pot0000444000021000000240000003661107070130652011575 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR HOLDER # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2000-03-28 14:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version:: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" msgid "cannot open output file %1 (%2)" msgstr "" msgid "unknown output type %1" msgstr "" msgid "empty output filename" msgstr "" msgid "Use the backend %1." msgstr "" msgid "Send output to %1." msgstr "" msgid "FILE" msgstr "" msgid "TYPE" msgstr "" msgid "could not convert system identifier %1 to a single filename" msgstr "" msgid "missing table column flow object (table-auto-width feature not fully supported)" msgstr "" msgid "nested tables are not allowed in RTF" msgstr "" msgid "could not embed %1 with clsid %2" msgstr "" msgid "TeX backend does not currently support references to page numbers of nodes other than elements" msgstr "" msgid "TeX backend does not currently support links to nodes other than elements" msgstr "" msgid "TeX backend does not currently support links to entities" msgstr "" msgid "TeX backend does not currently support links to other SGML documents" msgstr "" msgid "TeX backend does not currently support HyTime linkends" msgstr "" msgid "TeX backend does not currently support TEI links" msgstr "" msgid "TeX backend does not currently support glyph substitution tables" msgstr "" msgid "%1 version %2" msgstr "" msgid "no DSSSL specification: use -d to specify" msgstr "" msgid "no applicable processing instruction with title %1; available titles: %2" msgstr "" msgid "Options with a \"doc-\"/\"spec-\" prefix apply only to the document/specification." msgstr "" msgid "Enable experimental DSSSL extensions." msgstr "" msgid "Debug mode." msgstr "" msgid "Use DSSSL specification %1." msgstr "" msgid "Use DSSSL specification with title %1." msgstr "" msgid "Pretend that %1 appeared in the specification." msgstr "" msgid "Strict DSSSL compliance mode." msgstr "" msgid "Show open entities in error messages." msgstr "" msgid "Show open elements in error messages." msgstr "" msgid "Show error numbers in error messages." msgstr "" msgid "Show references in error messages." msgstr "" msgid "Define parameter entity %1 as \"INCLUDE\"." msgstr "" msgid "Enable warning %1." msgstr "" msgid "SYSID" msgstr "" msgid "DEFINITION" msgstr "" msgid "NAME" msgstr "" msgid "unexpected end of file" msgstr "" msgid "invalid character" msgstr "" msgid "invalid character after '#'" msgstr "" msgid "unknown #! named constant %1" msgstr "" msgid "unexpected token %1" msgstr "" msgid "string with no closing quote" msgstr "" msgid "missing closing parenthesis" msgstr "" msgid "invalid number %1" msgstr "" msgid "invalid AFII glyph identifier %1" msgstr "" msgid "call of non-function object %1" msgstr "" msgid "too many arguments for function" msgstr "" msgid "odd number of keyword/value arguments" msgstr "" msgid "missing argument for function call" msgstr "" msgid "syntactic keyword %1 used as variable" msgstr "" msgid "reference to undefined variable %1" msgstr "" msgid "no character with name %1" msgstr "" msgid "unknown top level form %1" msgstr "" msgid "bad form %1 in mode group" msgstr "" msgid "identifier %1 already defined in same part" msgstr "" msgid "first definition was here" msgstr "" msgid "loop in specification of value of %1" msgstr "" msgid "argument out of range" msgstr "" msgid "loop in specification of value of unit %1" msgstr "" msgid "bad value specified for unit %1" msgstr "" msgid "unit %1 already defined in same part" msgstr "" msgid "quantity %1 undefined" msgstr "" msgid "incompatible dimensions" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a boolean" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a pair" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a symbol" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a string" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a string or symbol" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a char" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a style" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an exact integer" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a quantity" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a color-space" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a number" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a sosofo" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an optional singleton node list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a singleton node list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a node list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a named node list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a length or length-spec" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol \"force\"" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an address" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-id" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a procedure" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a vector" msgstr "" msgid "root rule already defined in same part with same importance" msgstr "" msgid "initial value already declared for characteristic %1 in same part" msgstr "" msgid "first declaration was here" msgstr "" msgid "%1 is not a valid keyword in a style expression" msgstr "" msgid "%1 is not a valid keyword in a make expression for flow object class %2" msgstr "" msgid "%1 is not the name of any flow object class" msgstr "" msgid "content expression cannot be specified in make expression for atomic flow object class %1" msgstr "" msgid "value for \"label:\" not a symbol" msgstr "" msgid "no port for label %1" msgstr "" msgid "invalid content map" msgstr "" msgid "content map references non-existent port %1" msgstr "" msgid "invalid value for %1 characteristic" msgstr "" msgid "no clause in cond expression matched" msgstr "" msgid "no clause in case expression matched %1" msgstr "" msgid "expected \"else\" not %1" msgstr "" msgid "sorry, cannot handle unresolvable quantities in datums in case expression" msgstr "" msgid "%1" msgstr "" msgid "division by zero" msgstr "" msgid "procedure does not have %1 keyword argument" msgstr "" msgid "argument not a keyword" msgstr "" msgid "specification document does not have the DSSSL architecture as a base architecture" msgstr "" msgid "specification document did not contain a style-specification-body element" msgstr "" msgid "unknown character name %1" msgstr "" msgid "attempt to use current node when there is none" msgstr "" msgid "attempt to process node in illegal context" msgstr "" msgid "radix must be 2, 8, 10 or 16" msgstr "" msgid "this context requires a sosofo" msgstr "" msgid "this context requires a style object" msgstr "" msgid "procedure can only be used in evaluation of characteristic value" msgstr "" msgid "%1 color requires three arguments" msgstr "" msgid "arguments for %1 color must be numbers" msgstr "" msgid "arguments for %1 color must be in the range 0 to 1" msgstr "" msgid "result of procedure in %1 color must be a number" msgstr "" msgid "unknown color-space family %1" msgstr "" msgid "%1 color-space family does not take any arguments" msgstr "" msgid "invalid parameters for %1 color-space family" msgstr "" msgid "%1 is not a pre-defined inherited characteristic" msgstr "" msgid "invalid number format %1" msgstr "" msgid "invalid character %1 in public identifier" msgstr "" msgid "debug %1" msgstr "" msgid "circular use of specification parts" msgstr "" msgid "no style-specification or external-specification with ID %1" msgstr "" msgid "document did not contain any style-specifications or external-specifications" msgstr "" msgid "table-cell flow object not inside a table" msgstr "" msgid "table-row flow object not inside a table" msgstr "" msgid "no value for node property %1" msgstr "" msgid "value returned by procedure was not a node-list" msgstr "" msgid "called from here" msgstr "" msgid "called from here...(%1 calls omitted)" msgstr "" msgid "node processing loop detected" msgstr "" msgid "unquote-splicing expression does not evaluate to a list" msgstr "" msgid "object is read-only" msgstr "" msgid "assignment to top-level variable %1" msgstr "" msgid "invalid call to continuation" msgstr "" msgid "empty generic identifier in pattern" msgstr "" msgid "pattern is not a list" msgstr "" msgid "%1 cannot be used as a generic identifier in a pattern" msgstr "" msgid "%1 cannot occur in a pattern" msgstr "" msgid "value missing for qualifier in pattern" msgstr "" msgid "unknown pattern qualifier %1" msgstr "" msgid "bad value %1 for %2 qualifier in pattern" msgstr "" msgid "repeat qualifier not allowed inside children qualifier" msgstr "" msgid "bad value for attributes qualifier in pattern" msgstr "" msgid "characteristic %1 applied in style rule with same specificity" msgstr "" msgid "other style rule is here" msgstr "" msgid "node matches more than one pattern with the same specificity" msgstr "" msgid "reference to uninitialized variable %1" msgstr "" msgid "circular use of actual value of characteristic %1" msgstr "" msgid "characteristic %1 already defined in same part" msgstr "" msgid "flow object class %1 already defined in same part" msgstr "" msgid "mode %1 not defined" msgstr "" msgid "duplicate character name %1" msgstr "" msgid "duplicate SDATA entity name %1" msgstr "" msgid "duplicate SDATA entity text %1" msgstr "" msgid "unsupported declaration will be ignored" msgstr "" msgid "unsupported character repertoire %1 will be ignored" msgstr "" msgid "error in declaration element" msgstr "" msgid "%1 is not a valid identifier" msgstr "" msgid "error in language definition" msgstr "" msgid "no current language" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a language" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a positive integer" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an integer" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a keyword" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an alist" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a list of characters" msgstr "" msgid "%2 argument for primitive %1 has wrong length" msgstr "" msgid "quantity %1 can't be represented exactly" msgstr "" msgid "default language already declared in this part" msgstr "" msgid "%1 not a language as required in a default-language-declaration" msgstr "" msgid "%1 not a valid unit name" msgstr "" msgid "%1 not a valid character name" msgstr "" msgid "%1 not a valid character number" msgstr "" msgid "unknown character property %1" msgstr "" msgid "error in character property declaration" msgstr "" msgid "character property %1 already declared in same part" msgstr "" msgid "added value for character property %1 already declared in same part" msgstr "" msgid "previous declaration was here" msgstr "" msgid "value returned by procedure was not a sosofo" msgstr "" msgid "loop in specification of value of character property %1" msgstr "" msgid "value for character property %1 of wrong type: %2 not an integer" msgstr "" msgid "value for character property %1 of wrong type: %2 not an integer or the value \"#f\"" msgstr "" msgid "%1 not a style or transformation language feature" msgstr "" msgid "undeclared use of feature %1" msgstr "" msgid "feature %1 not supported" msgstr "" msgid "feature %1 only partially supported" msgstr "" msgid "only allowed in style language" msgstr "" msgid "only allowed in transformation language" msgstr "" msgid "style and transformation language parts mixed" msgstr "" msgid "specification is marked as partial" msgstr "" msgid "grove plan excluding module %1 not supported" msgstr "" msgid "grove plan including module %1 not supported" msgstr "" msgid "%1 not an SGML property set module" msgstr "" msgid "Function for char-map characteristic returned non-char object %2 for character %1" msgstr "" msgid "value for character property %1 of wrong type: %2 not a public identifier or the value \"#f\"" msgstr "" msgid "variable %1 occurs more than once in bindings" msgstr "" msgid "exactly one of node:, subgrove: and class: needed" msgstr "" msgid "add:, null:, remove:, children:, sub: make no sense with subgrove:" msgstr "" msgid "remove: makes no sense with class:" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec" msgstr "" msgid "wrong type: %1 not a list of create-specs" msgstr "" msgid "wrong type: %1 not a create-spec or list of create-specs" msgstr "" msgid "query expression: %1 not a node list" msgstr "" msgid "priority expression: %1 not an exact integer" msgstr "" msgid "flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence" msgstr "" msgid "current flow parent has no principal port" msgstr "" msgid "this flow object requires a paragraph as an ancestor flow object" msgstr "" msgid "flow object not accepted by port; only inline flow objects accepted" msgstr "" msgid "flow object not accepted by port; only display flow objects accepted" msgstr "" msgid "flow object not accepted by port; only display or inline flow objects accepted" msgstr "" msgid "flow object not accepted in a paragraph; only inline, display or paragraph-break flow objects accepted" msgstr "" msgid "a side-by-side flow object only accepts side-by-side-item flow objects as children" msgstr "" msgid "flow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects accepted" msgstr "" msgid "flow object not accepted by port; must be grid-cell" msgstr "" msgid "flow object not accepted by port; only a single character flow object accepted" msgstr "" msgid "flow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowed" msgstr "" msgid "flow object not accepted by port; only table-row or table-cell flow objects accepted" msgstr "" msgid "flow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowd" msgstr "" msgid "flow object not accepted by port; only table-cell flow objects accepted" msgstr "" msgid "priority-expression must be a number" msgstr "" msgid "query-expression must be a node-list" msgstr "" msgid "Sorry, non-integral priorities not implemented" msgstr "" OpenJade-1.4devel/po/stamp-cat-id0000644000021000000240000000001207070130655012343 timestamp OpenJade-1.4devel/po/de.po0000644000021000000240000007002107070410065011070 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR HOLDER # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2000-03-28 14:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version:: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" msgid "cannot open output file %1 (%2)" msgstr "Ausgabedatei %1 kann nicht geöffnet werden (%2)" msgid "unknown output type %1" msgstr "Unbekannter Ausgabetyp %1" msgid "empty output filename" msgstr "Leerer Ausgabedateiname" msgid "Use the backend %1." msgstr "" #, fuzzy msgid "Send output to %1." msgstr "Unbekannter Ausgabetyp %1" msgid "FILE" msgstr "" msgid "TYPE" msgstr "" msgid "could not convert system identifier %1 to a single filename" msgstr "Konnte Systembezeichner %1 nicht in einzelnen Dateinamen konvertieren" #, fuzzy msgid "" "missing table column flow object (table-auto-width feature not fully " "supported)" msgstr "" "Fehlendes Tabellenspalten-Flußobjekt (table-auto-width Feature nicht " "vollständig unterstützt)" msgid "nested tables are not allowed in RTF" msgstr "Verschachtelte Tabellen sind in RTF nicht erlaubt" msgid "could not embed %1 with clsid %2" msgstr "Konnte %1 nicht mit clsid %2 einbetten" msgid "" "TeX backend does not currently support references to page numbers of nodes " "other than elements" msgstr "" "TeX Ausgabe unterstützt Querverweise auf Seitenzahlen nur für Elementknoten" msgid "" "TeX backend does not currently support links to nodes other than elements" msgstr "TeX Ausgabe unterstützt Verknüpfungen nur für Elementknoten" msgid "TeX backend does not currently support links to entities" msgstr "TeX Ausgabe unterstützt keine Verknüpfungen auf Entitäten" msgid "TeX backend does not currently support links to other SGML documents" msgstr "TeX Ausgabe unterstützt keine Verknüpfungen auf andere SGML Dokumente" msgid "TeX backend does not currently support HyTime linkends" msgstr "TeX Ausgabe unterstützt keine HyTime Verknüpfungsenden" msgid "TeX backend does not currently support TEI links" msgstr "TeX Ausgabe unterstützt keine TEI Verknüpfungen" msgid "TeX backend does not currently support glyph substitution tables" msgstr "TeX Ausgabe unterstützt keine Glyphersetzungstabellen" msgid "%1 version %2" msgstr "%1 Version %2" msgid "no DSSSL specification: use -d to specify" msgstr "Keine DSSSL Spezifikation: verwende -d, um sie zu spezifizieren" msgid "" "no applicable processing instruction with title %1; available titles: %2" msgstr "" msgid "" "Options with a \"doc-\"/\"spec-\" prefix apply only to the " "document/specification." msgstr "" msgid "Enable experimental DSSSL extensions." msgstr "" msgid "Debug mode." msgstr "" #, fuzzy msgid "Use DSSSL specification %1." msgstr "Keine DSSSL Spezifikation: verwende -d, um sie zu spezifizieren" #, fuzzy msgid "Use DSSSL specification with title %1." msgstr "Keine DSSSL Spezifikation: verwende -d, um sie zu spezifizieren" msgid "Pretend that %1 appeared in the specification." msgstr "" msgid "Strict DSSSL compliance mode." msgstr "" msgid "Show open entities in error messages." msgstr "" msgid "Show open elements in error messages." msgstr "" msgid "Show error numbers in error messages." msgstr "" msgid "Show references in error messages." msgstr "" msgid "Define parameter entity %1 as \"INCLUDE\"." msgstr "" msgid "Enable warning %1." msgstr "" msgid "SYSID" msgstr "" msgid "DEFINITION" msgstr "" msgid "NAME" msgstr "" msgid "unexpected end of file" msgstr "Unerwartetes Ende der Datei" msgid "invalid character" msgstr "Ungültiges Zeichen" msgid "invalid character after '#'" msgstr "Ungültiges Zeichen nach '#'" msgid "unknown #! named constant %1" msgstr "Unbekannte #! benannte Konstante %1" msgid "unexpected token %1" msgstr "Unerwartetes Token %1" msgid "string with no closing quote" msgstr "Zeichenkette ohne abschließendes Anführungszeichen" msgid "missing closing parenthesis" msgstr "Fehlende schließende Klammer" msgid "invalid number %1" msgstr "Ungültige Zahl %1" msgid "invalid AFII glyph identifier %1" msgstr "Ungültiger AFII Glyphbezeichner %1" msgid "call of non-function object %1" msgstr "Aufruf des nicht-Funktionsobjektes %1" msgid "too many arguments for function" msgstr "Zu viele Argumente für Funktion" msgid "odd number of keyword/value arguments" msgstr "Ungerade Anzahl von Schlüsselwort/Wert Argumenten" msgid "missing argument for function call" msgstr "Fehlendes Argument für Funktionsaufruf" msgid "syntactic keyword %1 used as variable" msgstr "Syntaktisches Schlüsselwort %1 als Variable benutzt" msgid "reference to undefined variable %1" msgstr "Referenz auf undefinierte Variable %1" msgid "no character with name %1" msgstr "Kein Zeichen mit Namen %1" msgid "unknown top level form %1" msgstr "Unbekannte Top-Level Form %1" msgid "bad form %1 in mode group" msgstr "Schlechte Form %1 in Modusgruppe" msgid "identifier %1 already defined in same part" msgstr "Bezeichner %1 bereits im selben Teil definiert" msgid "first definition was here" msgstr "erste Definition war hier" msgid "loop in specification of value of %1" msgstr "Schleife in der Spezifikation des Wertes von %1" msgid "argument out of range" msgstr "Argument außerhalb des zulässigen Bereichs" msgid "loop in specification of value of unit %1" msgstr "Schleife in der Spezifikation des Wertes der Einheit %1" msgid "bad value specified for unit %1" msgstr "Schlechter Wert für Einheit %1 spezifiziert" msgid "unit %1 already defined in same part" msgstr "Einheit %1 bereits im selben Teil definiert" msgid "quantity %1 undefined" msgstr "Quantität %1 undefiniert" msgid "incompatible dimensions" msgstr "Inkompatible Dimensionen" msgid "%2 argument for primitive %1 of wrong type: %3 not a boolean" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein boolescher Wert" msgid "%2 argument for primitive %1 of wrong type: %3 not a pair" msgstr "%2 Argument für Funktion %1 vom falschen Type: %3 ist kein Paar" msgid "%2 argument for primitive %1 of wrong type: %3 not a list" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Liste" msgid "%2 argument for primitive %1 of wrong type: %3 not a symbol" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Symbol" msgid "%2 argument for primitive %1 of wrong type: %3 not a string" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Zeichenkette" msgid "%2 argument for primitive %1 of wrong type: %3 not a string or symbol" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder Zeichenkette noch " "Symbol" msgid "%2 argument for primitive %1 of wrong type: %3 not a char" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Zeichen" msgid "%2 argument for primitive %1 of wrong type: %3 not a style" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Stil" msgid "%2 argument for primitive %1 of wrong type: %3 not an exact integer" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine exakte ganze Zahl" msgid "%2 argument for primitive %1 of wrong type: %3 not a quantity" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Größe" msgid "%2 argument for primitive %1 of wrong type: %3 not a color-space" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Farbraum" msgid "%2 argument for primitive %1 of wrong type: %3 not a number" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Zahl" msgid "%2 argument for primitive %1 of wrong type: %3 not a sosofo" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Sosofo" msgid "" "%2 argument for primitive %1 of wrong type: %3 not an optional singleton " "node list" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine optionale " "Einzelknotenliste" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a singleton node list" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Einzelknotenliste" msgid "%2 argument for primitive %1 of wrong type: %3 not a node list" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Knotenliste" msgid "%2 argument for primitive %1 of wrong type: %3 not a named node list" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine benannte " "Knotenliste" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a length or length-spec" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine Länge noch " "eine Längen-Spezifikation" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine Größe noch " "eine Längen-Spezifikation" msgid "" "%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol " "\"force\"" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine ganze Zahl " "noch das Symbol \"force\"" msgid "%2 argument for primitive %1 of wrong type: %3 not an address" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Adresse" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-id" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Glyphbezeichner" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine " "Glyphersetzungstabelle" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a list of pairs of " "glyph-ids" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Liste von Paaren " "von Glyphbezeichnern" msgid "%2 argument for primitive %1 of wrong type: %3 not a procedure" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Prozedur" msgid "%2 argument for primitive %1 of wrong type: %3 not a vector" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Vektor" msgid "root rule already defined in same part with same importance" msgstr "Root-Regel bereits im selben Teil mit derselben Wichtigkeit definiert" msgid "initial value already declared for characteristic %1 in same part" msgstr "Initialer Wert für Charakteristik %1 bereits im selben Teil deklariert" msgid "first declaration was here" msgstr "erste Deklaration war hier" msgid "%1 is not a valid keyword in a style expression" msgstr "%1 ist kein gültiges Schlüsselwort in einem Stilausdruck" msgid "%1 is not a valid keyword in a make expression for flow object class %2" msgstr "" "%1 ist kein gültiges Schlüsselwort in einem make-Ausdruck für " "Flußobjektklasse %2" msgid "%1 is not the name of any flow object class" msgstr "%1 ist nicht der Name einer Flußobjektklasse" msgid "" "content expression cannot be specified in make expression for atomic flow " "object class %1" msgstr "" "Inhaltsausdruck kann in einem make-Ausdruck für die atomare Flußobjektklasse " "%1 nicht spezifiziert werden" msgid "value for \"label:\" not a symbol" msgstr "Wert für \"label:\" ist kein Symbol" msgid "no port for label %1" msgstr "Kein Port für Label %1" msgid "invalid content map" msgstr "Ungültige Inhaltsabbildung" msgid "content map references non-existent port %1" msgstr "Inhaltsabbildung referenziert nicht existierenden Port %1" msgid "invalid value for %1 characteristic" msgstr "Ungültiger Wert für Charakteristik %1" msgid "no clause in cond expression matched" msgstr "Keine Klausel im cond-Ausdruck traf zu" msgid "no clause in case expression matched %1" msgstr "Keine Klausel im case-Ausdruck passte zu %1" msgid "expected \"else\" not %1" msgstr "Erwartete \"else\", nicht %1" msgid "" "sorry, cannot handle unresolvable quantities in datums in case expression" msgstr "" "Sorry, kann unauflösbare Quantitäten in Datums in case-Ausdrücken nicht " "verarbeiten" msgid "%1" msgstr "%1" msgid "division by zero" msgstr "Teilung durch Null" msgid "procedure does not have %1 keyword argument" msgstr "Prozedur hat kein %1 Schlüsselwortargument" msgid "argument not a keyword" msgstr "Argument ist kein Schlüsselwort" msgid "" "specification document does not have the DSSSL architecture as a base " "architecture" msgstr "Die Spezifikation basiert nicht auf der DSSSL Architektur" msgid "" "specification document did not contain a style-specification-body element" msgstr "Die Spezifikation enthielt kein style-specification-body Element" msgid "unknown character name %1" msgstr "Unbekannter Zeichenname %1" msgid "attempt to use current node when there is none" msgstr "Versuch, den gegenwärtigen Knoten zu benutzen, obwohl es keinen gibt" msgid "attempt to process node in illegal context" msgstr "Versuch, einen Knoten in illegalem Kontext zu verarbeiten" msgid "radix must be 2, 8, 10 or 16" msgstr "Wurzel muß 2, 8, 10 oder 16 sein" msgid "this context requires a sosofo" msgstr "Dieser Kontext benötigt ein Sosofo" msgid "this context requires a style object" msgstr "Dieser Kontext benötigt ein Stilobjekt" msgid "procedure can only be used in evaluation of characteristic value" msgstr "" "Diese Prozedur kann nur in der Auswertung des Wertes einer Charakteristik " "verwendet werden" msgid "%1 color requires three arguments" msgstr "Eine %1 Farbe benötigt drei Argumente" msgid "arguments for %1 color must be numbers" msgstr "Argumente für eine %1 Farbe müssen Zahlen sein" msgid "arguments for %1 color must be in the range 0 to 1" msgstr "Argumente für eine %1 Farbe müssen zwischen 0 und 1 liegen" msgid "result of procedure in %1 color must be a number" msgstr "Ergebnis der Prozedur in einer %1 Farbe muß eine Zahl sein" msgid "unknown color-space family %1" msgstr "Unbekannte Farbraumfamilie %1" msgid "%1 color-space family does not take any arguments" msgstr "Die %1 Farbraumfamilie akzeptiert keine Argumente" msgid "invalid parameters for %1 color-space family" msgstr "Ungültige Parameter für die %1 Farbraumfamilie" msgid "%1 is not a pre-defined inherited characteristic" msgstr "%1 ist keine vordefinierte vererbte Charakteristik" msgid "invalid number format %1" msgstr "Ungültiges Zahlformat %1" msgid "invalid character %1 in public identifier" msgstr "Ungültiges Zeichen in öffentlichem Bezeichner" msgid "debug %1" msgstr "" msgid "circular use of specification parts" msgstr "Zirkuläre Benutzung von Spezifikationsteilen" msgid "no style-specification or external-specification with ID %1" msgstr "Keine style-specification oder external-specificaton mit ID %1" msgid "" "document did not contain any style-specifications or external-specifications" msgstr "" "Das Dokument enthielt weder style-specification noch external-specificaton " "Elemente" msgid "table-cell flow object not inside a table" msgstr "table-cell Flußobjekt nicht innerhalb einer Tabelle" msgid "table-row flow object not inside a table" msgstr "table-row Flußobjekt nicht innerhalb einer Tabelle" msgid "no value for node property %1" msgstr "Kein Wert für Knoteneigenschaft %1" msgid "value returned by procedure was not a node-list" msgstr "Der Rückgabewert der Prozedur war keine Knotenliste" msgid "called from here" msgstr "von hier aufgerufen" msgid "called from here...(%1 calls omitted)" msgstr "von hier aufgerufen...(%1 Aufrufe weggelassen)" msgid "node processing loop detected" msgstr "Knotenverarbeitungsschleife" msgid "unquote-splicing expression does not evaluate to a list" msgstr "unqote-splicing Ausdruck hat keine Liste als Wert" msgid "object is read-only" msgstr "Objekt ist nur lesbar" msgid "assignment to top-level variable %1" msgstr "Zuweisung an Top-Level Variable %1" msgid "invalid call to continuation" msgstr "Ungültiger Aufruf einer Fortsetzung" msgid "empty generic identifier in pattern" msgstr "Leerer generischer Bezeichner in Muster" msgid "pattern is not a list" msgstr "Muster ist keine Liste" msgid "%1 cannot be used as a generic identifier in a pattern" msgstr "" "%1 kann nicht als generischer Bezeichner in einem Muster verwendet werden" msgid "%1 cannot occur in a pattern" msgstr "%1 kann in einem Muster nicht vorkommen" msgid "value missing for qualifier in pattern" msgstr "Im Muster fehlt ein Wert für einen Qualifikator" msgid "unknown pattern qualifier %1" msgstr "Unbekannter Musterqualifikator %1" msgid "bad value %1 for %2 qualifier in pattern" msgstr "Schlechter Wert %1 für Qualifikator %2 im Muster" msgid "repeat qualifier not allowed inside children qualifier" msgstr "repeat Qualifikator nicht innerhalb des children Qualifikators erlaubt" msgid "bad value for attributes qualifier in pattern" msgstr "Schlechter Wert für den attributes Qualifikator im Muster" msgid "characteristic %1 applied in style rule with same specificity" msgstr "Charakteristik %1 in Stilregel mit derselben Spezifizität" msgid "other style rule is here" msgstr "die andere Regel ist hier" msgid "node matches more than one pattern with the same specificity" msgstr "Knoten passt zu meheren Mustern mit derselben Spezifizität" msgid "reference to uninitialized variable %1" msgstr "Referenz auf uninitialisierte Variable %1" msgid "circular use of actual value of characteristic %1" msgstr "Zirkuläre Benutzung des aktuellen Wertes der Charakteristik %1" msgid "characteristic %1 already defined in same part" msgstr "Charakteristik %1 bereits im selben Teil definiert" msgid "flow object class %1 already defined in same part" msgstr "Flußobjektklasse %1 bereits im selben Teil definiert" msgid "mode %1 not defined" msgstr "Modus %1 nicht definiert" msgid "duplicate character name %1" msgstr "Doppelter Zeichenname %1" msgid "duplicate SDATA entity name %1" msgstr "Doppelter SDATA-Entitätsname %1" msgid "duplicate SDATA entity text %1" msgstr "Doppelter SDATA-Entitätstext %1" msgid "unsupported declaration will be ignored" msgstr "Nicht unterstützte Deklaration wird ignoriert" msgid "unsupported character repertoire %1 will be ignored" msgstr "Nicht unterstütztes Zeichenrepertoir %1 wird ignoriert" msgid "error in declaration element" msgstr "Fehler in Deklarationselement" msgid "%1 is not a valid identifier" msgstr "%1 ist kein gültiger Bezeichner" msgid "error in language definition" msgstr "Fehler in Sprachdefinition" msgid "no current language" msgstr "Keine gegenwärtige Sprache" msgid "%2 argument for primitive %1 of wrong type: %3 not a language" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Sprache" msgid "%2 argument for primitive %1 of wrong type: %3 not a positive integer" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine positive ganze " "Zahl" msgid "%2 argument for primitive %1 of wrong type: %3 not an integer" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine ganze Zahl" msgid "%2 argument for primitive %1 of wrong type: %3 not a keyword" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Schlüsselwort" msgid "%2 argument for primitive %1 of wrong type: %3 not an alist" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine alist" msgid "%2 argument for primitive %1 of wrong type: %3 not a list of characters" msgstr "%2 Argument für Funktion %1 vom falschen Typ: %3 ist Zeichenliste" msgid "%2 argument for primitive %1 has wrong length" msgstr "%2 Argument für Funktion %1 hat die falsche Länge" msgid "quantity %1 can't be represented exactly" msgstr "Die Größe %1 kann nicht exakt repräsentiert werden" msgid "default language already declared in this part" msgstr "Standardsprache bereits im selben Teil deklariert" msgid "%1 not a language as required in a default-language-declaration" msgstr "" "%1 ist keine Sprache wie sie in einer default-language-declaration benötigt " "wird" msgid "%1 not a valid unit name" msgstr "%1 ist kein gültiger Einheitsname" msgid "%1 not a valid character name" msgstr "%1 ist kein gültiger Zeichenname" msgid "%1 not a valid character number" msgstr "%1 ist keine gültige Zeichennummer" msgid "unknown character property %1" msgstr "Unbekannte Zeicheneigenschaft %1" msgid "error in character property declaration" msgstr "Fehler in Zeicheneigenschaftsdeklaration" msgid "character property %1 already declared in same part" msgstr "Zeicheneigenschaft %1 bereits im selben Teil deklariert" msgid "added value for character property %1 already declared in same part" msgstr "" "Neuer Wert für Zeicheneigenschaft %1, die bereits im selben Teil deklariert " "war" msgid "previous declaration was here" msgstr "vorige Deklaration war hier" msgid "value returned by procedure was not a sosofo" msgstr "Rückgabewert der Prozedur war kein Sosofo" msgid "loop in specification of value of character property %1" msgstr "Schleife in der Spezifikation des Wertes von Zeicheneigenschaft %1" msgid "value for character property %1 of wrong type: %2 not an integer" msgstr "" "Wert der Zeicheneigenschaft %1 vom falschen Type: %2 ist keine ganze Zahl" msgid "" "value for character property %1 of wrong type: %2 not an integer or the " "value \"#f\"" msgstr "" "Wert der Zeicheneigenschaft %1 vom falschen Type: %2 ist weder eine ganze " "Zahl noch \"#f\"" msgid "%1 not a style or transformation language feature" msgstr "%1 ist kein Feature der Stil- oder Transformationssprache" msgid "undeclared use of feature %1" msgstr "Undeklarierte Benutzung von Feature %1" msgid "feature %1 not supported" msgstr "Feature %1 nicht unterstützt" msgid "feature %1 only partially supported" msgstr "Feature %1 nur teilweise unterstützt" msgid "only allowed in style language" msgstr "Nur in der Stilsprache erlaubt" msgid "only allowed in transformation language" msgstr "Nur in der Transformationssprache erlaubt" msgid "style and transformation language parts mixed" msgstr "Vermischung von Stil- und Transformationssprache" msgid "specification is marked as partial" msgstr "Spezifikation ist als partiell gekennzeichnet" msgid "grove plan excluding module %1 not supported" msgstr "Groveplan ohne Modul %1 nicht unterstützt" msgid "grove plan including module %1 not supported" msgstr "Groveplan mit Modul %1 nicht unterstützt" msgid "%1 not an SGML property set module" msgstr "%1 ist kein Modul der SGML-Eigenschaftsmenge" msgid "" "Function for char-map characteristic returned non-char object %2 for " "character %1" msgstr "" "Die Funktion für die char-map Charakteristik lieferte für das Zeichen %1 das " "nicht-Zeichen %2" msgid "" "value for character property %1 of wrong type: %2 not a public identifier or " "the value \"#f\"" msgstr "" "Wert für Zeicheneigenschaft %1 vom falschen Typ: %2 ist weder ein " "öffentlicher Bezeichner noch \"#f\"" #, fuzzy msgid "variable %1 occurs more than once in bindings" msgstr "Variable %1 kommt mehrfach in den Bindungen vor" msgid "exactly one of node:, subgrove: and class: needed" msgstr "Genau eines von node:, subgrove: und class: benötigt" msgid "add:, null:, remove:, children:, sub: make no sense with subgrove:" msgstr "" "add:, null:, remove:, children: oder sub: machen zusammen mit subgrove: " "keinen Sinn" msgid "remove: makes no sense with class:" msgstr "remove: macht keinen Sinn mit class:" msgid "%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec" msgstr "" "%2 Argument für Funktion %1 vom falschen Typ: %2 ist kein subgrove-spec" msgid "wrong type: %1 not a list of create-specs" msgstr "Falscher Typ: %1 ist keine Liste von create-specs" msgid "wrong type: %1 not a create-spec or list of create-specs" msgstr "Falscher Typ: %1 ist kein create-spec und keine Liste von create-specs" msgid "query expression: %1 not a node list" msgstr "query-Ausdruck: %1 ist keine Knotenliste" msgid "priority expression: %1 not an exact integer" msgstr "Prioritätsausdruck: %1 ist keine exakte ganze Zahl" msgid "" "flow objects at the root must be all of class scroll or all of class " "page-sequence or simple-page-sequence" msgstr "" "Flußobjekte an der Wurzel müssen all der Klasse scroll oder alle den Klassen " "page-sequence oder simple-page-sequence angehören" msgid "current flow parent has no principal port" msgstr "Gegenwärtiger Flußvater hat keinen Hauptport" msgid "this flow object requires a paragraph as an ancestor flow object" msgstr "Dieses Flußobjekt benötigt ein paragraph Flußobjekt als Flußvorgänger" msgid "flow object not accepted by port; only inline flow objects accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur inline Flußobjekte akzeptiert" msgid "flow object not accepted by port; only display flow objects accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur display Flußobjekte akzeptiert" msgid "" "flow object not accepted by port; only display or inline flow objects " "accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur display oder inline Flußobjekte " "akzeptiert" msgid "" "flow object not accepted in a paragraph; only inline, display or " "paragraph-break flow objects accepted" msgstr "" "Flußobjekt nicht innerhalb eines paragraph Flußobjekts akzeptiert: nur " "inline, display oder paragraph-break Flußobjekte akzeptiert" msgid "" "a side-by-side flow object only accepts side-by-side-item flow objects as " "children" msgstr "" "Ein side-by-side Flußobjekt akzeptiert nur side-by-side-item Flußobjekte als " "Kinder" msgid "" "flow object not accepted by port; only math-sequence, unmath, subscript, " "superscript, script, mark, fence, fraction, radical, math-operator, grid, " "character and alignment-point flow objects accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur math-sequence, unmath, subscript, " "superscript, script, mark, fence, fraction, radical, math-operator, grid, " "character und alignment-point Flußobjekte akzeptiert" msgid "flow object not accepted by port; must be grid-cell" msgstr "" "Flußobjekt nicht vom Port akzeptiert: muß ein grid-cell Flußobjekt sein" msgid "" "flow object not accepted by port; only a single character flow object " "accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur ein einzelnes character Flußobjekt " "akzeptiert" msgid "" "flow object not accepted by port; in a table, only either table-part flow " "objects or table-column flow objects followed by table-row or table-cell " "flow objects are allowed" msgstr "" "Flußobjekt nicht vom Port akzeptiert: in einer Tabelle werden entweder nur " "table-part Flußobjekte oder table-column Flußobjekte, gefolgt von table-row " "oder table-column Flußobjekten, akzeptiert" msgid "" "flow object not accepted by port; only table-row or table-cell flow objects " "accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur table-row oder table-cell " "Flußobjekte akzeptiert" msgid "" "flow object not accepted by port; only table-column flow objects followed by " "table-row or table-cell flow objects allowd" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur table-column Flußobjekte, gefolgt " "von table-row oder table-cell Flußobjekten, akzeptiert" msgid "flow object not accepted by port; only table-cell flow objects accepted" msgstr "" "Flußobjekt nicht vom Port akzeptiert: nur table-cell Flußobjekte akzeptiert" #, fuzzy msgid "priority-expression must be a number" msgstr "Prioritätsausdruck: %1 ist keine exakte ganze Zahl" #, fuzzy msgid "query-expression must be a node-list" msgstr "query-Ausdruck: %1 ist keine Knotenliste" msgid "Sorry, non-integral priorities not implemented" msgstr "" #~ msgid "MIF: cannot open output file %1 (%2)" #~ msgstr "Ausgabedatei %1 kann nicht geöffnet werden (%2)" #~ msgid "MIF: could not convert system identifier %1 to a single filename" #~ msgstr "" #~ "Konnte Systembezeichner %1 nicht in einzelnen Dateinamen konvertieren" #~ msgid "TeX backend does not currently support HTML links" #~ msgstr "TeX Ausgabe unterstützt keine HTML Verknüpfungen" #~ msgid "syntactic keyword %1 not valid in call position" #~ msgstr "Syntaktisches Schlüsselwort %1 in Aufrufposition nicht gültig" #~ msgid "symbol required (got %1)" #~ msgstr "Symbol benötigt (fand %1)" #~ msgid "" #~ "%2 argument for primitive %1 of wrong type: %3 neither a string not a symbol" #~ msgstr "" #~ "%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder Zeichenkette noch " #~ "Symbol" #~ msgid "" #~ "%2 argument for primitive %1 of wrong type: %3 not a valid element matching " #~ "pattern" #~ msgstr "" #~ "%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein gültiges " #~ "Elementsuchmuster" #~ msgid "duplicate declaration element (%1)" #~ msgstr "Doppeltes Deklarationselement (%1)" OpenJade-1.4devel/po/sv.po0000644000021000000240000004575007070410065011143 # Swedish translations for OpenJade 1.4. msgid "" msgstr "" "Project-Id-Version: OpenJade 1.4\n" "POT-Creation-Date: 2000-03-28 14:20+0000\n" "PO-Revision-Date: 1999-12-08 23:03+01:00\n" "Last-Translator: Peter Nilsson \n" "Language-Team: Swedish \n" "MIME-Version:: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "POT-Created-Date: 1999-12-08 21:56+0000\n" # HtmlMessages msgid "cannot open output file %1 (%2)" msgstr "kan inte öppna filen %1 för utdata (%2)" # JadeMessages msgid "unknown output type %1" msgstr "okänd utdatatyp %1" msgid "empty output filename" msgstr "tomt filnamn för utdatafilen" msgid "Use the backend %1." msgstr "" # JadeMessages msgid "Send output to %1." msgstr "Skicka utdata till %1." msgid "FILE" msgstr "" msgid "TYPE" msgstr "" msgid "could not convert system identifier %1 to a single filename" msgstr "kan inte göra om systemidentifieraren %1 till ett filnamn" msgid "" "missing table column flow object (table-auto-width feature not fully " "supported)" msgstr "" # RtfMessages msgid "nested tables are not allowed in RTF" msgstr "nästlade tabeller är inte tillåtna i RTF" msgid "could not embed %1 with clsid %2" msgstr "kan inte bädda in %1 med clsid %2" # TeXMessages msgid "" "TeX backend does not currently support references to page numbers of nodes " "other than elements" msgstr "TeX stöder inte ännu sidreferenser till andra noder än element" msgid "" "TeX backend does not currently support links to nodes other than elements" msgstr "TeX stöder inte ännu länkar till andra noder än element" msgid "TeX backend does not currently support links to entities" msgstr "TeX stöder inte ännu länkar till entiteter" msgid "TeX backend does not currently support links to other SGML documents" msgstr "TeX stöder inte ännu länkar till andra SGML-dokument" msgid "TeX backend does not currently support HyTime linkends" msgstr "TeX stöder inte ännu HyTime-länkar" msgid "TeX backend does not currently support TEI links" msgstr "TeX stöder inte ännu TEI-länkar" msgid "TeX backend does not currently support glyph substitution tables" msgstr "TeX stöder inte ännu glyph-ersättningstabeller" # DssslAppMessages msgid "%1 version %2" msgstr "%1 version %2" msgid "no DSSSL specification: use -d to specify" msgstr "ingen DSSSL-specifikation: använd -d för att ange en" msgid "" "no applicable processing instruction with title %1; available titles: %2" msgstr "" msgid "" "Options with a \"doc-\"/\"spec-\" prefix apply only to the " "document/specification." msgstr "" msgid "Enable experimental DSSSL extensions." msgstr "" msgid "Debug mode." msgstr "" msgid "Use DSSSL specification %1." msgstr "Använd DSSSL-specifikation %1." #, fuzzy msgid "Use DSSSL specification with title %1." msgstr "Använd DSSSL-specifikation %1." msgid "Pretend that %1 appeared in the specification." msgstr "" msgid "Strict DSSSL compliance mode." msgstr "" msgid "Show open entities in error messages." msgstr "" msgid "Show open elements in error messages." msgstr "" msgid "Show error numbers in error messages." msgstr "" msgid "Show references in error messages." msgstr "" msgid "Define parameter entity %1 as \"INCLUDE\"." msgstr "" msgid "Enable warning %1." msgstr "" msgid "SYSID" msgstr "" msgid "DEFINITION" msgstr "" msgid "NAME" msgstr "" # InterpreterMessages msgid "unexpected end of file" msgstr "oväntat filslut" msgid "invalid character" msgstr "otillåtet tecken" msgid "invalid character after '#'" msgstr "otillåtet tecken efter \"#\"" msgid "unknown #! named constant %1" msgstr "okänd #!-konstant %1" msgid "unexpected token %1" msgstr "oväntat token %1" msgid "string with no closing quote" msgstr "sträng utan avslutande citattecken" msgid "missing closing parenthesis" msgstr "högerparentes saknas" msgid "invalid number %1" msgstr "ogiltigt tal %1" msgid "invalid AFII glyph identifier %1" msgstr "ogiltig AFFI-glyph-identifierare %1" msgid "call of non-function object %1" msgstr "anrop av objekt som inte är function %1" msgid "too many arguments for function" msgstr "för många argument till funktion" msgid "odd number of keyword/value arguments" msgstr "udda antal nyckelord/värde-argument" msgid "missing argument for function call" msgstr "argument saknas till funktionsanrop" msgid "syntactic keyword %1 used as variable" msgstr "syntaktiskt nyckelord %1 använt som variabel" msgid "reference to undefined variable %1" msgstr "referens till odefinierad variabel %1" msgid "no character with name %1" msgstr "inget tecken med namn %1" msgid "unknown top level form %1" msgstr "okänd toppnivå-form %1" msgid "bad form %1 in mode group" msgstr "otillåten form %1 i mode-grupp" msgid "identifier %1 already defined in same part" msgstr "identifieraren %1 redan definierad i denna del" msgid "first definition was here" msgstr "första definitionen är här" msgid "loop in specification of value of %1" msgstr "specifikation av värde för %1 förorsakar loop" msgid "argument out of range" msgstr "argument ej i giltigt område" msgid "loop in specification of value of unit %1" msgstr "specifikation av värde för måttenheten %1 förorsakar loop" msgid "bad value specified for unit %1" msgstr "felaktigt värde angivet för måttenheten %1" msgid "unit %1 already defined in same part" msgstr "måttenheten %1 redan definierad i denna del" msgid "quantity %1 undefined" msgstr "måttenheten %1 odefinierad" msgid "incompatible dimensions" msgstr "okompatibla dimensioner" msgid "%2 argument for primitive %1 of wrong type: %3 not a boolean" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: %3 är inte ett booleskt värde" msgid "%2 argument for primitive %1 of wrong type: %3 not a pair" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är inte ett par" msgid "%2 argument for primitive %1 of wrong type: %3 not a list" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen lista" msgid "%2 argument for primitive %1 of wrong type: %3 not a symbol" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen symbol" msgid "%2 argument for primitive %1 of wrong type: %3 not a string" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen sträng" msgid "%2 argument for primitive %1 of wrong type: %3 not a string or symbol" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: är ingen sträng eller symbol" msgid "%2 argument for primitive %1 of wrong type: %3 not a char" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är inget tecken" msgid "%2 argument for primitive %1 of wrong type: %3 not a style" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 inget stilobjekt" msgid "%2 argument for primitive %1 of wrong type: %3 not an exact integer" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: %3 är inget exakt heltal" msgid "%2 argument for primitive %1 of wrong type: %3 not a quantity" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen kvantitet" msgid "%2 argument for primitive %1 of wrong type: %3 not a color-space" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: %3 är inte av typen " "color-space" msgid "%2 argument for primitive %1 of wrong type: %3 not a number" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är inget tal" msgid "%2 argument for primitive %1 of wrong type: %3 not a sosofo" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen sosofo" msgid "" "%2 argument for primitive %1 of wrong type: %3 not an optional singleton " "node list" msgstr "" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a singleton node list" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a node list" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen nodlista" msgid "%2 argument for primitive %1 of wrong type: %3 not a named node list" msgstr "" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a length or length-spec" msgstr "" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec" msgstr "" msgid "" "%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol " "\"force\"" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: %3 är inget heltal eller " "symbolen \"force\"" msgid "%2 argument for primitive %1 of wrong type: %3 not an address" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen adress" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-id" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table" msgstr "" msgid "" "%2 argument for primitive %1 of wrong type: %3 not a list of pairs of " "glyph-ids" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a procedure" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen procedur" msgid "%2 argument for primitive %1 of wrong type: %3 not a vector" msgstr "%2 argumentet till primitiven %1 är av fel typ: %3 är ingen vektor" msgid "root rule already defined in same part with same importance" msgstr "" msgid "initial value already declared for characteristic %1 in same part" msgstr "" msgid "first declaration was here" msgstr "" msgid "%1 is not a valid keyword in a style expression" msgstr "" msgid "%1 is not a valid keyword in a make expression for flow object class %2" msgstr "" msgid "%1 is not the name of any flow object class" msgstr "" msgid "" "content expression cannot be specified in make expression for atomic flow " "object class %1" msgstr "" msgid "value for \"label:\" not a symbol" msgstr "" msgid "no port for label %1" msgstr "" msgid "invalid content map" msgstr "" msgid "content map references non-existent port %1" msgstr "" msgid "invalid value for %1 characteristic" msgstr "" msgid "no clause in cond expression matched" msgstr "" msgid "no clause in case expression matched %1" msgstr "" msgid "expected \"else\" not %1" msgstr "väntade \"else\", inte %1" msgid "" "sorry, cannot handle unresolvable quantities in datums in case expression" msgstr "" msgid "%1" msgstr "" msgid "division by zero" msgstr "" msgid "procedure does not have %1 keyword argument" msgstr "" msgid "argument not a keyword" msgstr "" msgid "" "specification document does not have the DSSSL architecture as a base " "architecture" msgstr "" msgid "" "specification document did not contain a style-specification-body element" msgstr "" msgid "unknown character name %1" msgstr "" msgid "attempt to use current node when there is none" msgstr "" msgid "attempt to process node in illegal context" msgstr "" msgid "radix must be 2, 8, 10 or 16" msgstr "" msgid "this context requires a sosofo" msgstr "" msgid "this context requires a style object" msgstr "" msgid "procedure can only be used in evaluation of characteristic value" msgstr "" msgid "%1 color requires three arguments" msgstr "" msgid "arguments for %1 color must be numbers" msgstr "" msgid "arguments for %1 color must be in the range 0 to 1" msgstr "" msgid "result of procedure in %1 color must be a number" msgstr "" msgid "unknown color-space family %1" msgstr "" msgid "%1 color-space family does not take any arguments" msgstr "" msgid "invalid parameters for %1 color-space family" msgstr "" msgid "%1 is not a pre-defined inherited characteristic" msgstr "" msgid "invalid number format %1" msgstr "" msgid "invalid character %1 in public identifier" msgstr "" msgid "debug %1" msgstr "" msgid "circular use of specification parts" msgstr "" msgid "no style-specification or external-specification with ID %1" msgstr "" msgid "" "document did not contain any style-specifications or external-specifications" msgstr "" msgid "table-cell flow object not inside a table" msgstr "" msgid "table-row flow object not inside a table" msgstr "" msgid "no value for node property %1" msgstr "" msgid "value returned by procedure was not a node-list" msgstr "" msgid "called from here" msgstr "" msgid "called from here...(%1 calls omitted)" msgstr "" msgid "node processing loop detected" msgstr "" msgid "unquote-splicing expression does not evaluate to a list" msgstr "" msgid "object is read-only" msgstr "" msgid "assignment to top-level variable %1" msgstr "" msgid "invalid call to continuation" msgstr "" msgid "empty generic identifier in pattern" msgstr "" msgid "pattern is not a list" msgstr "" msgid "%1 cannot be used as a generic identifier in a pattern" msgstr "" msgid "%1 cannot occur in a pattern" msgstr "" msgid "value missing for qualifier in pattern" msgstr "" msgid "unknown pattern qualifier %1" msgstr "" msgid "bad value %1 for %2 qualifier in pattern" msgstr "" msgid "repeat qualifier not allowed inside children qualifier" msgstr "" msgid "bad value for attributes qualifier in pattern" msgstr "" msgid "characteristic %1 applied in style rule with same specificity" msgstr "" msgid "other style rule is here" msgstr "" msgid "node matches more than one pattern with the same specificity" msgstr "" msgid "reference to uninitialized variable %1" msgstr "" msgid "circular use of actual value of characteristic %1" msgstr "" msgid "characteristic %1 already defined in same part" msgstr "" msgid "flow object class %1 already defined in same part" msgstr "" msgid "mode %1 not defined" msgstr "" msgid "duplicate character name %1" msgstr "" msgid "duplicate SDATA entity name %1" msgstr "" msgid "duplicate SDATA entity text %1" msgstr "" msgid "unsupported declaration will be ignored" msgstr "" msgid "unsupported character repertoire %1 will be ignored" msgstr "" msgid "error in declaration element" msgstr "" msgid "%1 is not a valid identifier" msgstr "" msgid "error in language definition" msgstr "" msgid "no current language" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a language" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a positive integer" msgstr "" "%2 argumentet till primitiven %1 är av fel typ: %3 är inget positivt heltal" msgid "%2 argument for primitive %1 of wrong type: %3 not an integer" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a keyword" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not an alist" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a list of characters" msgstr "" msgid "%2 argument for primitive %1 has wrong length" msgstr "" msgid "quantity %1 can't be represented exactly" msgstr "" msgid "default language already declared in this part" msgstr "" msgid "%1 not a language as required in a default-language-declaration" msgstr "" msgid "%1 not a valid unit name" msgstr "" msgid "%1 not a valid character name" msgstr "" msgid "%1 not a valid character number" msgstr "" msgid "unknown character property %1" msgstr "" msgid "error in character property declaration" msgstr "" msgid "character property %1 already declared in same part" msgstr "" msgid "added value for character property %1 already declared in same part" msgstr "" msgid "previous declaration was here" msgstr "" msgid "value returned by procedure was not a sosofo" msgstr "" msgid "loop in specification of value of character property %1" msgstr "" msgid "value for character property %1 of wrong type: %2 not an integer" msgstr "" msgid "" "value for character property %1 of wrong type: %2 not an integer or the " "value \"#f\"" msgstr "" msgid "%1 not a style or transformation language feature" msgstr "" msgid "undeclared use of feature %1" msgstr "" msgid "feature %1 not supported" msgstr "" msgid "feature %1 only partially supported" msgstr "" msgid "only allowed in style language" msgstr "" msgid "only allowed in transformation language" msgstr "" msgid "style and transformation language parts mixed" msgstr "" msgid "specification is marked as partial" msgstr "" msgid "grove plan excluding module %1 not supported" msgstr "" msgid "grove plan including module %1 not supported" msgstr "" msgid "%1 not an SGML property set module" msgstr "" msgid "" "Function for char-map characteristic returned non-char object %2 for " "character %1" msgstr "" msgid "" "value for character property %1 of wrong type: %2 not a public identifier or " "the value \"#f\"" msgstr "" msgid "variable %1 occurs more than once in bindings" msgstr "" msgid "exactly one of node:, subgrove: and class: needed" msgstr "" msgid "add:, null:, remove:, children:, sub: make no sense with subgrove:" msgstr "" msgid "remove: makes no sense with class:" msgstr "" msgid "%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec" msgstr "" msgid "wrong type: %1 not a list of create-specs" msgstr "" msgid "wrong type: %1 not a create-spec or list of create-specs" msgstr "" msgid "query expression: %1 not a node list" msgstr "" msgid "priority expression: %1 not an exact integer" msgstr "" msgid "" "flow objects at the root must be all of class scroll or all of class " "page-sequence or simple-page-sequence" msgstr "" msgid "current flow parent has no principal port" msgstr "" msgid "this flow object requires a paragraph as an ancestor flow object" msgstr "" msgid "flow object not accepted by port; only inline flow objects accepted" msgstr "" msgid "flow object not accepted by port; only display flow objects accepted" msgstr "" msgid "" "flow object not accepted by port; only display or inline flow objects " "accepted" msgstr "" msgid "" "flow object not accepted in a paragraph; only inline, display or " "paragraph-break flow objects accepted" msgstr "" msgid "" "a side-by-side flow object only accepts side-by-side-item flow objects as " "children" msgstr "" msgid "" "flow object not accepted by port; only math-sequence, unmath, subscript, " "superscript, script, mark, fence, fraction, radical, math-operator, grid, " "character and alignment-point flow objects accepted" msgstr "" msgid "flow object not accepted by port; must be grid-cell" msgstr "" msgid "" "flow object not accepted by port; only a single character flow object " "accepted" msgstr "" msgid "" "flow object not accepted by port; in a table, only either table-part flow " "objects or table-column flow objects followed by table-row or table-cell " "flow objects are allowed" msgstr "" msgid "" "flow object not accepted by port; only table-row or table-cell flow objects " "accepted" msgstr "" msgid "" "flow object not accepted by port; only table-column flow objects followed by " "table-row or table-cell flow objects allowd" msgstr "" msgid "flow object not accepted by port; only table-cell flow objects accepted" msgstr "" msgid "priority-expression must be a number" msgstr "" msgid "query-expression must be a node-list" msgstr "" msgid "Sorry, non-integral priorities not implemented" msgstr "" #~ msgid "TeX backend does not currently support HTML links" #~ msgstr "TeX stöder inte ännu HTML-länkar" #~ msgid "syntactic keyword %1 not valid in call position" #~ msgstr "syntaktiskt nyckelord %1 inte tillåtet i anropsposition" #~ msgid "symbol required (got %1)" #~ msgstr "symbol krävs (istället för ç1)" #~ msgid "" #~ "%2 argument for primitive %1 of wrong type: %3 neither a string not a symbol" #~ msgstr "" #~ "%2 argumentet till primitiven %1 är av fel typ: %3 är varken en sträng eller " #~ "symbol" OpenJade-1.4devel/po/de.gmo0000644000021000000240000006200507070410065011237 Þ•Í„ì @6Cz!—1¹0ëG9/+±?Ý1Om"¦ É-×<9B@|=½Fû<B=J½9GBOŠDÚ>;^9šEÔ>=YL—Hä;-;iE¥:ëB&;i;¥=á;C[=ŸSÝR1Q„6Ö0 @>8I¸D^GR¦BùC<€—2­&à# *+ .V … (Ÿ -È ö !5!%F!l!3Œ!.À!=ï!1-"#_"Yƒ"+Ý"; # E#)f#.#¿#LÐ#$<$[$#w$›$'±$Ù$ö$1%E%\%#u%™%´%1Î%«&3¬&Nà&D/'Nt'CÃ'Æ(GÎ(x)T)fä)jK*,¶*,ã**+;+AS+ •+¶+Ó+)å+,+,?,Q,,j,#—,$»,7à,)-"B-e--$•-)º-ä-'þ-$&.K._.;t.°.<Î. /)/%=/c/'‚/ª/Ã/Ù/,÷/@$0+e0(‘0º0$Ð0õ0"1&51"\1610¶1;ç1I#2Im2R·2" 3-3-J3%x3)ž3(È3ñ3$4@54v4–4³4Ê4$Þ45 5:5X5v55ª57Ä53ü5'06X6[x6@Ô6R7&h7/7,¿78ì7)%8O8IR8'œ8%Ä81ê829O9Qo98Á9,ú9P':9x: ²:"Ó:!ö:,; E;1S;I…;AÏ;B<IT<Qž<Gð<B8=d{=@à=A!>`c>OÄ>F??[??›?NÛ?C*@@n@d¯@LA@aAG¢ASêA>>BG}B@ÅB@CBGC@ŠCLËCEDb^DVÁD]E6vE/­E5ÝE9F;MFE‰FKÏFSGSoGOÃGH*3H:^H.™H"ÈH9ëHD%I jI0‹I9¼I+öI%"JHJ.\J/‹J7»J2óJ9&K>`K,ŸKiÌK96LEpL&¶L,ÝL1 MY"RY:uY°YÌY1âYZ)3Z]ZwZŽZ2ªZZÝZ*8[2c[–[(¯[ Ø[%ù[)\$I\Fn\:µ\Eð\S6]@Š]9Ë]-^23^0f^3—^3Ë^2ÿ^"2_&U_E|_Â_&â_ `%`+;`#g`‹` ¦`Ç`å`!ÿ`!a1>a6pa-§a!Õac÷aI[bX¥b/þb3.c)bcFŒc1ÓcÉL!ËV|kÁCxw8,%Å_…’ ƒR4€ŒO1EÇŠ¾YqP+o@ “9ŽzQ·B] ¡Âi{§[fnM-±¦5m76a¶„r•*?g¬¸\«j$c ¿XsÌ—ÊuˆWœ"Jž†2ËZͲ°©K£ªšT› GHp‡³^bN>¯=`º'D™.–/tv ®Ÿ&¹A}´­¼I0¤lyÆĘ ‰¢F)ÈÀd‚<»:#½e(3‘;µ~”hUS¨¥%1%1 cannot be used as a generic identifier in a pattern%1 cannot occur in a pattern%1 color requires three arguments%1 color-space family does not take any arguments%1 is not a pre-defined inherited characteristic%1 is not a valid identifier%1 is not a valid keyword in a make expression for flow object class %2%1 is not a valid keyword in a style expression%1 is not the name of any flow object class%1 not a language as required in a default-language-declaration%1 not a style or transformation language feature%1 not a valid character name%1 not a valid character number%1 not a valid unit name%1 not an SGML property set module%1 version %2%2 argument for primitive %1 has wrong length%2 argument for primitive %1 of wrong type: %3 not a boolean%2 argument for primitive %1 of wrong type: %3 not a char%2 argument for primitive %1 of wrong type: %3 not a color-space%2 argument for primitive %1 of wrong type: %3 not a glyph-id%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table%2 argument for primitive %1 of wrong type: %3 not a keyword%2 argument for primitive %1 of wrong type: %3 not a language%2 argument for primitive %1 of wrong type: %3 not a length or length-spec%2 argument for primitive %1 of wrong type: %3 not a list%2 argument for primitive %1 of wrong type: %3 not a list of characters%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids%2 argument for primitive %1 of wrong type: %3 not a named node list%2 argument for primitive %1 of wrong type: %3 not a node list%2 argument for primitive %1 of wrong type: %3 not a number%2 argument for primitive %1 of wrong type: %3 not a pair%2 argument for primitive %1 of wrong type: %3 not a positive integer%2 argument for primitive %1 of wrong type: %3 not a procedure%2 argument for primitive %1 of wrong type: %3 not a quantity%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec%2 argument for primitive %1 of wrong type: %3 not a singleton node list%2 argument for primitive %1 of wrong type: %3 not a sosofo%2 argument for primitive %1 of wrong type: %3 not a string%2 argument for primitive %1 of wrong type: %3 not a string or symbol%2 argument for primitive %1 of wrong type: %3 not a style%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec%2 argument for primitive %1 of wrong type: %3 not a symbol%2 argument for primitive %1 of wrong type: %3 not a vector%2 argument for primitive %1 of wrong type: %3 not an address%2 argument for primitive %1 of wrong type: %3 not an alist%2 argument for primitive %1 of wrong type: %3 not an exact integer%2 argument for primitive %1 of wrong type: %3 not an integer%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol "force"%2 argument for primitive %1 of wrong type: %3 not an optional singleton node listFunction for char-map characteristic returned non-char object %2 for character %1TeX backend does not currently support HyTime linkendsTeX backend does not currently support TEI linksTeX backend does not currently support glyph substitution tablesTeX backend does not currently support links to entitiesTeX backend does not currently support links to nodes other than elementsTeX backend does not currently support links to other SGML documentsTeX backend does not currently support references to page numbers of nodes other than elementsa side-by-side flow object only accepts side-by-side-item flow objects as childrenadd:, null:, remove:, children:, sub: make no sense with subgrove:added value for character property %1 already declared in same partargument not a keywordargument out of rangearguments for %1 color must be in the range 0 to 1arguments for %1 color must be numbersassignment to top-level variable %1attempt to process node in illegal contextattempt to use current node when there is nonebad form %1 in mode groupbad value %1 for %2 qualifier in patternbad value for attributes qualifier in patternbad value specified for unit %1call of non-function object %1called from herecalled from here...(%1 calls omitted)cannot open output file %1 (%2)character property %1 already declared in same partcharacteristic %1 already defined in same partcharacteristic %1 applied in style rule with same specificitycircular use of actual value of characteristic %1circular use of specification partscontent expression cannot be specified in make expression for atomic flow object class %1content map references non-existent port %1could not convert system identifier %1 to a single filenamecould not embed %1 with clsid %2current flow parent has no principal portdefault language already declared in this partdivision by zerodocument did not contain any style-specifications or external-specificationsduplicate SDATA entity name %1duplicate SDATA entity text %1duplicate character name %1empty generic identifier in patternempty output filenameerror in character property declarationerror in declaration elementerror in language definitionexactly one of node:, subgrove: and class: neededexpected "else" not %1feature %1 not supportedfeature %1 only partially supportedfirst declaration was herefirst definition was hereflow object class %1 already defined in same partflow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowedflow object not accepted by port; must be grid-cellflow object not accepted by port; only a single character flow object acceptedflow object not accepted by port; only display flow objects acceptedflow object not accepted by port; only display or inline flow objects acceptedflow object not accepted by port; only inline flow objects acceptedflow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects acceptedflow object not accepted by port; only table-cell flow objects acceptedflow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowdflow object not accepted by port; only table-row or table-cell flow objects acceptedflow object not accepted in a paragraph; only inline, display or paragraph-break flow objects acceptedflow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequencegrove plan excluding module %1 not supportedgrove plan including module %1 not supportedidentifier %1 already defined in same partincompatible dimensionsinitial value already declared for characteristic %1 in same partinvalid AFII glyph identifier %1invalid call to continuationinvalid characterinvalid character %1 in public identifierinvalid character after '#'invalid content mapinvalid number %1invalid number format %1invalid parameters for %1 color-space familyinvalid value for %1 characteristicloop in specification of value of %1loop in specification of value of character property %1loop in specification of value of unit %1missing argument for function callmissing closing parenthesismode %1 not definednested tables are not allowed in RTFno DSSSL specification: use -d to specifyno character with name %1no clause in case expression matched %1no clause in cond expression matchedno current languageno port for label %1no style-specification or external-specification with ID %1no value for node property %1node matches more than one pattern with the same specificitynode processing loop detectedobject is read-onlyodd number of keyword/value argumentsonly allowed in style languageonly allowed in transformation languageother style rule is herepattern is not a listprevious declaration was herepriority expression: %1 not an exact integerprocedure can only be used in evaluation of characteristic valueprocedure does not have %1 keyword argumentquantity %1 can't be represented exactlyquantity %1 undefinedquery expression: %1 not a node listradix must be 2, 8, 10 or 16reference to undefined variable %1reference to uninitialized variable %1remove: makes no sense with class:repeat qualifier not allowed inside children qualifierresult of procedure in %1 color must be a numberroot rule already defined in same part with same importancesorry, cannot handle unresolvable quantities in datums in case expressionspecification document did not contain a style-specification-body elementspecification document does not have the DSSSL architecture as a base architecturespecification is marked as partialstring with no closing quotestyle and transformation language parts mixedsyntactic keyword %1 used as variabletable-cell flow object not inside a tabletable-row flow object not inside a tablethis context requires a sosofothis context requires a style objectthis flow object requires a paragraph as an ancestor flow objecttoo many arguments for functionundeclared use of feature %1unexpected end of fileunexpected token %1unit %1 already defined in same partunknown #! named constant %1unknown character name %1unknown character property %1unknown color-space family %1unknown output type %1unknown pattern qualifier %1unknown top level form %1unquote-splicing expression does not evaluate to a listunsupported character repertoire %1 will be ignoredunsupported declaration will be ignoredvalue for "label:" not a symbolvalue for character property %1 of wrong type: %2 not a public identifier or the value "#f"value for character property %1 of wrong type: %2 not an integervalue for character property %1 of wrong type: %2 not an integer or the value "#f"value missing for qualifier in patternvalue returned by procedure was not a node-listvalue returned by procedure was not a sosofowrong type: %1 not a create-spec or list of create-specswrong type: %1 not a list of create-specs%1%1 kann nicht als generischer Bezeichner in einem Muster verwendet werden%1 kann in einem Muster nicht vorkommenEine %1 Farbe benötigt drei ArgumenteDie %1 Farbraumfamilie akzeptiert keine Argumente%1 ist keine vordefinierte vererbte Charakteristik%1 ist kein gültiger Bezeichner%1 ist kein gültiges Schlüsselwort in einem make-Ausdruck für Flußobjektklasse %2%1 ist kein gültiges Schlüsselwort in einem Stilausdruck%1 ist nicht der Name einer Flußobjektklasse%1 ist keine Sprache wie sie in einer default-language-declaration benötigt wird%1 ist kein Feature der Stil- oder Transformationssprache%1 ist kein gültiger Zeichenname%1 ist keine gültige Zeichennummer%1 ist kein gültiger Einheitsname%1 ist kein Modul der SGML-Eigenschaftsmenge%1 Version %2%2 Argument für Funktion %1 hat die falsche Länge%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein boolescher Wert%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Zeichen%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Farbraum%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Glyphbezeichner%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Glyphersetzungstabelle%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Schlüsselwort%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Sprache%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine Länge noch eine Längen-Spezifikation%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Liste%2 Argument für Funktion %1 vom falschen Typ: %3 ist Zeichenliste%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Liste von Paaren von Glyphbezeichnern%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine benannte Knotenliste%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Knotenliste%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Zahl%2 Argument für Funktion %1 vom falschen Type: %3 ist kein Paar%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine positive ganze Zahl%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Prozedur%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Größe%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine Größe noch eine Längen-Spezifikation%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Einzelknotenliste%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Sosofo%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Zeichenkette%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder Zeichenkette noch Symbol%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Stil%2 Argument für Funktion %1 vom falschen Typ: %2 ist kein subgrove-spec%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Symbol%2 Argument für Funktion %1 vom falschen Typ: %3 ist kein Vektor%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine Adresse%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine alist%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine exakte ganze Zahl%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine ganze Zahl%2 Argument für Funktion %1 vom falschen Typ: %3 ist weder eine ganze Zahl noch das Symbol "force"%2 Argument für Funktion %1 vom falschen Typ: %3 ist keine optionale EinzelknotenlisteDie Funktion für die char-map Charakteristik lieferte für das Zeichen %1 das nicht-Zeichen %2TeX Ausgabe unterstützt keine HyTime VerknüpfungsendenTeX Ausgabe unterstützt keine TEI VerknüpfungenTeX Ausgabe unterstützt keine GlyphersetzungstabellenTeX Ausgabe unterstützt keine Verknüpfungen auf EntitätenTeX Ausgabe unterstützt Verknüpfungen nur für ElementknotenTeX Ausgabe unterstützt keine Verknüpfungen auf andere SGML DokumenteTeX Ausgabe unterstützt Querverweise auf Seitenzahlen nur für ElementknotenEin side-by-side Flußobjekt akzeptiert nur side-by-side-item Flußobjekte als Kinderadd:, null:, remove:, children: oder sub: machen zusammen mit subgrove: keinen SinnNeuer Wert für Zeicheneigenschaft %1, die bereits im selben Teil deklariert warArgument ist kein SchlüsselwortArgument außerhalb des zulässigen BereichsArgumente für eine %1 Farbe müssen zwischen 0 und 1 liegenArgumente für eine %1 Farbe müssen Zahlen seinZuweisung an Top-Level Variable %1Versuch, einen Knoten in illegalem Kontext zu verarbeitenVersuch, den gegenwärtigen Knoten zu benutzen, obwohl es keinen gibtSchlechte Form %1 in ModusgruppeSchlechter Wert %1 für Qualifikator %2 im MusterSchlechter Wert für den attributes Qualifikator im MusterSchlechter Wert für Einheit %1 spezifiziertAufruf des nicht-Funktionsobjektes %1von hier aufgerufenvon hier aufgerufen...(%1 Aufrufe weggelassen)Ausgabedatei %1 kann nicht geöffnet werden (%2)Zeicheneigenschaft %1 bereits im selben Teil deklariertCharakteristik %1 bereits im selben Teil definiertCharakteristik %1 in Stilregel mit derselben SpezifizitätZirkuläre Benutzung des aktuellen Wertes der Charakteristik %1Zirkuläre Benutzung von SpezifikationsteilenInhaltsausdruck kann in einem make-Ausdruck für die atomare Flußobjektklasse %1 nicht spezifiziert werdenInhaltsabbildung referenziert nicht existierenden Port %1Konnte Systembezeichner %1 nicht in einzelnen Dateinamen konvertierenKonnte %1 nicht mit clsid %2 einbettenGegenwärtiger Flußvater hat keinen HauptportStandardsprache bereits im selben Teil deklariertTeilung durch NullDas Dokument enthielt weder style-specification noch external-specificaton ElementeDoppelter SDATA-Entitätsname %1Doppelter SDATA-Entitätstext %1Doppelter Zeichenname %1Leerer generischer Bezeichner in MusterLeerer AusgabedateinameFehler in ZeicheneigenschaftsdeklarationFehler in DeklarationselementFehler in SprachdefinitionGenau eines von node:, subgrove: und class: benötigtErwartete "else", nicht %1Feature %1 nicht unterstütztFeature %1 nur teilweise unterstützterste Deklaration war hiererste Definition war hierFlußobjektklasse %1 bereits im selben Teil definiertFlußobjekt nicht vom Port akzeptiert: in einer Tabelle werden entweder nur table-part Flußobjekte oder table-column Flußobjekte, gefolgt von table-row oder table-column Flußobjekten, akzeptiertFlußobjekt nicht vom Port akzeptiert: muß ein grid-cell Flußobjekt seinFlußobjekt nicht vom Port akzeptiert: nur ein einzelnes character Flußobjekt akzeptiertFlußobjekt nicht vom Port akzeptiert: nur display Flußobjekte akzeptiertFlußobjekt nicht vom Port akzeptiert: nur display oder inline Flußobjekte akzeptiertFlußobjekt nicht vom Port akzeptiert: nur inline Flußobjekte akzeptiertFlußobjekt nicht vom Port akzeptiert: nur math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character und alignment-point Flußobjekte akzeptiertFlußobjekt nicht vom Port akzeptiert: nur table-cell Flußobjekte akzeptiertFlußobjekt nicht vom Port akzeptiert: nur table-column Flußobjekte, gefolgt von table-row oder table-cell Flußobjekten, akzeptiertFlußobjekt nicht vom Port akzeptiert: nur table-row oder table-cell Flußobjekte akzeptiertFlußobjekt nicht innerhalb eines paragraph Flußobjekts akzeptiert: nur inline, display oder paragraph-break Flußobjekte akzeptiertFlußobjekte an der Wurzel müssen all der Klasse scroll oder alle den Klassen page-sequence oder simple-page-sequence angehörenGroveplan ohne Modul %1 nicht unterstütztGroveplan mit Modul %1 nicht unterstütztBezeichner %1 bereits im selben Teil definiertInkompatible DimensionenInitialer Wert für Charakteristik %1 bereits im selben Teil deklariertUngültiger AFII Glyphbezeichner %1Ungültiger Aufruf einer FortsetzungUngültiges ZeichenUngültiges Zeichen in öffentlichem BezeichnerUngültiges Zeichen nach '#'Ungültige InhaltsabbildungUngültige Zahl %1Ungültiges Zahlformat %1Ungültige Parameter für die %1 FarbraumfamilieUngültiger Wert für Charakteristik %1Schleife in der Spezifikation des Wertes von %1Schleife in der Spezifikation des Wertes von Zeicheneigenschaft %1Schleife in der Spezifikation des Wertes der Einheit %1Fehlendes Argument für FunktionsaufrufFehlende schließende KlammerModus %1 nicht definiertVerschachtelte Tabellen sind in RTF nicht erlaubtKeine DSSSL Spezifikation: verwende -d, um sie zu spezifizierenKein Zeichen mit Namen %1Keine Klausel im case-Ausdruck passte zu %1Keine Klausel im cond-Ausdruck traf zuKeine gegenwärtige SpracheKein Port für Label %1Keine style-specification oder external-specificaton mit ID %1Kein Wert für Knoteneigenschaft %1Knoten passt zu meheren Mustern mit derselben SpezifizitätKnotenverarbeitungsschleifeObjekt ist nur lesbarUngerade Anzahl von Schlüsselwort/Wert ArgumentenNur in der Stilsprache erlaubtNur in der Transformationssprache erlaubtdie andere Regel ist hierMuster ist keine Listevorige Deklaration war hierPrioritätsausdruck: %1 ist keine exakte ganze ZahlDiese Prozedur kann nur in der Auswertung des Wertes einer Charakteristik verwendet werdenProzedur hat kein %1 SchlüsselwortargumentDie Größe %1 kann nicht exakt repräsentiert werdenQuantität %1 undefiniertquery-Ausdruck: %1 ist keine KnotenlisteWurzel muß 2, 8, 10 oder 16 seinReferenz auf undefinierte Variable %1Referenz auf uninitialisierte Variable %1remove: macht keinen Sinn mit class:repeat Qualifikator nicht innerhalb des children Qualifikators erlaubtErgebnis der Prozedur in einer %1 Farbe muß eine Zahl seinRoot-Regel bereits im selben Teil mit derselben Wichtigkeit definiertSorry, kann unauflösbare Quantitäten in Datums in case-Ausdrücken nicht verarbeitenDie Spezifikation enthielt kein style-specification-body ElementDie Spezifikation basiert nicht auf der DSSSL ArchitekturSpezifikation ist als partiell gekennzeichnetZeichenkette ohne abschließendes AnführungszeichenVermischung von Stil- und TransformationsspracheSyntaktisches Schlüsselwort %1 als Variable benutzttable-cell Flußobjekt nicht innerhalb einer Tabelletable-row Flußobjekt nicht innerhalb einer TabelleDieser Kontext benötigt ein SosofoDieser Kontext benötigt ein StilobjektDieses Flußobjekt benötigt ein paragraph Flußobjekt als FlußvorgängerZu viele Argumente für FunktionUndeklarierte Benutzung von Feature %1Unerwartetes Ende der DateiUnerwartetes Token %1Einheit %1 bereits im selben Teil definiertUnbekannte #! benannte Konstante %1Unbekannter Zeichenname %1Unbekannte Zeicheneigenschaft %1Unbekannte Farbraumfamilie %1Unbekannter Ausgabetyp %1Unbekannter Musterqualifikator %1Unbekannte Top-Level Form %1unqote-splicing Ausdruck hat keine Liste als WertNicht unterstütztes Zeichenrepertoir %1 wird ignoriertNicht unterstützte Deklaration wird ignoriertWert für "label:" ist kein SymbolWert für Zeicheneigenschaft %1 vom falschen Typ: %2 ist weder ein öffentlicher Bezeichner noch "#f"Wert der Zeicheneigenschaft %1 vom falschen Type: %2 ist keine ganze ZahlWert der Zeicheneigenschaft %1 vom falschen Type: %2 ist weder eine ganze Zahl noch "#f"Im Muster fehlt ein Wert für einen QualifikatorDer Rückgabewert der Prozedur war keine KnotenlisteRückgabewert der Prozedur war kein SosofoFalscher Typ: %1 ist kein create-spec und keine Liste von create-specsFalscher Typ: %1 ist keine Liste von create-specsOpenJade-1.4devel/po/sv.gmo0000644000021000000240000001645207070410065011304 Þ•A$Y, ‘<Ÿ9Ü@9W>‘;Ð9 EF>Œ=Ë; ;EE:Ç; ;> =z C¸ Sü P 6c 0š @Ë 8 IE D ^Ô 3 O e  Ÿ ¾ ;Þ  ; Q h *‚ ­ Å æ ø $&)K"u˜$´)Ù%C"Y|%™¿ßö$ /LcV} ÔMâB0OsAÃD?JBŠKÍDE^B¤BçL*CwB»BþBAH„YÍ'">a.*°7Û4>H‡¦Ã*â' '59]!—¹Öî. 8#Pt… -°9Þ#<(Q4z¯#Èì%"-,P }ž®+¿ë6%;3#@< >25 8& :0 *.$7 +9 ?"/!1)-(4'=,A%1 version %2%2 argument for primitive %1 of wrong type: %3 not a boolean%2 argument for primitive %1 of wrong type: %3 not a char%2 argument for primitive %1 of wrong type: %3 not a color-space%2 argument for primitive %1 of wrong type: %3 not a list%2 argument for primitive %1 of wrong type: %3 not a node list%2 argument for primitive %1 of wrong type: %3 not a number%2 argument for primitive %1 of wrong type: %3 not a pair%2 argument for primitive %1 of wrong type: %3 not a positive integer%2 argument for primitive %1 of wrong type: %3 not a procedure%2 argument for primitive %1 of wrong type: %3 not a quantity%2 argument for primitive %1 of wrong type: %3 not a sosofo%2 argument for primitive %1 of wrong type: %3 not a string%2 argument for primitive %1 of wrong type: %3 not a string or symbol%2 argument for primitive %1 of wrong type: %3 not a style%2 argument for primitive %1 of wrong type: %3 not a symbol%2 argument for primitive %1 of wrong type: %3 not a vector%2 argument for primitive %1 of wrong type: %3 not an address%2 argument for primitive %1 of wrong type: %3 not an exact integer%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol "force"Send output to %1.TeX backend does not currently support HyTime linkendsTeX backend does not currently support TEI linksTeX backend does not currently support glyph substitution tablesTeX backend does not currently support links to entitiesTeX backend does not currently support links to nodes other than elementsTeX backend does not currently support links to other SGML documentsTeX backend does not currently support references to page numbers of nodes other than elementsUse DSSSL specification %1.argument out of rangebad form %1 in mode groupbad value specified for unit %1call of non-function object %1cannot open output file %1 (%2)could not convert system identifier %1 to a single filenamecould not embed %1 with clsid %2empty output filenameexpected "else" not %1first definition was hereidentifier %1 already defined in same partincompatible dimensionsinvalid AFII glyph identifier %1invalid characterinvalid character after '#'invalid number %1loop in specification of value of %1loop in specification of value of unit %1missing argument for function callmissing closing parenthesisnested tables are not allowed in RTFno DSSSL specification: use -d to specifyno character with name %1odd number of keyword/value argumentsquantity %1 undefinedreference to undefined variable %1string with no closing quotesyntactic keyword %1 used as variabletoo many arguments for functionunexpected end of fileunexpected token %1unit %1 already defined in same partunknown #! named constant %1unknown output type %1unknown top level form %1Project-Id-Version: OpenJade 1.4 POT-Creation-Date: 2000-03-28 14:20+0000 PO-Revision-Date: 1999-12-08 23:03+01:00 Last-Translator: Peter Nilsson Language-Team: Swedish MIME-Version:: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit POT-Created-Date: 1999-12-08 21:56+0000 %1 version %2%2 argumentet till primitiven %1 är av fel typ: %3 är inte ett booleskt värde%2 argumentet till primitiven %1 är av fel typ: %3 är inget tecken%2 argumentet till primitiven %1 är av fel typ: %3 är inte av typen color-space%2 argumentet till primitiven %1 är av fel typ: %3 är ingen lista%2 argumentet till primitiven %1 är av fel typ: %3 är ingen nodlista%2 argumentet till primitiven %1 är av fel typ: %3 är inget tal%2 argumentet till primitiven %1 är av fel typ: %3 är inte ett par%2 argumentet till primitiven %1 är av fel typ: %3 är inget positivt heltal%2 argumentet till primitiven %1 är av fel typ: %3 är ingen procedur%2 argumentet till primitiven %1 är av fel typ: %3 är ingen kvantitet%2 argumentet till primitiven %1 är av fel typ: %3 är ingen sosofo%2 argumentet till primitiven %1 är av fel typ: %3 är ingen sträng%2 argumentet till primitiven %1 är av fel typ: är ingen sträng eller symbol%2 argumentet till primitiven %1 är av fel typ: %3 inget stilobjekt%2 argumentet till primitiven %1 är av fel typ: %3 är ingen symbol%2 argumentet till primitiven %1 är av fel typ: %3 är ingen vektor%2 argumentet till primitiven %1 är av fel typ: %3 är ingen adress%2 argumentet till primitiven %1 är av fel typ: %3 är inget exakt heltal%2 argumentet till primitiven %1 är av fel typ: %3 är inget heltal eller symbolen "force"Skicka utdata till %1.TeX stöder inte ännu HyTime-länkarTeX stöder inte ännu TEI-länkarTeX stöder inte ännu glyph-ersättningstabellerTeX stöder inte ännu länkar till entiteterTeX stöder inte ännu länkar till andra noder än elementTeX stöder inte ännu länkar till andra SGML-dokumentTeX stöder inte ännu sidreferenser till andra noder än elementAnvänd DSSSL-specifikation %1.argument ej i giltigt områdeotillåten form %1 i mode-gruppfelaktigt värde angivet för måttenheten %1anrop av objekt som inte är function %1kan inte öppna filen %1 för utdata (%2)kan inte göra om systemidentifieraren %1 till ett filnamnkan inte bädda in %1 med clsid %2tomt filnamn för utdatafilenväntade "else", inte %1första definitionen är häridentifieraren %1 redan definierad i denna delokompatibla dimensionerogiltig AFFI-glyph-identifierare %1otillåtet teckenotillåtet tecken efter "#"ogiltigt tal %1specifikation av värde för %1 förorsakar loopspecifikation av värde för måttenheten %1 förorsakar loopargument saknas till funktionsanrophögerparentes saknasnästlade tabeller är inte tillåtna i RTFingen DSSSL-specifikation: använd -d för att ange eninget tecken med namn %1udda antal nyckelord/värde-argumentmåttenheten %1 odefinieradreferens till odefinierad variabel %1sträng utan avslutande citatteckensyntaktiskt nyckelord %1 använt som variabelför många argument till funktionoväntat filslutoväntat token %1måttenheten %1 redan definierad i denna delokänd #!-konstant %1okänd utdatatyp %1okänd toppnivå-form %1OpenJade-1.4devel/po/cat-id-tbl.c0000644000021000000240000003273307070130654012237 /* Automatically generated by po2tbl.sed from jade.pot. */ #if HAVE_CONFIG_H # include #endif #include "libgettext.h" const struct _msg_ent _msg_tbl[] = { {"", 1}, {"cannot open output file %1 (%2)", 2}, {"unknown output type %1", 3}, {"empty output filename", 4}, {"Use the backend %1.", 5}, {"Send output to %1.", 6}, {"FILE", 7}, {"TYPE", 8}, {"could not convert system identifier %1 to a single filename", 9}, {"missing table column flow object (table-auto-width feature not fully supported)", 10}, {"nested tables are not allowed in RTF", 11}, {"could not embed %1 with clsid %2", 12}, {"TeX backend does not currently support references to page numbers of nodes other than elements", 13}, {"TeX backend does not currently support links to nodes other than elements", 14}, {"TeX backend does not currently support links to entities", 15}, {"TeX backend does not currently support links to other SGML documents", 16}, {"TeX backend does not currently support HyTime linkends", 17}, {"TeX backend does not currently support TEI links", 18}, {"TeX backend does not currently support glyph substitution tables", 19}, {"%1 version %2", 20}, {"no DSSSL specification: use -d to specify", 21}, {"no applicable processing instruction with title %1; available titles: %2", 22}, {"Options with a \"doc-\"/\"spec-\" prefix apply only to the document/specification.", 23}, {"Enable experimental DSSSL extensions.", 24}, {"Debug mode.", 25}, {"Use DSSSL specification %1.", 26}, {"Use DSSSL specification with title %1.", 27}, {"Pretend that %1 appeared in the specification.", 28}, {"Strict DSSSL compliance mode.", 29}, {"Show open entities in error messages.", 30}, {"Show open elements in error messages.", 31}, {"Show error numbers in error messages.", 32}, {"Show references in error messages.", 33}, {"Define parameter entity %1 as \"INCLUDE\".", 34}, {"Enable warning %1.", 35}, {"SYSID", 36}, {"DEFINITION", 37}, {"NAME", 38}, {"unexpected end of file", 39}, {"invalid character", 40}, {"invalid character after '#'", 41}, {"unknown #! named constant %1", 42}, {"unexpected token %1", 43}, {"string with no closing quote", 44}, {"missing closing parenthesis", 45}, {"invalid number %1", 46}, {"invalid AFII glyph identifier %1", 47}, {"call of non-function object %1", 48}, {"too many arguments for function", 49}, {"odd number of keyword/value arguments", 50}, {"missing argument for function call", 51}, {"syntactic keyword %1 used as variable", 52}, {"reference to undefined variable %1", 53}, {"no character with name %1", 54}, {"unknown top level form %1", 55}, {"bad form %1 in mode group", 56}, {"identifier %1 already defined in same part", 57}, {"first definition was here", 58}, {"loop in specification of value of %1", 59}, {"argument out of range", 60}, {"loop in specification of value of unit %1", 61}, {"bad value specified for unit %1", 62}, {"unit %1 already defined in same part", 63}, {"quantity %1 undefined", 64}, {"incompatible dimensions", 65}, {"%2 argument for primitive %1 of wrong type: %3 not a boolean", 66}, {"%2 argument for primitive %1 of wrong type: %3 not a pair", 67}, {"%2 argument for primitive %1 of wrong type: %3 not a list", 68}, {"%2 argument for primitive %1 of wrong type: %3 not a symbol", 69}, {"%2 argument for primitive %1 of wrong type: %3 not a string", 70}, {"%2 argument for primitive %1 of wrong type: %3 not a string or symbol", 71}, {"%2 argument for primitive %1 of wrong type: %3 not a char", 72}, {"%2 argument for primitive %1 of wrong type: %3 not a style", 73}, {"%2 argument for primitive %1 of wrong type: %3 not an exact integer", 74}, {"%2 argument for primitive %1 of wrong type: %3 not a quantity", 75}, {"%2 argument for primitive %1 of wrong type: %3 not a color-space", 76}, {"%2 argument for primitive %1 of wrong type: %3 not a number", 77}, {"%2 argument for primitive %1 of wrong type: %3 not a sosofo", 78}, {"%2 argument for primitive %1 of wrong type: %3 not an optional singleton node list", 79}, {"%2 argument for primitive %1 of wrong type: %3 not a singleton node list", 80}, {"%2 argument for primitive %1 of wrong type: %3 not a node list", 81}, {"%2 argument for primitive %1 of wrong type: %3 not a named node list", 82}, {"%2 argument for primitive %1 of wrong type: %3 not a length or length-spec", 83}, {"%2 argument for primitive %1 of wrong type: %3 not a quantity or length-spec", 84}, {"%2 argument for primitive %1 of wrong type: %3 not an integer or the symbol \"force\"", 85}, {"%2 argument for primitive %1 of wrong type: %3 not an address", 86}, {"%2 argument for primitive %1 of wrong type: %3 not a glyph-id", 87}, {"%2 argument for primitive %1 of wrong type: %3 not a glyph-subst-table", 88}, {"%2 argument for primitive %1 of wrong type: %3 not a list of pairs of glyph-ids", 89}, {"%2 argument for primitive %1 of wrong type: %3 not a procedure", 90}, {"%2 argument for primitive %1 of wrong type: %3 not a vector", 91}, {"root rule already defined in same part with same importance", 92}, {"initial value already declared for characteristic %1 in same part", 93}, {"first declaration was here", 94}, {"%1 is not a valid keyword in a style expression", 95}, {"%1 is not a valid keyword in a make expression for flow object class %2", 96}, {"%1 is not the name of any flow object class", 97}, {"content expression cannot be specified in make expression for atomic flow object class %1", 98}, {"value for \"label:\" not a symbol", 99}, {"no port for label %1", 100}, {"invalid content map", 101}, {"content map references non-existent port %1", 102}, {"invalid value for %1 characteristic", 103}, {"no clause in cond expression matched", 104}, {"no clause in case expression matched %1", 105}, {"expected \"else\" not %1", 106}, {"sorry, cannot handle unresolvable quantities in datums in case expression", 107}, {"%1", 108}, {"division by zero", 109}, {"procedure does not have %1 keyword argument", 110}, {"argument not a keyword", 111}, {"specification document does not have the DSSSL architecture as a base architecture", 112}, {"specification document did not contain a style-specification-body element", 113}, {"unknown character name %1", 114}, {"attempt to use current node when there is none", 115}, {"attempt to process node in illegal context", 116}, {"radix must be 2, 8, 10 or 16", 117}, {"this context requires a sosofo", 118}, {"this context requires a style object", 119}, {"procedure can only be used in evaluation of characteristic value", 120}, {"%1 color requires three arguments", 121}, {"arguments for %1 color must be numbers", 122}, {"arguments for %1 color must be in the range 0 to 1", 123}, {"result of procedure in %1 color must be a number", 124}, {"unknown color-space family %1", 125}, {"%1 color-space family does not take any arguments", 126}, {"invalid parameters for %1 color-space family", 127}, {"%1 is not a pre-defined inherited characteristic", 128}, {"invalid number format %1", 129}, {"invalid character %1 in public identifier", 130}, {"debug %1", 131}, {"circular use of specification parts", 132}, {"no style-specification or external-specification with ID %1", 133}, {"document did not contain any style-specifications or external-specifications", 134}, {"table-cell flow object not inside a table", 135}, {"table-row flow object not inside a table", 136}, {"no value for node property %1", 137}, {"value returned by procedure was not a node-list", 138}, {"called from here", 139}, {"called from here...(%1 calls omitted)", 140}, {"node processing loop detected", 141}, {"unquote-splicing expression does not evaluate to a list", 142}, {"object is read-only", 143}, {"assignment to top-level variable %1", 144}, {"invalid call to continuation", 145}, {"empty generic identifier in pattern", 146}, {"pattern is not a list", 147}, {"%1 cannot be used as a generic identifier in a pattern", 148}, {"%1 cannot occur in a pattern", 149}, {"value missing for qualifier in pattern", 150}, {"unknown pattern qualifier %1", 151}, {"bad value %1 for %2 qualifier in pattern", 152}, {"repeat qualifier not allowed inside children qualifier", 153}, {"bad value for attributes qualifier in pattern", 154}, {"characteristic %1 applied in style rule with same specificity", 155}, {"other style rule is here", 156}, {"node matches more than one pattern with the same specificity", 157}, {"reference to uninitialized variable %1", 158}, {"circular use of actual value of characteristic %1", 159}, {"characteristic %1 already defined in same part", 160}, {"flow object class %1 already defined in same part", 161}, {"mode %1 not defined", 162}, {"duplicate character name %1", 163}, {"duplicate SDATA entity name %1", 164}, {"duplicate SDATA entity text %1", 165}, {"unsupported declaration will be ignored", 166}, {"unsupported character repertoire %1 will be ignored", 167}, {"error in declaration element", 168}, {"%1 is not a valid identifier", 169}, {"error in language definition", 170}, {"no current language", 171}, {"%2 argument for primitive %1 of wrong type: %3 not a language", 172}, {"%2 argument for primitive %1 of wrong type: %3 not a positive integer", 173}, {"%2 argument for primitive %1 of wrong type: %3 not an integer", 174}, {"%2 argument for primitive %1 of wrong type: %3 not a keyword", 175}, {"%2 argument for primitive %1 of wrong type: %3 not an alist", 176}, {"%2 argument for primitive %1 of wrong type: %3 not a list of characters", 177}, {"%2 argument for primitive %1 has wrong length", 178}, {"quantity %1 can't be represented exactly", 179}, {"default language already declared in this part", 180}, {"%1 not a language as required in a default-language-declaration", 181}, {"%1 not a valid unit name", 182}, {"%1 not a valid character name", 183}, {"%1 not a valid character number", 184}, {"unknown character property %1", 185}, {"error in character property declaration", 186}, {"character property %1 already declared in same part", 187}, {"added value for character property %1 already declared in same part", 188}, {"previous declaration was here", 189}, {"value returned by procedure was not a sosofo", 190}, {"loop in specification of value of character property %1", 191}, {"value for character property %1 of wrong type: %2 not an integer", 192}, {"value for character property %1 of wrong type: %2 not an integer or the value \"#f\"", 193}, {"%1 not a style or transformation language feature", 194}, {"undeclared use of feature %1", 195}, {"feature %1 not supported", 196}, {"feature %1 only partially supported", 197}, {"only allowed in style language", 198}, {"only allowed in transformation language", 199}, {"style and transformation language parts mixed", 200}, {"specification is marked as partial", 201}, {"grove plan excluding module %1 not supported", 202}, {"grove plan including module %1 not supported", 203}, {"%1 not an SGML property set module", 204}, {"Function for char-map characteristic returned non-char object %2 for character %1", 205}, {"value for character property %1 of wrong type: %2 not a public identifier or the value \"#f\"", 206}, {"variable %1 occurs more than once in bindings", 207}, {"exactly one of node:, subgrove: and class: needed", 208}, {"add:, null:, remove:, children:, sub: make no sense with subgrove:", 209}, {"remove: makes no sense with class:", 210}, {"%2 argument for primitive %1 of wrong type: %3 not a subgrove-spec", 211}, {"wrong type: %1 not a list of create-specs", 212}, {"wrong type: %1 not a create-spec or list of create-specs", 213}, {"query expression: %1 not a node list", 214}, {"priority expression: %1 not an exact integer", 215}, {"flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence", 216}, {"current flow parent has no principal port", 217}, {"this flow object requires a paragraph as an ancestor flow object", 218}, {"flow object not accepted by port; only inline flow objects accepted", 219}, {"flow object not accepted by port; only display flow objects accepted", 220}, {"flow object not accepted by port; only display or inline flow objects accepted", 221}, {"flow object not accepted in a paragraph; only inline, display or paragraph-break flow objects accepted", 222}, {"a side-by-side flow object only accepts side-by-side-item flow objects as children", 223}, {"flow object not accepted by port; only math-sequence, unmath, subscript, superscript, script, mark, fence, fraction, radical, math-operator, grid, character and alignment-point flow objects accepted", 224}, {"flow object not accepted by port; must be grid-cell", 225}, {"flow object not accepted by port; only a single character flow object accepted", 226}, {"flow object not accepted by port; in a table, only either table-part flow objects or table-column flow objects followed by table-row or table-cell flow objects are allowed", 227}, {"flow object not accepted by port; only table-row or table-cell flow objects accepted", 228}, {"flow object not accepted by port; only table-column flow objects followed by table-row or table-cell flow objects allowd", 229}, {"flow object not accepted by port; only table-cell flow objects accepted", 230}, {"priority-expression must be a number", 231}, {"query-expression must be a node-list", 232}, {"Sorry, non-integral priorities not implemented", 233}, }; int _msg_tbl_length = 233;